Page 1 of 1
init.d script does not autostart on boot
Posted: February 12th, 2013, 5:33 am
by sam112
Hi,
I am running the latest SABnzbd on Ubuntu 12.10. My system was working perfectly until a week back.
Lately, the /etc/init.d/sabnzbdplus script does not autostart on boot. The start stop entries are already there and I cannot see any log entry in /var/log/boot.log
However, if I start it by executing
Code: Select all
sudo /etc/init.d/sabnzbdplus start
the daemon is started properly.
Please help me.. Thank you.
Re: init.d script does not autostart on boot
Posted: February 12th, 2013, 2:28 pm
by sander
I'm no expert in this area, but I'll give it a shot:
Could this be caused because sabnzbdplus is not the in the directory for the current runlevel?
My guess is that the normal runlevel is 2 (see 'runlevel'). If so, check '/etc/rc2.d/S98sabnzbdplus' exists and is correct
HTH
sander@toverdoos:~$ locate sabnzbdplus | grep /etc/
/etc/default/sabnzbdplus
/etc/init.d/sabnzbdplus
/etc/rc0.d/K02sabnzbdplus
/etc/rc1.d/K02sabnzbdplus
/etc/rc2.d/S98sabnzbdplus
/etc/rc3.d/S98sabnzbdplus
/etc/rc4.d/S98sabnzbdplus
/etc/rc5.d/S98sabnzbdplus
/etc/rc6.d/K02sabnzbdplus
sander@toverdoos:~$
Re: init.d script does not autostart on boot
Posted: February 12th, 2013, 4:30 pm
by jcfp
The rcX.d symlinks are put in place automatically when the package is installed, so barring admin errors those should still exist. Never hurts to check though:
Code: Select all
ls -la /etc/{rc?.d,init.d,default}/*sabnzbdplus
Other than that, with a manual start via the init script working fine, there's probably something missing/wrong/unavailable at the time the program tries to start on boot. The usual culprits include unmounted partitions, missing usb drives, encrypted home dirs, or network interfaces not yet up and/or configured with the right ip address.
Re: init.d script does not autostart on boot
Posted: February 12th, 2013, 5:25 pm
by sam112
runlevels show as follows.
/etc/default/sabnzbdplus
/etc/default/sabnzbdplus~
/etc/init.d/sabnzbdplus
/etc/rc0.d/K20sabnzbdplus
/etc/rc1.d/K20sabnzbdplus
/etc/rc2.d/S20sabnzbdplus
/etc/rc3.d/S20sabnzbdplus
/etc/rc4.d/S20sabnzbdplus
/etc/rc5.d/S20sabnzbdplus
/etc/rc6.d/K20sabnzbdplus
=============================================
ls -la /etc/{rc?.d,init.d,default}/*sabnzbdplus
-rw-r--r-- 1 root root 724 Oct 17 19:34 /etc/default/sabnzbdplus
-rwxr-xr-x 1 root root 3499 Oct 31 16:23 /etc/init.d/sabnzbdplus
lrwxrwxrwx 1 root root 21 Feb 10 17:32 /etc/rc0.d/K20sabnzbdplus -> ../init.d/sabnzbdplus
lrwxrwxrwx 1 root root 21 Feb 10 17:32 /etc/rc1.d/K20sabnzbdplus -> ../init.d/sabnzbdplus
lrwxrwxrwx 1 root root 21 Feb 10 17:32 /etc/rc2.d/S20sabnzbdplus -> ../init.d/sabnzbdplus
lrwxrwxrwx 1 root root 21 Feb 10 17:32 /etc/rc3.d/S20sabnzbdplus -> ../init.d/sabnzbdplus
lrwxrwxrwx 1 root root 21 Feb 10 17:32 /etc/rc4.d/S20sabnzbdplus -> ../init.d/sabnzbdplus
lrwxrwxrwx 1 root root 21 Feb 10 17:32 /etc/rc5.d/S20sabnzbdplus -> ../init.d/sabnzbdplus
lrwxrwxrwx 1 root root 21 Feb 10 17:32 /etc/rc6.d/K20sabnzbdplus -> ../init.d/sabnzbdplus
=======================================================
Strange think is that sickbeard is starting though couchpotato is not. Few other scripts are starting as well. Some posts on askubuntu talk about Upstart replacing init.d boot jobs. Maybe there is some incompatibility, if Upstart has replaced init.d?
Re: init.d script does not autostart on boot
Posted: February 13th, 2013, 8:02 am
by jcfp
Upstart still runs sysv init scripts. Only thing that could help is not having S20 K20 but something that is supposed to start later and stop earlier.
Code: Select all
sudo update-rc.d -f sabnzbdplus remove; sudo update-rc.d sabnzbdplus defaults 98 02
With that out of the way, conditions at program startup remain as possible troublemakers. Either find the cause and fix it, or try delaying service startup as described
here. If you don't know the cause of the problem, you may want to replace the part that checks a specific condition with just a generic delay (
sleep 30 or so in place of the entire
while loop).
Re: init.d script does not autostart on boot
Posted: February 13th, 2013, 5:00 pm
by sam112
worked great using sleep 30. Thanks a ton.
Re: init.d script does not autostart on boot
Posted: April 13th, 2013, 10:08 pm
by bluc
Do you have tutorial as to how to change from a while loop to a sleep 30 command? very very new with linux and trying to get my install working properly. Was working fine with init.d script till i updated the system and Sab.
Re: init.d script does not autostart on boot
Posted: May 18th, 2013, 4:38 pm
by milomak
sam112 wrote:worked great using sleep 30. Thanks a ton.
how did you fix he problem?
edit - looking at /etc/rc2, i noticed
S11sabnzbdplus
S14network-manager
this is likely to be an issue right?
can i just change the sabnzbplus entries to 20 or something manually? i would imagine there should be a more formal way to change what gets loaded in the order so that later updates etc respect the order.
Re: init.d script does not autostart on boot
Posted: May 19th, 2013, 5:20 pm
by jcfp
edit - looking at /etc/rc2, i noticed
S11sabnzbdplus
S14network-manager
this is likely to be an issue right?
can i just change the sabnzbplus entries to 20 or something manually? i would imagine there should be a more formal way to change what gets loaded in the order so that later updates etc respect the order.
Yeah that would a problem, trying to start sab that early, before even network stuff. The update-rc.d commands given in my previous post in this thread reset the rc.d links to S98 K02 - which is also the default used when installing the sab package.