Page 1 of 1

SABnzbd on WD My Book Live

Posted: May 25th, 2011, 12:22 pm
by benjamin11
Hi all,

I managed to install SABnzbd on a WD My Book Live, wich runs on a Debian Lenny distribution.
I can run SABnzbd in the SSH terminal with:

Code: Select all

MyBookLive:~# python /opt/SABnzbd-0.6.1/SABnzbd.py 0.0.0.0:8080
But the problem is that SABnzbd stops when I close the terminal.
And the benefit of running SABnzbd on a NAS is that you don't need a computer anymore.
How can I get SABnzbd to run on its own?

I'm sorry for my lack of Debian knowledge, but this is my first Debian/Linux experience ever!

Thank you ;)

Re: SABnzbd on WD My Book Live

Posted: May 25th, 2011, 5:51 pm
by benjamin11
I've tried using screen, but it says 'Command not found'.
So now I'm trying to run it as a daemon. I've found this page: http://wiki.sabnzbd.org/install-as-a-unix-daemon
But as I said earlier, my knowledge of Linux is bad, and my coding skills aren't that good either.

So what do I use to create this script?
Do I have to compile it? Can I do this in Xcode?
Or do I just have to insert the code in a text document and let Debian compile it?

thanks for the help!

Re: SABnzbd on WD My Book Live

Posted: May 26th, 2011, 1:46 am
by shypike
Just start it from a terminal like this:

./SABnzbd.py -d -f /path/to/sabnzbd.ini

Note that the folders will now all be in /path/to instead of in the user's home folder.

Re: SABnzbd on WD My Book Live

Posted: May 26th, 2011, 6:12 pm
by benjamin11
shypike wrote: Just start it from a terminal like this:

./SABnzbd.py -d -f /path/to/sabnzbd.ini

Note that the folders will now all be in /path/to instead of in the user's home folder.
this doesn't work either.


Todat I've tries to run the script from http://wiki.sabnzbd.org/install-as-a-unix-daemon
I edited it to this:

Code: Select all

#!/bin/sh

case "$1" in
start)
  echo "Starting SABnzbd."
  /usr/bin/sudo -u USERNAME -H /opt/SABnzbd-0.6.2/SABnzbd.py -d -f /home/USERNAME/.sabnzbd/sabnzbd.ini
;;
stop)
  echo "Shutting down SABnzbd."
  /usr/bin/wget -q --delete-after "http://0.0.0.0:8085/sabnzbd/api?mode=shutdown&apikey=MY-API-KEY"
;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac

exit 0
In USERNAME I've place the username to log in to my My Book Live, and in MY-API-KEY I placed the api key I got from SABnzbd.
I named the script 'sabnzbd' and placed the script in /etc/init.d
I made the script executable using:

Code: Select all

chmod a+x /etc/init.d/sabnzbd
But then I tried to set up symlinks using

Code: Select all

update-rc.d sabnzbd defaults
But it returned:

Code: Select all

update-rc.d: warning: /etc/init.d/sabnzbd missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/sabnzbd ...
   /etc/rc0.d/K20sabnzbd -> ../init.d/sabnzbd
   /etc/rc1.d/K20sabnzbd -> ../init.d/sabnzbd
   /etc/rc6.d/K20sabnzbd -> ../init.d/sabnzbd
   /etc/rc2.d/S20sabnzbd -> ../init.d/sabnzbd
   /etc/rc3.d/S20sabnzbd -> ../init.d/sabnzbd
   /etc/rc4.d/S20sabnzbd -> ../init.d/sabnzbd
   /etc/rc5.d/S20sabnzbd -> ../init.d/sabnzbd
off course I took a look at the Debian wiki, but my experience with writing scripts is zero, so I don't exactly know what's wrong.
Does anyone know what the problem is?

Re: SABnzbd on WD My Book Live

Posted: September 22nd, 2011, 2:19 pm
by tmiski
benjamin11 wrote:Hi all,
I managed to install SABnzbd on a WD My Book Live, wich runs on a Debian Lenny distribution.
I just bought a My Book Live 2TB and would love to install SABnzbd. Would you mind posting the steps to set it up, I'm new to the Debian distro. I should be able to help with the Daemon stuff too.

p.s. I've already enabled ssh and installed optware.

Re: SABnzbd on WD My Book Live

Posted: September 23rd, 2011, 3:11 am
by jcfp
tmiski wrote:I just bought a My Book Live 2TB and would love to install SABnzbd. Would you mind posting the steps to set it up
This thread seems to know how, with the topic starter only making a small config error but otherwise having a working setup. Just adding " -s 0.0.0.0:8080" to the line that guy uses to start the application should fix that, without the need to edit config files.