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.
]]>If I start it without the --user flag ("# systemctl enable sabnzbd") it starts up and stays up...
]]>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
]]>Mine works for about 90 seconds, and then fails.
]]>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