Page 1 of 1

Delay start of sabnzbd+ on Ubuntu (XBMC Live)

Posted: September 13th, 2009, 3:26 pm
by subsense
I managed to auto-start sabnzbdplus on an ASrock installed with XBMC Live.
Could not have done this without the great help and howto's here.

But, I need to delay the start of sabnzbdplus.
It looks like the mounts aren't up when I start sabnzbdplus resulting in the following errors:

Code: Select all

2009-09-13 19:59:55,647 ERROR complete_dir directory: /home/xbmc/nas/Unzipt error accessing
2009-09-13 19:59:55,662 ERROR [sabnzbd.misc] Cannot create directory /home/xbmc/nas/nzb/Done
2009-09-13 19:59:55,664 ERROR dirscan_dir directory: /home/xbmc/nas/nzb error accessing
(/home/xbmc/nas is a mount to my nas)

They show up when I give the "sudo reboot" command, or on cold boot.

When I shutdown sabnzbdplus from the webinterface en start it again from the prompt in deamon mode ik get no errors.
I want to delay the startup of sabnzbdplus with a minute to test is this is the cause.

I nicer way is to make an if...then routine orso (if mounts are up, then start sabnzbdplus).

Re: Delay start of sabnzbd+ on Ubuntu (XBMC Live)

Posted: September 13th, 2009, 4:37 pm
by shypike
How do you start SABnzbd?
If you use some kind of init.d script, you will need to edit that script
and put in a "sleep" or a loop that waits for the mount to complete.

Re: Delay start of sabnzbd+ on Ubuntu (XBMC Live)

Posted: September 14th, 2009, 2:49 am
by subsense
shypike wrote: How do you start SABnzbd?
If you use some kind of init.d script, you will need to edit that script
and put in a "sleep" or a loop that waits for the mount to complete.
Yes, I use the init.d method. And I was thinking about editing the script.
But I'm not a star in Linux Scripts, so I assume I have to go to the ubuntu fora?
Or is it just the command "sleep "?

Re: Delay start of sabnzbd+ on Ubuntu (XBMC Live)

Posted: September 14th, 2009, 3:28 am
by jcfp
I can't really guestimate what would happen if one puts a (possibly) infinitely looping sleep statement in an init script, so try the following.

1. Disable the normal auto-startup:

Code: Select all

sudo sysvconfig --disable sabnzbdplus
2. Create a file with a script like this (obviously, you should place it outside the directory you're testing for):

Code: Select all

while [ ! -d /YOUR/DIR/HERE ]; do sleep 10; done
/etc/init.d/sabnzbdplus start
3. Make things run on startup by adding a line to /etc/rc.local:

Code: Select all

/bin/sh /PATH/TO/YOUR/SCRIPT.sh &

Re: Delay start of sabnzbd+ on Ubuntu (XBMC Live)

Posted: September 14th, 2009, 6:17 am
by subsense
Thanks,

This is a good start for me! I will let my progress know.