init.d script does not autostart on boot

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
sam112
Newbie
Newbie
Posts: 3
Joined: February 12th, 2013, 5:26 am

init.d script does not autostart on boot

Post 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.
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: init.d script does not autostart on boot

Post 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:~$
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: init.d script does not autostart on boot

Post 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.
sam112
Newbie
Newbie
Posts: 3
Joined: February 12th, 2013, 5:26 am

Re: init.d script does not autostart on boot

Post 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?
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: init.d script does not autostart on boot

Post 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).
sam112
Newbie
Newbie
Posts: 3
Joined: February 12th, 2013, 5:26 am

Re: init.d script does not autostart on boot

Post by sam112 »

worked great using sleep 30. Thanks a ton. :)
bluc
Newbie
Newbie
Posts: 19
Joined: March 8th, 2013, 3:54 am

Re: init.d script does not autostart on boot

Post 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.
milomak
Newbie
Newbie
Posts: 17
Joined: September 3rd, 2010, 5:16 pm

Re: init.d script does not autostart on boot

Post 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.
User avatar
jcfp
Release Testers
Release Testers
Posts: 1004
Joined: February 7th, 2008, 12:45 pm

Re: init.d script does not autostart on boot

Post 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.
Post Reply