-
Notifications
You must be signed in to change notification settings - Fork 0
Automatic startup on raspberry pi
Create a service file for pyaprstracker using the following command:
sudo nano /etc/systemd/system/pyaprstracker.service
Paste the following:
[`Unit]
Description=PyAprsTracker
After=direwolf.service
Reaquires=direwolf.service
[Service]
Type=forking
ExecStartPre=screen -S direwolf -dm bash -c "direwolf -t0 -c /home/<YOUR_USER>/direwolf.conf"
ExecStart=screen -S aprstracker -dm bash -c "/home/<YOUR_USER>/PyAprsTracker/.venv/bin/python /home/<YOUR_USER>/PyAprsTracker/aprstracker.py"
Restart=always
User=<YOUR_USER>
Group=<YOUR_USER>
[Install]
WantedBy=default.target
Make sure to replace all instances of “<YOUR_USER>” with your username without the brackets.
Save the file, and issue the following commands:
sudo systemctl --user daemon-reload
sudo systemctl enable pyaprstracker.service
sudo systemctl start pyaprstracker.service
Now direwolf will be running in a “screen” session under the conext of our user. At any given time you can attach yourself to the direwolf instance with: screen -r direwolf or to the aprstracker instance with: screen -r aprstracker
To detach from the instance, press CTRL + A, and then press your “d” key.