Ubuntu systemd script for PPA
Posted: January 21st, 2017, 7:42 am
Hey there,
since I'm in the process of swapping my old 12.04 server to new hardware and 16.10 I stumbled over a missing systemd script for sabnzbd. So after some digging, here are my findings to share. Maybe it's helping someone.
Create a new systemd script with
Add the following:
Some things I fell over. We need to create the sabnzbd pid dir in /var/run due to the fact that we running under a different user which has no permissions there. So that's what's the RuntimeDirectory directive is for.
Make sure you edit the user, location of the ini file and port to match your configuration. Type is forking since sabnzbd spawns other threads.
Enable the systemd with:
Then just start with
and you should be good. Hope this might help somebody... finally could give something back.
Cheers
since I'm in the process of swapping my old 12.04 server to new hardware and 16.10 I stumbled over a missing systemd script for sabnzbd. So after some digging, here are my findings to share. Maybe it's helping someone.
Create a new systemd script with
Code: Select all
sudo nano /etc/systemd/system/sabnzbd.service
Code: Select all
[Unit]
Description=Sabnzbd
Wants=network-online.target
After=network-online.target
[Service]
User=sabuser
Group=sabuser
RuntimeDirectory=sabnzbdplus
RuntimeDirectoryMode=0750
ExecStart=/usr/bin/python2.7 /usr/bin/sabnzbdplus --config-file /home/sabuser/.sabnzbd/sabnzbd.ini --logging 1 --daemon
Type=forking
Restart=on-failure
[Install]
WantedBy=multi-user.target
Make sure you edit the user, location of the ini file and port to match your configuration. Type is forking since sabnzbd spawns other threads.
Enable the systemd with:
Code: Select all
sudo systemctl enable sabnzbd.service
Code: Select all
sudo service sabnzbd start
Cheers