Page 1 of 1

Howto: Delay Start sabnzbdplus in Ubuntu

Posted: January 27th, 2011, 11:41 am
by RKM
I'm running a distro of XBMC LIVE that has sabnzbd+ pre-installed.  It runs from init.d

The problem is that I have a share mounting in my rc.local file, which runs after sabnzbd+.

SAB needs that share, and if it does not see the share, it will alter back to the default.

To contend with this issue, I've added a "sleep 60" to the sabnzbdplus script located under init.d -- unfortunately that doesn not address the problem.

Not being good with Linux, I'm not sure where to look to determine what's wrong -- or whether there is a better method.

Anyone have any ideas on where I should look next?

Thank you in advance,
RKM

Re: Delay Start sabnzbdplus in Ubuntu

Posted: January 27th, 2011, 3:31 pm
by jcfp
1) Undo any changes to the init.d script;
2) Disable (but not remove) the sabnzbdplus service, something like sudo update-rc.d sabnzbdplus disable might just do the job;
3) Hook up a script to /etc/rc.local to start the service after all. Store it in some place that is accessible during boot (i.e. not on network shares, usb drives or in encrypted home dirs) and make sure it's executable. An example script is given below. The test done here is to check for the existence of some directory, but it could really be anything. Modify as needed.

Code: Select all

#!/bin/sh

DIR=/home/jp/.sabnzbd

while [ ! -d "$DIR" ]; do
	sleep 120
done

/etc/init.d/sabnzbdplus start

Re: Delay Start sabnzbdplus in Ubuntu

Posted: January 29th, 2011, 3:38 pm
by RKM
Wow, that worked like a charm! 

Thank a million for the easy to follow instructions and going so far as to give me the script, and I learned few things in the process!

Re: Howto: Delay Start sabnzbdplus in Ubuntu

Posted: June 23rd, 2014, 10:56 am
by narddawg314
can confirm this works. I use it on my server at home as well.

Re: Howto: Delay Start sabnzbdplus in Ubuntu

Posted: April 9th, 2023, 11:25 pm
by tagwolf
A more systemd proper way to do this is to add the following to the service file:

[Service]
ExecStartPre=/bin/sleep 30