Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

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.
User avatar
sander
Release Testers
Release Testers
Posts: 6134
Joined: January 22nd, 2008, 2:22 pm

Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by sander » October 6th, 2012, 6:32 am

This is a Howto for installing SABnzbd on Raspberry Pi (aka Raspi) running Raspbian, which is a Debian for armhf.

First a warning

The Raspi is low end hardware: little RAM, little swap, and a low powered CPU. SABnzbd on the other end loves a lot of RAM and higher powered CPU's. So if you run SABnzbd on a Raspi, the performance will not be great: download speed will not be great, and unrarring will take more than time on a modern CPU.

Some facts: during a download, the load average numbers as reported by 'uptime' are like "Sysload: 6.75 | 6.04 | 5.56", meaning the Raspi has a lot of processes waiting to be handled, meaning the Raspi will feel unresponsive and slow.

There are other NZB downloads programs that require less RAM and CPU and therefore could run better on a Raspi.

Install and configure SABnzbd

Log in on your Raspi and install SABnzbd:

Code: Select all

sudo apt-get install sabnzbdplus
Then run sabnzbdplus for the first time from the commandline:

Code: Select all

sabnzbdplus --server 0.0.0.0
As this is the first time you run SABnzbd, that should start the wizard.
* If you logged on locally and using the graphical interface (X), then the webbrowser should start up.
* If you are remotely connected to your Raspi (via ssh), and you don't get a webbrowser, you can start the webbrowser from your host PC and point it to http://<ip-address-of-the-Raspi>:8080/, which should show the wizard.

Fill out the wizard. Make sure that in Step 2 you fill out that SABnzbd should be accessible from other PC's on your LAN.

After filling out the wizard, SABnzbd will restart. You should still be able to access it via http://<ip-address-of-the-Raspi>:8080/ . Upload a test .NZB to SABnzbd, and check that it can download it. FYI: the unpacking will not yet work at this stage.

Install unrar

If that works, it is time to install 'unrar'. Withour unrar installed, SABnzbd will say "No UNRAR program found, unpacking RAR files is not possible". Let's solve that.

Strangely enough unrar is not provided by the current Raspbian repositories, so you have to install it from other sources:

The easy, pre-built way from http://www.appelboor.com/dump/unrar-for-raspbian-armhf/

Code: Select all

wget http://www.appelboor.com/dump/unrar-for-raspbian-armhf/unrar_4.1.4-1_armhf.deb
sudo dpkg -i unrar_4.1.4-1_armhf.deb
Or the do-it-yourself way. Please note that the first line in this instruction is a multi-line command: it start at the 'echo' and end with '...sources.list'.

Code: Select all

echo "deb-src http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get build-dep unrar-nonfree
sudo apt-get source -b unrar-nonfree
sudo dpkg -i unrar*.deb
Now check that unrar is installed and available:

Code: Select all

unrar | head
That should give
UNRAR 4.10 freeware Copyright (c) 1993-2012 Alexander Roshal

Usage: unrar <command> -<switch 1> -<switch N> <archive> <files...>
<@listfiles...> <path_to_extract\>
Now you can do a test .NZB which should get completely unrarred and unpacked. If so, SABnzbd is working. That's it. SABnzbd is now functional.

Run SABnzbd as a service

If you want SABnzbd to run as a service / daemon and let it automatically start a system start, do this:

Code: Select all

sudo nano /etc/default/sabnzbdplus
Change the line

Code: Select all

USER=
to

Code: Select all

USER=pi
Save and exit the nano editor. Then start the service like this:

Code: Select all

[email protected] ~ $ sudo service sabnzbdplus start
[ ok ] Starting SABnzbd+ binary newsgrabber:.
[email protected] ~ $
or just reboot your SABnzbd.

Attention: starting the sabnzbdplus service on a Raspi takes quite some time (about 30 seconds), so it will slowdown your boot process.

Install bonjour

Last tip: Install bonjour / zeroconf on your Raspi:

Code: Select all

sudo apt-get install libnss-mdns
From now on, the Raspi system will broadcast its present on your LAN. From a machine that understands bonjour / zeroconf, you can now access SABnzbd via the easy URL http://raspberrypi.local:8080/ ... so no need to find out or remember the Raspi's IP address.

A plain Windows install will not understand bonjour, but experience shows you can possibly access SAB on the Raspi via the easy URL http://raspberrypi:8080/ . However, this might depend on your modem/router.

cypher64
Newbie
Newbie
Posts: 1
Joined: October 7th, 2012, 10:24 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by cypher64 » October 7th, 2012, 10:33 am

Interesting. I didn't know sabnzbd was in the wheezy repo. I just used the python source ;) and I use avahi for bonjour / zeroconf. Otherwise, it looks like my setup.

How's performance?

User avatar
sander
Release Testers
Release Testers
Posts: 6134
Joined: January 22nd, 2008, 2:22 pm

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by sander » October 7th, 2012, 2:25 pm

Download speed goes up and down between 150 kB/s and 1000 kB/s (whereas my laptop achieves a steady 3 MB/s), and this is the sysload info:

"Sysload: 4.93 | 3.93 | 2.56 | SABnzbd V=223M R=32M | System RAM=184M Swap=99M"

The Raspi web interface can be a bit unresponsive.

This is for a small download (150 MB).

I have a 4.5GB download in the queue waiting to be handled ... I'm espcecially interested in the unrar duration ... ;-)

EDIT:

The results for a 4.4 GB download as shown by SABnzbd:

Downloaded in 1 hour 38 minutes 7 seconds at an average of 791 KB/s
Unpacked 20 files/folders in 19 minutes 12 seconds

Not bad.

error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by error404 » October 9th, 2012, 3:33 am

Hello,

I have installed SABnzbd on my Pi (raspian 09/18) for a few weeks now, and it works quite well.
For example, a 1GB file downloads in 20 minutes, and is unrared in 5.
For a 5GB, 1.5 hour to d/l and 20/25 minutes to unrar.
This Pi has been up and running for 15 days now, without any kernel panick or crash.

I did not set up any cpulimit, as it seems to be included on the current raspbian version, and I think that the Pi has a strange behavior :

When a download starts, CPU use increases, then drops, then increase, then drops, and so on. It looks like the process is killed every time the cpu use reaches a certain value, and is automatically restarted. The overall performance of the Pi follows this routine (web interface seems unreachable for 30 seconds, then works fine, then slows down..., same thing for a ssh session)

I did not use any network activity monitoring, but I can see that the traffic leds on the switch blink really quickly for 30 secondes, then stop for 15 seconds, and start to blink again. (by the way, is there an easy way to monitor the network activity ?)

The "average download speed" given by sabnzbd at the end of the dowload is overestimated, as it does not count the "kill/restart" time. So instead of the given 2MB/s, I rather download à 700k-1M/sec. (a 1GB file is download in like 20 mins).

The overall average speed is not that bad, but I find that the "cpu increase-kill-restart" routine is not so well.

Is there a way to set another kind of limit that would prevent this, and keep my actuel average download speed ?

User avatar
sander
Release Testers
Release Testers
Posts: 6134
Joined: January 22nd, 2008, 2:22 pm

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by sander » October 9th, 2012, 3:44 am

error404 wrote:<snip>

I did not set up any cpulimit, as it seems to be included on the current raspbian version, and I think that the Pi has a strange behavior :

When a download starts, CPU use increases, then drops, then increase, then drops, and so on. It looks like the process is killed every time the cpu use reaches a certain value, and is automatically restarted. The overall performance of the Pi follows this routine (web interface seems unreachable for 30 seconds, then works fine, then slows down..., same thing for a ssh session)
<snip>

Is there a way to set another kind of limit that would prevent this, and keep my actuel average download speed ?
I was watching the logging of SAB while downloading, and my hypothesis is this: SABnzbd downloads the messages belonging to one specific rar file (so: blabla.r05), and then combines those messages to that specific rar file. Downloading does not require a lot of CPU, but combining the message into a rar file does.

If so, that explains the switching from downloading/low-cpu to little-downloading/high-cpu.

error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by error404 » October 9th, 2012, 4:00 am

The only thing that made me think that sabnzbd gets killed then restarted is the gap between the given download speed once the file is downloaded, and the real duration of the download phase (I do not count the unrar time).

For example, on my last download of a 582 MB file :
sabnzbd gives : Downloaded in 5 min 49 sec at an average of 1.7 MB/s / Unrard in 1 min 42 sec.
But this file downloaded in 15 minutes + 4 for unraring.
The indicated speed is twice higher than the real one.

So, there is some time that sabnzbd does not count. I think that if it was up and running the whole time, the indicated speed would be correct. The only explanation I find is that it gets killed every 30 seconds, and takes the same time to restart/resume downloading, so that the actual speed is the half of the one sabnzbd gives.

But that is not a really important issue : my files are downloaded and unrared properly and my Pi seems stable...

User avatar
sander
Release Testers
Release Testers
Posts: 6134
Joined: January 22nd, 2008, 2:22 pm

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by sander » October 9th, 2012, 4:09 am

error404 wrote:The only thing that made me think that sabnzbd gets killed then restarted is the gap between the given download speed once the file is downloaded, and the real duration of the download phase (I do not count the unrar time).

For example, on my last download of a 582 MB file :
sabnzbd gives : Downloaded in 5 min 49 sec at an average of 1.7 MB/s / Unrard in 1 min 42 sec.
But this file downloaded in 15 minutes + 4 for unraring.
The indicated speed is twice higher than the real one.
Ah, good point! I had exact the same feeling: that the downloading and unrarring took much longer than SAB itself reported. So something to explore further.

However, I don't think that SAB gets killed, as SAB will not auto-restart itself.

error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by error404 » October 9th, 2012, 4:24 am

On my previous raspi installation, I was using the debian wheezy image. Every now and then when sabnznd was downloading, there would have been a kernel panic.

So I installed something called "cpulimit" which was supposed to "kill" (maybe not really kill it, I don't really know how it worked) a process which exceeds a given cpu use % limit. When monitoring cpu activity with top, I could see the use increase for sabnznd, then drop, then increase again. And I did not get any panics or crashes.

When I installed sabnzbd on my new raspbian setup, I forgot to reinstall cpulimit. And the behavior of the Pi is quite the same as debian+cpulimit : increase/drop/increase. So I was thinking that this limit feature was implemented in raspbian in order to prevent kernel panics and crashes when using high cpu and ram using software, such as sabnzbd.

User avatar
sander
Release Testers
Release Testers
Posts: 6134
Joined: January 22nd, 2008, 2:22 pm

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by sander » October 9th, 2012, 6:08 am

cpulimit limits the cpu cycles used by a certain process.

cpulimit does not kill processes.

thadapacadava
Newbie
Newbie
Posts: 15
Joined: December 25th, 2012, 6:16 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by thadapacadava » December 25th, 2012, 6:17 am

okay I installed SAB onto my pi and it is running okay

how can I update it to the latest 0.7.7 version?

User avatar
sander
Release Testers
Release Testers
Posts: 6134
Joined: January 22nd, 2008, 2:22 pm

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by sander » December 26th, 2012, 3:31 am

thadapacadava wrote:okay I installed SAB onto my pi and it is running okay

how can I update it to the latest 0.7.7 version?
Via PPA or via source.

thadapacadava
Newbie
Newbie
Posts: 15
Joined: December 25th, 2012, 6:16 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by thadapacadava » December 26th, 2012, 10:19 pm

Yeah I just stumbled upon this

http://forums.sabnzbd.org/viewtopic.php?f=16&t=12109

I'm a relative linux noob, is the above link the best way to stay up to date on SAB? Any advantages/disadvantages compared to source?

User avatar
sander
Release Testers
Release Testers
Posts: 6134
Joined: January 22nd, 2008, 2:22 pm

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by sander » December 27th, 2012, 1:30 am

The most easy way is to just use what you have now from the Raspi repository.

Running from source is easier, but it is more difficult to auto-start sabnzbd.

Using the PPA is more difficult on Raspi, but the PPA will take care of everything.

I repeat my advice: consider just staying on the Raspi version from the repository.

thadapacadava
Newbie
Newbie
Posts: 15
Joined: December 25th, 2012, 6:16 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by thadapacadava » December 27th, 2012, 4:47 am

oops too late :)

following your instructions from the viewtopic.php?f=16&t=12109 thread I am now on 0.7.7 and it's running beautifully

I now just have to figure out how to get SAB to run at boot in the background. I installed usbmount to get SAB to recognise a USB flash disk I'm using for downloads.

thadapacadava
Newbie
Newbie
Posts: 15
Joined: December 25th, 2012, 6:16 am

Re: Howto: Installing SABnzbd on Raspberry Pi (Raspbian)

Post by thadapacadava » December 27th, 2012, 5:24 am

HELP!

Following this guide - http://selfprogramming.bplaced.net/inde ... -raspbian/ my 64GB USB flash stick is still not appearing

I saw this thread - http://forums.sabnzbd.org/viewtopic.php?f=16&t=12469 but I had already gone down the usbmount route

I can see usb and usb0-7 folders in /media but nothing is inside any of them according to SAB. Neither in /var/run/usbmount. I created a few folders on the 64GB USB flash stick in windows prior. It is formatted NTFS.

Post Reply