I’m having trouble running a “program” as a service.

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Lacedup
Posts: 5
Joined: Sat Jan 11, 2020 7:00 pm

I’m having trouble running a “program” as a service.

Post by Lacedup »

I followed these instructions but it still doesn’t work. Is dietpi a different process?
Open another SSH session (Putty or SSH client) and login to the PI.
All following actions must be done on this second SSH login instance!
Setting YAP to run automatically as a service
sudo nano /etc/systemd/system/yap.service
Copy and paste the following on the opened window:

[Unit]
Description=A simple proxy for SSTV and Plex DVR

[Service]
WorkingDirectory=/home/pi/yap
ExecStart=/usr/bin/python3 sstvProxy.py -hl
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Press Ctrl and x together
Press Y to save, and press the enter key again to save the file

Now enable the service so it starts every time you reboot:
sudo systemctl enable yap.service
Now reboot
sudo reboot
User avatar
Joulinar
Posts: 2052
Joined: Sat Nov 16, 2019 12:49 am

Re: I’m having trouble running a “program” as a service.

Post by Joulinar »

Hi,

many thanks for your report. First I guess the home directory doesn't fit because user pi did not exist on DietPi

Code: Select all

WorkingDirectory=/home/pi/yap
Or did you created that user?

did you tried to execute the following manually? Is it working?

Code: Select all

/usr/bin/python3 sstvProxy.py -hl
What is the error message you are facing during service start?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply