Howto: Delay Start sabnzbdplus in Ubuntu

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
RKM
Jr. Member
Jr. Member
Posts: 68
Joined: January 31st, 2010, 4:33 pm

Howto: Delay Start sabnzbdplus in Ubuntu

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

Re: Delay Start sabnzbdplus in Ubuntu

Post 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
RKM
Jr. Member
Jr. Member
Posts: 68
Joined: January 31st, 2010, 4:33 pm

Re: Delay Start sabnzbdplus in Ubuntu

Post 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!
narddawg314
Newbie
Newbie
Posts: 25
Joined: February 9th, 2014, 9:33 pm

Re: Howto: Delay Start sabnzbdplus in Ubuntu

Post by narddawg314 »

can confirm this works. I use it on my server at home as well.
tagwolf
Newbie
Newbie
Posts: 10
Joined: April 8th, 2023, 11:56 pm

Re: Howto: Delay Start sabnzbdplus in Ubuntu

Post by tagwolf »

A more systemd proper way to do this is to add the following to the service file:

[Service]
ExecStartPre=/bin/sleep 30
Post Reply