You are not logged in.

#1 2012-11-04 16:04:11

jmu
Member
From: Finland
Registered: 2012-03-18
Posts: 34

Sabnzbd service timeouts with systemd

I have a sabnzbd service that has few issues when started with systemd - and I can't seem to find a root cause.
When started as legacy rc.d script, it works ok.

1. Starting service (script blocks because it does not seem to return until timeout )

root@thor conf.d # systemctl restart sabnzbd.service                                                       /etc/conf.d
Error: No space left on device


<...few minutes, while service works...>
   

Job for sabnzbd.service failed. See 'systemctl status sabnzbd.service' and 'journalctl -n' for details.

2. Service seems to work ok (also pid file is created) until it gets killed by systemd(?)
3. Checking status:

root@thor conf.d # systemctl status sabnzbd.service                                                        /etc/conf.d
sabnzbd.service - SABnzbd binary newsreader
          Loaded: loaded (/etc/systemd/system/sabnzbd.service; enabled)
          Active: failed (Result: timeout) since Sun, 2012-11-04 17:14:23 EET; 15min ago
         Process: 14866 ExecStart=/bin/sh/ -c python2 /opt/sabnzbd/SABnzbd.py ${SABNZBD_ARGS} --pid /run/sabnzbd (code=exited, status=0/SUCCESS)
          CGroup: name=systemd:/system/sabnzbd.service


Nov 04 17:12:53 thor systemd[1]: Starting SABnzbd binary newsreader...
Nov 04 17:14:23 thor systemd[1]: Failed to start SABnzbd binary newsreader.
Nov 04 17:14:23 thor systemd[1]: Unit sabnzbd.service entered failed state

4. Contents of the conf.d/sabnzbd_systemd:

# Systemd configuration file for SABnzbd
# NOTE: Change user, group and port in sabnzbd.service as well. 
#       Due to a bug these cannot be loaded from this config file

# Set the protocol, IP and port
SABNZBD_PROTOCOL=http
SABNZBD_IP=thor.local
SABNZBD_PORT=8081

# Set your default user/group(id), startarguments and your configfile
SABNZBD_DIR=/opt/sabnzbd
SABNZBD_ARGS=-f /opt/sabnzbd/sabnzbd.ini -s ${SABNZBD_IP}:${SABNZBD_PORT} -d

# Put the session keys from Config > General here
SABNZBD_KEY=foobar
NZB_KEY=

# If you use a username and password, change the following variable to
# "user:pass@"
SABNZBD_USPW=

5. Contents of sabnzbd.service:

[Unit]
Description=SABnzbd binary newsreader
After=network.target

[Service]
EnvironmentFile=/etc/conf.d/sabnzbd_systemd
ExecStart=/bin/sh/ -c "python2 /opt/sabnzbd/SABnzbd.py ${SABNZBD_ARGS} --pid /run/sabnzbd"
ExecStop=/usr/bin/curl -f "${SABNZBD_PROTOCOL}://${SABNZBD_USPW}${SABNZBD_IP}:${SABNZBD_PORT}/sabnzbd/api?mode=shutdown&apikey=${SABNZBD_KEY}"
Type=forking
PIDFile=/run/sabnzbd/sabnzbd-8081.pid
User=sabnzbd
Group=sabnzbd

[Install]
WantedBy=multi-user.target

Similar posts:

- https://bbs.archlinux.org/viewtopic.php?id=151390
- https://bbs.archlinux.org/viewtopic.php?id=150676

Offline

#2 2012-11-07 02:57:40

shtnarg
Member
From: Onterrible Canada
Registered: 2010-11-23
Posts: 26
Website

Re: Sabnzbd service timeouts with systemd

I am having the identical issue. Have you found anything that works? 

Mine works for about 90 seconds, and then fails.


"I'm not a racist, I'm a bigot... there is a difference!" - Jim Jefferies

Offline

#3 2012-11-08 23:54:45

simon04
Member
From: Austria
Registered: 2008-04-20
Posts: 11

Re: Sabnzbd service timeouts with systemd

Also see the discussion in the comments of the AUR package: https://aur.archlinux.org/packages/sabnzbd/

Offline

#4 2012-11-09 17:59:40

jmu
Member
From: Finland
Registered: 2012-03-18
Posts: 34

Re: Sabnzbd service timeouts with systemd

Not really a case closed, but somehow Sabnzbd starts ok on boot up. Restarting the service afterwards still causes the problem specified earlier.

Offline

#5 2012-11-11 20:47:27

shtnarg
Member
From: Onterrible Canada
Registered: 2010-11-23
Posts: 26
Website

Re: Sabnzbd service timeouts with systemd

@jmu I was having the exact same issues as you, even on startup...

https://wiki.archlinux.org/index.php/SABnzbd   the archwiki along with the above posted wiki did it for me.

Note the custom port section, I notice you have 8081 vs the default 8080. 
I believe it was the copying /usr/lib/systemd/system/sabnzbd.service to /etc/systemd/system which made it stable.

I also disabled https, as it was suggested and I never used it


"I'm not a racist, I'm a bigot... there is a difference!" - Jim Jefferies

Offline

#6 2012-11-15 00:43:13

wilberfan
Member
From: So. Cal
Registered: 2010-12-18
Posts: 264

Re: Sabnzbd service timeouts with systemd

Similar here.  If I setup my system to start sabnzbd with the --user flag (ie, "$ systemctl --user enable sabnzbd", it seems to start--but then times-out and stops.

If I start it without the --user flag ("# systemctl enable sabnzbd") it starts up and stays up...


Hey, be nice...I'm new at this!

Offline

#7 2012-11-19 16:12:58

JohnD
Member
Registered: 2007-02-12
Posts: 17

Re: Sabnzbd service timeouts with systemd

I had the same timeout error.

In my case, the /run/sabnzbd/ folder has sabnzbd:sabnzbd permissions. I run sabnzbd with another user which is in the sabnzbd group. No pidfile appeared in /run/sabnzbd/ and no error showed up about that with systemctl status sabnzbd.service.
Now that I have changed the permissions of the /run/sabnzbd folder to the other user I can start sabnzbd from the command line.

So, altough I found no error about it, not being able to write the pidfile was my problem.

Last edited by JohnD (2012-11-19 16:13:48)

Offline

#8 2012-11-19 18:32:44

jmu
Member
From: Finland
Registered: 2012-03-18
Posts: 34

Re: Sabnzbd service timeouts with systemd

Thanks for the suggestions, but none of them seem to resolve the issue in my setup.
But clearly there are many things that can go wrong smile

Offline

Board footer

Powered by FluxBB