NZBGet 15 won't autostart on Linux

Get help, report and discuss bugs.
Post Reply
blindpet
Posts: 42
Joined: 02 May 2014, 10:27
Contact:

NZBGet 15 won't autostart on Linux

Post by blindpet » 27 May 2015, 15:28

I have built NZBGet 15 from source using these flags which I also used for NZBGet 14. I'm wondering if this is an NZBGet 15 specific issue.

Code: Select all

./configure --with-tlslib=OpenSSL && make -j4 && sudo make install && sudo make install-conf
sudo cp /usr/local/share/nzbget/nzbget.conf /etc/nzbget.conf
I used to be able to start nzbget 14 with a cronjob that just had @reboot nzbget -D

I tried getting the cronjob to log but no output is created

The init.d script doesn't work on start but will work starting manually (it didn't work for NZBGet 14 either though). I don't even see it trying in dmesg and daemon.log. I did try the other init.d script http://nzbget.net/forum/viewtopic.php?f=3&t=1849 but it also doesn't autostart.

I thought maybe a delay would help and added sleep 30 before the nzbget -D line in the init.d script, I tried it for the cronjob too.

Code: Select all

#!/bin/sh
### BEGIN INIT INFO
# Provides:          nzbget
# Required-Start:    $local_fs $network $remote_fs
# Required-Stop:     $local_fs $network $remote_fs
# Should-Start:      $NetworkManager
# Should-Stop:       $NetworkManager
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts instance of NZBGet
# Description:       starts instance of NZBGet using start-stop-daemon
### END INIT INFO
NZBGETPATH=$(which nzbget)
# Source init functions
. /lib/lsb/init-functions
# Start/stop the NZBget daemon.
#
case "$1" in
start)   echo -n "Start services: NZBget"
$NZBGETPATH -D
;;
stop)   echo -n "Stop services: NZBget"
$NZBGETPATH -Q
;;
restart)
$0 stop
$0 start
;;
*)   echo "Usage: $0 start|stop|restart"
exit 1
;;
esac
exit 0

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: NZBGet 15 won't autostart on Linux

Post by hugbug » 27 May 2015, 18:15

To debug the init script add logging with
echo "text" >>> /home/user/logfile.txt

Then you can see if the script was executed at all.

The same for cronjob, create a script which will log into a text file, when starting nzbget use redirection to capture the output into the logfile:
nzbget -D >logfile.txt 2>logfile.txt

Also use "-s" instead of "-D" for testing, it may produce more output than -D, which can't print anything after daemonization.

blindpet
Posts: 42
Joined: 02 May 2014, 10:27
Contact:

Re: NZBGet 15 won't autostart on Linux

Post by blindpet » 29 May 2015, 22:08

I had tried to log but failed, your crontab log suggestion actually worked and I found out the paths crontab was using were wrong. I added this and now it's working

Code: Select all

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
If I put the absolute path to nzbget it also works, which can be gotten with

Code: Select all

which nzbget
This didn't help with the init.d script but I can live with that.

Post Reply

Who is online

Users browsing this forum: No registered users and 50 guests