kvz.io
Published on

Install SABnzbd, Sickbeard, Couchpotato on Your Synology DSM 3 NAS

Authors
  • avatar
    Name
    Kevin van Zonneveld
    Twitter
    @kvz

The Synology ships with a Download Station but it's not remotely as advanced as SABnzbd. What I mostly miss is automatic par & unpacking of its downloads. Here's how to fix that.

Warning

This article assumes you're somewhat skilled in Linux. By applying these suggestions you could seriously mess up your Disk Station.

I'm doing this on a DS411j running DSM 3.0. Your mileage may vary.

Maybe you don't want SABnzbd after all

In a later article I demonstrate how much higher downloads speeds can be achieved by synology's own nzbget, and a way that you can still have automatic par & unpacking of its downloads. I

First of All

  • Turn off the Download Station (Config screen)
  • Turn on SSH acccess (Terminal)
  • Login as root (same password as admin) via SSH and type: sh
  • install ipkg, which is like your Synology's secret AppStore.

Install SABnzbd & the Family

If you paste the following it installs SABnzbd as root. There are some serious risks involved with that so you may want to change it to someone with less permissions.

ipkg install bzip2 par2cmdline unrar unzip zlib git
ipkg install py26-cheetah py26-openssl python26
install sabnzbdplus

cd /opt/local
[ -d sickbeard/.git ] || git clone git://github.com/midgetspy/Sick-Beard.git  sickbeard
cd sickbeard
git pull

cd /opt/local
[ -d couchpotato/.git ] || git clone git://github.com/RuudBurger/CouchPotato.git couchpotato
cd couchpotato
git pull

Config

Most can be done via the webinterfaces, except for the standard port of CouchPotato, which conflicts with the Synology interface (:5000).

Open the file /opt/local/couchpotato/config.ini, look for the [global] header and change the port key to: 9300

[global]
port = 9300

Startup

Create a startup file:

$ cat << EOT > /usr/syno/etc/rc.d/S99SABnzbd.sh
#!/usr/bin/env sh
if [ "start" = "\$1" ]; then
  /opt/bin/python2.6 /opt/share/SABnzbd/SABnzbd.py -f /root/.sabnzbd/sabnzbd.ini -s 0.0.0.0:9200 -d
  /opt/bin/python2.6 /opt/local/couchpotato/CouchPotato.py --config=/opt/local/couchpotato/config.ini --datadir=/volume1 -d
  /opt/bin/python2.6 /opt/local/sickbeard/SickBeard.py --quiet --port 9400 --config /opt/local/sickbeard/config.ini --datadir=/volume1 --daemon
elif [ "stop" = "\$1" ]; then
  /usr/bin/killall -9 python2.6
elif [ "restart" = "\$1" ]; then
  \$0 stop
  \$0 start
elif [ "" = "\$1" ]; then
  echo "Start, stop or restart service? Use a parameter..."
fi
EOT

Make it executable:

$ chmod a+x /usr/syno/etc/rc.d/S99SABnzbd.sh

And run it:

$ /usr/syno/etc/rc.d/S99SABnzbd.sh start

Connect to:

Next time your Synology boots, SABnzbd and its family will boot as well.

Legacy Comments (37)

These comments were imported from the previous blog system (Disqus).

Ovidiu
Ovidiu·

Great setup you have there :)

Thanks for sharing, i am also using SABnzbd on my linux machine, works great!

ege
ege·

worked great! thank you very much for the clear instructions^^ hoping to discovering more useful programs that would run on these incredible pieces of hardware...

Kev van Zonneveld
Kev van Zonneveld·

@ Ovidio & ege: Yeah SABnzb is really neat. However I found that my NAS wasn't really powerful enough for it. May wanna checkout this new article on higher Synology download speeds: http://kevin.vanzonneveld.n...

Holly
Holly·

Hi,

The auto start script does not seem to execute here.

When i run [CODE="text"] /usr/syno/etc/rc.d/S99SABnzbd.sh start[/CODE] i get [CODE="text"]Start, stop or restart service? Use a parameter...[/CODE]

running it with [CODE="text"]/opt/bin/python2.5 /opt/share/SABnzbd/SABnzbd.py -f /root/.sabnzbd/sabnzbd.ini -s 0.0.0.0:9200 -d[/CODE] to start the script manually works OK.

I'm a linux noob, so perhaps you guys have some ideas.

Jacob Korf
Jacob Korf·

I have the same problem as Holly. Exactly the same. Are we doing something wrong? I already searched on several websites for this, but didn't find anything that I can use.

simpic
simpic·

Jacob & Holly...

Double check the script to make sure it has the $1 or $0 in the parameter placeholders.

You might need to vi the script to add these if you just copied and pasted the lines in from the web page.

TorRK
TorRK·

Hi there.

NOOB alert
I get a "-ash: usr/syno/etc/rc.d/S99SABnzbd.sh: not found" error when running the last command... something went wrong, but have no clue where. My guess is that the startup script wasn't created...

Please help.

TorRK
TorRK·

*EDIT

Was able to run it with Holly's line "opt/bin/python2.5 /opt/share/SABnzbd/SABnzbd.py -f /root/.sabnzbd/sabnzbd.ini -s 0.0.0.0:9200 -d" and get SABnzbd running. Had to run the start command again after completing setup...

Kev van Zonneveld
Kev van Zonneveld·

@ Holly & Jacob Korf: I agree with simpic, please make sure you pasted the file 100% correctly

Jacob Korf
Jacob Korf·

You were right! I just changed the parameters using NANO (same as VI), because the $1 wasn't filled yet. But now i get the following error (but it does execute):
/usr/syno/etc/rc.d/S99SABnzbd.sh: line 12: /root/.sabnzbd/sabnzbd.ini: not found

Thanks a lot! but still i can't start the SABnzbd server

Kev van Zonneveld
Kev van Zonneveld·

@ Jacob Korf: May try creating the parent directory of that ini configuration file first:

mkdir -p /root/.sabnzbd

Not sure why it says line 12. My example has the reference on line 3 so it might still be you have an error in your file.

Als not sure why you're using either Vim or nano, when you can just copy-paste the heredoc.

Senne
Senne·

For some reason the parameter placeholders get stripped when the script is saved. I used the vi editor to add them again as simpic stated.

open the file using

[CODE="text"]
vi /usr/syno/etc/rc.d/S99SABnzbd.sh
[/CODE]

press 'a' to go into edit mode and add the $1 on the correct places in the script. Exit the edit mode by pressing esc and type 'ZZ' to safe and close.

Now it should work just fine.

Now my problem: I installed under root, so sabnzbd states that the disk space is "1.85 GB Free Space" which is obviously wrong since I have 175 GB of free space on my NAS. Is there I way to fix this? Otherwise the diskspace email is not send when needed.

Jacob Korf
Jacob Korf·

Thanks Senne & Kevin!

I created the /root/.sabnzbd directory, and was able to create the .ini by executing the "/opt/bin/python2.5 /opt/share/SABnzbd/SABnzbd.py -f /root/.sabnzbd/sabnzbd.ini -s 0.0.0.0:9200 -d" script manually.
But... now when i execute the S99SABnzbd.sh start, i get the following message:
/usr/syno/etc/rc.d/S99SABnzbd.sh: line 12: /root/.sabnzbd/sabnzbd.ini: Permission denied

Seems that I don't have the proper permission?

Alvast bedankt, (thanks in advance)

Jacob Korf

Senne
Senne·

The wrong free space was caused by a typo in my settings :) '/Volume1/Usenet/' but it should be '/volume1/Usenet/'

@Jacob Geen idee waar het aan kan liggen, ben zelf ook een ramp met linux :) Staan je (lees/schrijf) chmod rechten goed?

Jacob Korf
Jacob Korf·

@Senne: I had this incident before too:), my problem was that my shared folder was called /korf/ on the synology, and the shared folder in Putty (SSH client) was /usbshare1/

@Senne & Kevin:
How is it possible to see the CHMOD rights?

when I execute as following the rights should be allright?:
chmod +x /usr/syno/etc/rc.d/S99SABnzbd.sh

Or is it better to use chmod 700 /usr/syno/etc/rc.d/S99SABnzbd.sh

Thanks in advance

Kev van Zonneveld
Kev van Zonneveld·

@ Jacob Korf: ls -al will do the trick (to view them) checkout the chmod manpage for differences between 700 and e.g. a+x. But I still think you haven't copied your startup script correctly cause it clearly says it tries to execute something on line 12 that it has no rights to. Like it would try to execute the ini file or something.

Jacob Korf
Jacob Korf·

It worked!! I found out that I forgot to add the $1 to the elif [ "" = "$1".
Now it's working properly!
Thanks a lot!

Holly
Holly·

Thanks Kevin and Simpic. Edited the script with VI and works now.

Loopt als een tiet

Gaz
Gaz·

Hi. Cool guide, but I'm stuck. Am trying to install on a DS1511+ but I cannot locate a py26-yenc package anywhere... seems py25-yenc is the latest. Does anyone know where I can get the py26-yenc? Or should I just go with python25 for everything (removing python26) ?
Thanks

Senne
Senne·

I decided to use a more friendly way to shutdown each program and prevent accidental killing other python scripts that are running

With login/pw:
[code="bash"]
#!/bin/sh
if [ "start" = "\$1" ]; then
/opt/bin/python2.6 /opt/share/SABnzbd/SABnzbd.py -f /root/.sabnzbd/sabnzbd.ini -s 0.0.0.0:9200 -d
/opt/bin/python2.6 /opt/local/couchpotato/CouchPotato.py --config=/opt/local/couchpotato/config.ini --datadir=/volume1 -d
/opt/bin/python2.6 /opt/local/sickbeard/SickBeard.py --quiet --port 9400 --config /opt/local/sickbeard/config.ini --datadir=/volume1 --daemon
elif [ "stop" = "\$1" ]; then
#shutdown sab
/opt/bin/wget -q --delete-after "http://localhost:9200/sabnzbd/api?mode=shutdown&ma_username=SABUSER&ma_password=SABPASSW&apikey=YOURAPIKEY"
sleep 6s

#shutdown sick beard
/opt/bin/wget -q --http-user=YOURSBLOGIN --http-password=YOURSBPASSW "http://localhost:9400/home/shutdown/"
sleep 6s

#shutdown coachpotato
/opt/bin/wget -q --http-user=YOURCPLOGIN --http-password=YOURCPPASSW "http://localhost:9300/config/exit/"
sleep 6s

elif [ "restart" = "\$1" ]; then
\$0 stop
\$0 start
elif [ "" = "\$1" ]; then
echo "Start, stop or restart service? Use a parameter..."
fi
[/code]

without login/pw:
[code="bash"]
#!/bin/sh
if [ "start" = "\$1" ]; then
/opt/bin/python2.6 /opt/share/SABnzbd/SABnzbd.py -f /root/.sabnzbd/sabnzbd.ini -s 0.0.0.0:9200 -d
/opt/bin/python2.6 /opt/local/couchpotato/CouchPotato.py --config=/opt/local/couchpotato/config.ini --datadir=/volume1 -d
/opt/bin/python2.6 /opt/local/sickbeard/SickBeard.py --quiet --port 9400 --config /opt/local/sickbeard/config.ini --datadir=/volume1 --daemon
elif [ "stop" = "\$1" ]; then
#shutdown sab
/opt/bin/wget -q --delete-after "http://localhost:9200/sabnzbd/api?mode=shutdown&apikey=YOURAPIKEY"
sleep 6s

#shutdown sick beard
/opt/bin/wget -q "http://localhost:9400/home/shutdown/"
sleep 6s

#shutdown coachpotato
/opt/bin/wget -q "http://localhost:9300/config/exit/"
sleep 6s

elif [ "restart" = "\$1" ]; then
\$0 stop
\$0 start
elif [ "" = "\$1" ]; then
echo "Start, stop or restart service? Use a parameter..."
fi
[/code]

alex
alex·

Well shit, I wished I had known that these boxes weren't powerful enough to download at my full speed. Oh well, at least everything is automated now and I don't have to worry about setting a bandwidth cap. No way I'm giving up using Sabnzbd+.

stiri iasi
stiri iasi·

Oh man, i would like to have this Linux skills like you :)

Ryan
Ryan·

The sab package in ipkg looks pretty old. Can we easily upgrade to 0.6.2?

Senne
Senne·

@Ryan
You can always choose to install sab manually, using the src.tar.gz from sourceforge. Something like this:

> shut down sab
> make a dir (I put it in /opt/share/sab/)
> wget http://sourceforge.net/proj...
> tar -xvzf SABnzbd-0.6.2-src.tar.gz

I had the 0.5.6 ipkg installed first, so I dunno if there are more things that need to be done to get it working without it. You need to change the path in the start up file, obviously.

arta
arta·

this site is full of energy
<a href="http://www.artadesign.ir">http://www.artadesign.ir</a>
</div>

JR
JR·

Why not just use Merty sabnzbd package that contains some nice tools, and upgrade build in.
Available for all synology models.
works great, and unpacking works (might have to install extra deccompressing apps), but unrar and zip works in the box (as far i remember)
Speed have never been a concent for me, used this since my first synology nas (a 407e)

http://www.mertymade.com/syno/

KeNMaSTeR
KeNMaSTeR·

Hi i got these problem when i try the command git pull ?

KeNMaSTeR> cd couchpotato/
KeNMaSTeR> git pull
/opt/libexec/git-core/git-pull: line 235: tr: not found
Your configuration specifies to merge with the ref 'master'
from the remote, but no such ref was fetched.

Any solution, i'm very newby in linux :_/
And because of this error i cant see the config.ini in both sickbeard and CP.

Thx for the help ;)

Jayberz
Jayberz·

How to i link both sab and sick to do the post processing? i have read i need to connect yo the synology.. please help!!! everything else works a treat.. just want it to move the files one downloaded..

Hughmc
Hughmc·

@KeNMaSTeR

You are missing the tr binary from coreutils.

ipkg install coreutils

Will fix it! Also i have noted that to get the config.ini files you will need to run sickbeard and couch potato at least once. they will generate a whole bunch of files.

so just type:

/opt/bin/python2.6 /opt/local/couchpotato/CouchPotato.py

&

/opt/bin/python2.6 /opt/local/sickbeard/SickBeard.py

hughmc
hughmc·

now i can't get par2 to work hah! any tips?

"No PAR2 program found, repairs not possible"

par2cmdline is installed and in the path.

hughmc
hughmc·

had to add /opt/bin to the PATH in /etc/rc

not the best solution but it's working now.

Tom
Tom·

for the tr errors, just update busybox. ipkg install busybox

Derek
Derek·

To fix the error
/opt/libexec/git-core/git-pull: line 236: tr: not found

install textutils

ipkg install textutils

Doodlydood
Doodlydood·

Great article. A note that one can add Zebulon's repository and install these applications through the package manager interface on the Synology as well.

Andre
Andre·

Hi,

Thanks for the article its a great source of information but I wonder will this allow the synology to run sabnzbd automatically even though the computer is powered off.

Im searching for some information which allows the synology to do this.

Thanks again great article.

Shane
Shane·

This was very helpful to me.

Thank you!!

Tom
Tom·

Does the startup file work with the latest DSM release? I have it set as executable but nothing happens?