NSLU2-Linux
view · edit · print · history

Now that sabnzbd is in optware feed, should the instruction below be simplified/adjusted?


I've got this working with the help of http://www.ed-x.demon.nl/sabnzbd.html and the help of John at http://tech.groups.yahoo.com/group/nslu2-linux.

Firstly install

 ipkg update
 ipkg upgrade
 ipkg install coreutils
 ipkg install python
 ipkg install py-cheetah
 ipkg install py-cherrypy
 ipkg install py-elementtree
 ipkg install py-yenc
 ipkg install unrar
 ipkg install par2cmdline

Set up a guest account using the webinterface.

Edit the /etc/passwd file, my guest line looks like:

    guest:scBiQ2b1qfa3E:2000:501::/home/user:/bin/sh

To test the guest user, use su guest. If it doesn't work make sure the home dir exists (in the passwd file) and set the right properties. I have chmod 777 -R, chgrp everyone -R and chown guest -R the home dir.

Use the following to untar the SABnzbd-0.2.4 download:

   su guest
   tar -xvzf SABnzbd-0.2.4.tar.gz [dir you like]
   exit

Then edit the SABnzbd.ini (in the unpack dir you just used) file and set it up to your liking. Make sure all dirs exists and are owned by guest. It is best to specify the entire path instead of relative paths. If you run into errors starting SABnzbd (especially through a script) this is most likely why.

You need a guest account to 'own' the python process, because thats the process that will create the download/temp/log files.

Set up a S99SABnzbd file in /opt/etc/init.d

   if [ -n "`pidof python`" ]; then
     /bin/killall python 2>/dev/null
   fi

   su -l guest -c "/usr/bin/python /opt/local/sabnzbd/SABnzbd-0.2.4/SABnzbd.py -f /opt/local/sabnzbd/SABnzbd-0.2.4/SABnzbd.ini -d"

Test it using

   sh /opt/etc/init.d/S99SABnzbd

Then your off, download a nzb file and put it in the appropriate dir.

To see progress use http://[slug ip]:8080/sabnzbd/


Somehow the description above didn't work out well on my fresh unslung NSLU2 (V2.3R63-uNSLUng-6.10-beta) with a disk on port DISK2?.
This is my procedure to make it work.

Make SSH connection with NSLU2.

 ipkg update
ipkg install coreutils
ipkg install python
ipkg install py24-cheetah
ipkg install py24-cherrypy
ipkg install py24-elementtree
ipkg install py24-celementtree
ipkg install py24-yenc
ipkg install unrar
ipkg install unzip
ipkg install par2cmdline
ipkg install perl

Because a guest home directory does not exist we make one:

 mkdir /home/user
mkdir /home/user/guest
chmod 777 R /home/user
chgrp everyone R /home/user
chown guest R /home/user

The default guest user has no shell defined which gives a /dev/null permission denied error.
vi /etc/passwd and change /dev/null into /bin/sh for the guest account.
Test the guest account with su guest
>> Dont use the l or m option because this will give the wrong $HOME or $PATH

 whoami

Download and unpack SABnzbd-0.3.4.tar.gz to \\nslu2\DISK 2\ from a PC.

 mv /share/flash/data/public/SABn?* /share/flash/data/sabnzbd

Test SABnzbd using:

 python /sabnzbd/SABnzbd.py

A default configuration will be created.

Modify the configuration settings in /home/user/guest/.sabnzbd/sabnzbd.ini.
Change the paths to a location /share/flash/data/public/ to make the results accessable from your PC.
Fill in IP (default 192.168.1.77) and port 8080.

Exit the user guest and become root again.

 vi /opt/etc/init.d/S99SABnzbd?

 #!/bin/sh
 if [ -n "`pidof python`" ]; then
/bin/killall python 2>/dev/null
fi
/opt/bin/su guest -c "/usr/bin/python /sabnzbd/SABnzbd.py f /home/user/guest/.sabnzbd/sabnzbd.ini -d"

Save the script and apply correct permissions.

 chmod 755 /opt/etc/init.d/S99SABnzbd?

Restart SABnzbd using the new settings:

 /opt/etc/init.d/S99SABnzbd?

Check the web interface at: http://192.168.1.77:8080/sabnzbd(approve sites)


This works great, but to get version 0.4.4 working I needed to install these files too.

 ipkg install py25-cheetah
ipkg install py25-cherrypy
ipkg install py25-elementtree
ipkg install py25-celementtree
ipkg install py25-yenc
view · edit · print · history · Last edited by Rob Maas.
Based on work by Darek Sliwa, Pelders, BrianZhou, DigitalChaos, fcarolo, and Marco Schellings.
Originally by Marco Schellings.
Page last modified on October 08, 2008, at 06:33 PM