commit
86b3bbd714
@ -1,19 +1,16 @@
|
|||||||
To make the CubeSat Simulator transmit automatically on boot, follow these steps, which were derived from https://www.mauras.ch/systemd-run-it-last.html
|
To make the CubeSat Simulator transmit automatically on boot, follow these steps, which were derived from https://www.raspberrypi.org/documentation/linux/usage/systemd.md
|
||||||
|
|
||||||
On the Pi, if you are not already in this directory:
|
|
||||||
|
|
||||||
cd ~/CubeSatSim/systemd
|
Log into the Pi and type:
|
||||||
|
|
||||||
sudo cp custom.target /etc/systemd/system/custom.target
|
sudo cp ~/CubeSatSim/cubesatsim.service /etc/systemd/system/cubesatsim.service
|
||||||
|
|
||||||
sudo mkdir /etc/systemd/system/custom.target.wants
|
sudo systemctl enable cubesatsim
|
||||||
|
|
||||||
sudo cp cubesatsim.service /etc/systemd/system/custom.target.wants/cubesatsim.service
|
Reboot to start the autoboot service:
|
||||||
|
|
||||||
sudo systemctl isolate custom.target
|
sudo reboot now
|
||||||
|
|
||||||
sudo ln -sf /etc/systemd/system/custom.target /etc/systemd/system/default.target
|
Now after the Pi starts up, the demo.sh script will run automatically, and the console will log to ~/CubeSatSim/log.txt To see it:
|
||||||
|
|
||||||
Now after a reboot (sudo reboot now), the demo.sh script will run automatically, and the console will log to ~/CubeSatSim/log.txt To see it:
|
|
||||||
|
|
||||||
tail ~/CubeSatSim/log.txt
|
tail ~/CubeSatSim/log.txt
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=My last command
|
Description=My service
|
||||||
After=multi-user.target
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
|
||||||
ExecStart=/home/pi/CubeSatSim/demo.sh > /home/pi/CubeSatSim/log.txt 2>&1
|
ExecStart=/home/pi/CubeSatSim/demo.sh > /home/pi/CubeSatSim/log.txt 2>&1
|
||||||
|
WorkingDirectory=/home/pi/CubeSatSim
|
||||||
|
StandardOutput=inherit
|
||||||
|
StandardError=inherit
|
||||||
|
Restart=always
|
||||||
|
User=root
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=default.target
|
WantedBy=default.target
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=Custom Target
|
|
||||||
Requires=multi-user.target
|
|
||||||
After=multi-user.target
|
|
||||||
AllowIsolate=yes
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=My last command
|
|
||||||
After=multi-user.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
ExecStart=/home/pi/CubeSatSim/demo.sh
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=custom.target
|
|
||||||
Loading…
Reference in new issue