Page 1 of 1

how do i run sabnzbd as a different user with systemd

Posted: October 30th, 2019, 4:55 pm
by parisv
I've installed sabnzpdplus from the apt-get repository using these instructions https://sabnzbd.org/wiki/installation/i ... buntu-repo


I've created a service - /etc/systemd/system/sabnzbd.service

Code: Select all

[Unit]
Description=SABnzbd Usenet Client
After=network.target

[Service]
Type=simple
User=sab
Group=sab
ExecStart=/usr/bin/python -OO /usr/bin/sabnzbdplus    --browser 0 &
ExecStop=/usr/bin/pkill sabnzbdplus
Restart=always
SyslogIdentifier=SABnzbd Usenet Client

[Install]
WantedBy=multi-default.target
~                                                       

but when i start it i see this error in status:

sab@myserv:~$ sudo systemctl start sabnzbd.service
sab@myserv:~$ sudo systemctl status sabnzbd.service
● sabnzbd.service - SABnzbd Usenet Client
Loaded: loaded (/etc/systemd/system/sabnzbd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-10-30 21:43:15 UTC; 5s ago
Process: 10484 ExecStart=/usr/bin/python -OO /usr/bin/sabnzbdplus --browser 0 & (code=exited, status=2)
Main PID: 10484 (code=exited, status=2)

Oct 30 21:43:15 myserv systemd[1]: sabnzbd.service: Service hold-off time over, scheduling restart.
Oct 30 21:43:15 myserv systemd[1]: sabnzbd.service: Scheduled restart job, restart counter is at 5.
Oct 30 21:43:15 myserv systemd[1]: Stopped SABnzbd Usenet Client.
Oct 30 21:43:15 myserv systemd[1]: sabnzbd.service: Start request repeated too quickly.
Oct 30 21:43:15 myserv systemd[1]: sabnzbd.service: Failed with result 'exit-code'.
Oct 30 21:43:15 myserv systemd[1]: Failed to start SABnzbd Usenet Client.

what do I need to do to get this working?

Re: how do i run sabnzbd as a different user with systemd

Posted: October 31st, 2019, 3:11 am
by jcfp
parisv wrote: October 30th, 2019, 4:55 pmI've created a service - /etc/systemd/system/sabnzbd.service
parisv wrote: October 30th, 2019, 4:55 pmwhat do I need to do to get this working?
Delete that sabnzbd.service file, somebody may have pasted that all over the internet but it's badly broken.

In fact, you do not need to add a service file at all: the startup script included in the package works just fine. How to set it up is in the instructions you linked in your own post.