Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [Solved] Sabnzbd Fails to Launch as a Service (Read 389 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[Solved] Sabnzbd Fails to Launch as a Service

Background: When launching sabnzbd as a user, it launches without fault, by calling python /usr/lib/sabnzbd/SABnzbd.py. However, when wanting to manage this as a daemonised service, it fails. The service file reads,

Code: [Select]
type = process
command = /usr/lib/sabnzbd/SABnzbd.py -l0 -f /var/lib/sabnzbd/sabnzbd.ini
logfile = /var/log/dinit/sabnzbd.log
waits-for = loginready
run-as = sabnzbd

The log outputs an error related to parsing PATH, stating AttributeError: 'NoneType' object has no attribute 'split'. I am confused by this since this error only occurs when launched as a service.

Does anybody have any recommendation to solve this error?

Re: [H] Sabnzbd Fails to Launch as a Service

Reply #1
It seems like sabnzbd is not correctly dealing with the case where the PATH environment variable is not set (and that it is not being set in the /etc/dinit/environment file).

The easiest solution is probably just to add a reasonable setting for PATH to /etc/dinit/environment.

I suggest something like:

Code: [Select]
PATH=/bin:/usr/bin

Make sure to include any directory containing executables that sabnzbd expects to be able to find on the PATH.

Re: [Solved] Sabnzbd Fails to Launch as a Service

Reply #2
Thank you.

For future readers, also add a line in the service file to read the environment file, either env-file = or load-options = , although the latter is discouraged.