Page 1 of 1

Cannot start service

Posted: April 24th, 2017, 8:20 am
by xscode
Hi all

I installed the package using the ppa and edited the /etc/defaults/sabnzbdplus file with my username but when I try to start the service it ails and a status shows "* SABnzbd+ binary newsgrabber: service not enabled, edit /etc/default/sabnzbdplus"

/etc/defaults/sabnzbdplus

Code: Select all

# This file is sourced by /etc/init.d/sabnzbdplus
#
# When SABnzbd+ is started using the init script, the
# --daemon option is always used, and the program is
# started under the account of $USER, as set below.
#
# Each setting is marked either "required" or "optional";
# leaving any required setting unconfigured will cause
# the service to not start.

# [required] user or uid of account to run the program as:
USER="stuart"

# [optional] full path to the configuration file of your choice;
#            otherwise, the default location (in $USER's home
#            directory) is used:
CONFIG=

# [optional] hostname/ip and port number to listen on:
HOST=
PORT=

# [optional] extra command line options, if any:
EXTRAOPTS=
any ideas?

TIA

Re: Cannot start service

Posted: April 24th, 2017, 8:30 am
by jcfp
If you're on a recent ubuntu release using systemd, you may need to run the following or it won't pick up on the changes made:

Code: Select all

sudo systemctl daemon-reload

Re: Cannot start service

Posted: April 24th, 2017, 9:13 am
by xscode
No difference after trying that I'm afraid.

Re: Cannot start service

Posted: April 24th, 2017, 11:52 am
by jcfp
Then I'm at a loss. The init script does this check immediately after loading the config file from /etc/default:

Code: Select all

[ -z "${USER%:*}" ] && {
	log_action_msg "$DESC: service not enabled, edit $SETTINGS";
	return 1;
}
That code basically leaves three ways to trigger that msg: variable USER isn't set at all (i.e. commented out or deleted), it's set but empty (which is how the settings file comes in a fresh install of the package), or its value starts with a colon. The latter may happen as a typo with some common keyword layouts that have " and : next to each other. Or maybe it takes a reboot to get systemd back to reality...

Re: Cannot start service

Posted: April 24th, 2017, 12:17 pm
by sander
Trial-n-error suggestions from me:

Code: Select all

USER="stuart"
Does it work without the double quotes?
Does stuart exist?
What happens when you run "sabnzbdplus" from the commandline?
What is the output of "whoami"

Re: Cannot start service

Posted: April 24th, 2017, 3:05 pm
by xscode
Tried with and without quotes (I also tried my uid)
Stuart is the only account on the system
Sab runs fine from the command line as user stuart
Whoami returns stuart

Re: Cannot start service

Posted: April 26th, 2017, 2:41 pm
by jcfp
No idea why it wouldn't work with the settings file from the topic start. That code I quoted hasn't changed at all since 2014.