Sabnzbd not working 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
regder
Newbie
Newbie
Posts: 11
Joined: December 9th, 2018, 3:09 pm

Sabnzbd not working with systemd

Post by regder » September 12th, 2019, 11:26 pm

Always used Arch Linux and decided to switch to Ubuntu server for a new system and am a little lost.

Sabnzbd when launched through systemd shows it's working normally without error but can't be accessed. If I stop the systemd process and manually launch the script (/etc/init.d/sabnzbdplus) it works fine.

What's going wrong here?

User avatar
sander
Release Testers
Release Testers
Posts: 6829
Joined: January 22nd, 2008, 2:22 pm

Re: Sabnzbd not working with systemd

Post by sander » September 13th, 2019, 12:46 am

regder wrote:
September 12th, 2019, 11:26 pm
Sabnzbd when launched through systemd shows it's working normally without error but can't be accessed.
What is the output of

Code: Select all

sudo netstat -apon | grep 8080
in both cases?

senrac
Newbie
Newbie
Posts: 1
Joined: March 13th, 2020, 11:49 am

Re: Sabnzbd not working with systemd

Post by senrac » March 13th, 2020, 11:54 am

I know that this thread is a little old but did you ever find a solution? I'm having the exact same issue.

Thanks

pordezy
Newbie
Newbie
Posts: 1
Joined: March 25th, 2020, 10:41 pm

Re: Sabnzbd not working with systemd

Post by pordezy » March 25th, 2020, 11:12 pm

I found a thread on this forum (22320) and created the systemd.service from there, changing the username and path, in "/usr/lib/systemd/system". I'm not allowed to post the link but if you replace the number in the url above with the number in this sentence you will find it, the systemd file I used is below.

Then killed the currently running upstart service - "sudo systemctl stop sabnzbdplus".

Renamed the file "/etc/init.d/sabnzbd".

Then ran "sudo systemctl daemon-reload".

Finally ran "sudo systemctl start sabnzbdplus && sudo systemctl enable sabnzbdplus" and all is well.

The output from "systemctl status sabnzbdplus" while an upstart (init.d) job - this is not working, you can see the warning in the output:

Code: Select all

 sabnzbdplus.service - LSB: SABnzbd+ binary newsgrabber
     Loaded: loaded (/etc/init.d/sabnzbdplus; enabled-runtime; vendor preset: enabled)
     Active: active (exited) since Wed 2020-03-25 23:34:45 EDT; 7s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 644073 ExecStart=/etc/init.d/sabnzbdplus start (code=exited, status=0/SUCCESS)

Mar 25 23:34:45 wopr systemd[1]: Starting LSB: SABnzbd+ binary newsgrabber...
Mar 25 23:34:45 wopr sabnzbdplus[644096]: Warning: Fake start-stop-daemon called, doing nothing.
Mar 25 23:34:45 wopr sabnzbdplus[644097]: cat: /var/run/sabnzbdplus/pid: No such file or directory
Mar 25 23:34:45 wopr sabnzbdplus[644073]:  * SABnzbd+ binary newsgrabber: already running (pid )
Mar 25 23:34:45 wopr systemd[1]: Started LSB: SABnzbd+ binary newsgrabber.
Output while systemd job:

Code: Select all

● sabnzbdplus.service - Sabnzbd
     Loaded: loaded (/lib/systemd/system/sabnzbdplus.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-03-25 23:37:02 EDT; 1min 20s ago
      Tasks: 25 (limit: 18943)
     Memory: 59.4M
     CGroup: /system.slice/sabnzbdplus.service
             └─645145 /usr/bin/python2.7 /usr/bin/sabnzbdplus --config-file /home/jarad/.sabnzbd/sabnzbd.ini --logging 1 --daemon

Mar 25 23:37:01 wopr systemd[1]: Starting Sabnzbd...
Mar 25 23:37:02 wopr systemd[1]: Started Sabnzbd.
File I used to create the systemd service:

Code: Select all

#/usr/lib/systemd/system/sabnzbdplus.service
[Unit]
Description=Sabnzbd
Wants=network-online.target
After=network-online.target

[Service]
User=jarad
Group=jarad
RuntimeDirectory=sabnzbdplus
RuntimeDirectoryMode=0750
ExecStart=/usr/bin/python2.7 /usr/bin/sabnzbdplus --config-file /home/jarad/.sabnzbd/sabnzbd.ini --logging 1 --daemon
Type=forking

Restart=on-failure

[Install]
WantedBy=multi-user.target

For the love of all that is good in code, change the editor to one that understand markdown :) please.

&& you will need to grep for "http-alt" in the output of "sudo netsat -tap".

Post Reply