how do i run sabnzbd as a different user with systemd

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
parisv
Newbie
Newbie
Posts: 7
Joined: August 6th, 2011, 4:18 am

how do i run sabnzbd as a different user with systemd

Post by parisv » October 30th, 2019, 4:55 pm

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:

[email protected]:~$ sudo systemctl start sabnzbd.service
[email protected]:~$ 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?

User avatar
jcfp
Release Testers
Release Testers
Posts: 912
Joined: February 7th, 2008, 12:45 pm

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

Post by jcfp » October 31st, 2019, 3:11 am

parisv wrote:
October 30th, 2019, 4:55 pm
I've created a service - /etc/systemd/system/sabnzbd.service
parisv wrote:
October 30th, 2019, 4:55 pm
what 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.

Post Reply