» Install SABnzbd, Sickbeard, Couchpotato on your Synology DSM 3 NAS

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 it's 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 it's 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

The following method installs SABnzbd as root. There are some pretty 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
#!/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
  /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 +x /usr/syno/etc/rc.d/S99SABnzbd.sh

And run it:

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

Connect to:

  • http://[your_nas_ip]:9200/ for SABnzbd
  • http://[your_nas_ip]:9300/ for CouchPotate
  • http://[your_nas_ip]:9400/ for Sickbeard

Next time your Synology boots, SABnzbd and it's family will boot as well.

You Probably Shouldn't Follow Me


Like this Article?

I'd appreciate it if you leave a comment, spread the word, or consider a small donation


tags: synology, nas, sabnzbd
category: Howto - System
read: 38,743 times

Add comment

(required, shown)(required, not shown)for syntax highlighting

[CODE="Javascript"]
your_code_here();
[/CODE]

Replace "Javascript"
with "php", "text", etc.
code (to make sure you are not a spammer)

 Track replies: rss feed comments feed

Comments

#35. Andre on 13 February 2012

Gravatar.com: AndreHi,

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.
... [more]
Thanks again great article.

#34. Doodlydood on 26 January 2012

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

#33. Derek on 02 November 2011

Gravatar.com: DerekTo fix the error
/opt/libexec/git-core/git-pull: line 236: tr: not found

install textutils

... [more] ipkg install textutils

#32. Tom on 28 October 2011

Gravatar.com: Tomfor the tr errors, just update busybox. ipkg install busybox

#31. hughmc on 26 August 2011

Gravatar.com: hughmchad to add /opt/bin to the PATH in /etc/rc

not the best solution but it's working now.

#30. hughmc on 26 August 2011

Gravatar.com: hughmcnow i can't get par2 to work hah! any tips?

"No PAR2 program found, repairs not possible"

par2cmdline is installed and in the path.

#29. Hughmc on 24 August 2011

Gravatar.com: Hughmc@KeNMaSTeR

You are missing the tr binary from coreutils.

ipkg install coreutils
... [more]
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

#28. Jayberz on 21 August 2011

Gravatar.com: JayberzHow 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..

#27. KeNMaSTeR on 01 August 2011

Gravatar.com: KeNMaSTeRHi 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
... [more] 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 ;)

#26. JR on 02 July 2011

Gravatar.com: JRWhy 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)

... [more] http://www.mertymade.com/syno/

#25. arta on 14 June 2011

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

#24. Senne on 27 May 2011

Gravatar.com: 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/)
... [more] > wget http://sourceforge.net/projects/sabnzbdplus/files/sabnzbdplus/sabnzbd-0.6.2/SABnzbd-0.6.2-src.tar.gz/download
> 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.

#23. Ryan on 26 May 2011

Gravatar.com: RyanThe sab package in ipkg looks pretty old. Can we easily upgrade to 0.6.2?

#22. stiri iasi on 25 May 2011

Gravatar.com: stiri iasiOh man, i would like to have this Linux skills like you :)

#21. alex on 22 May 2011

Gravatar.com: alexWell 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+.

#20. Senne on 20 May 2011

Gravatar.com: SenneI decided to use a more friendly way to shutdown each program and prevent accidental killing other python scripts that are running

With login/pw:

#!/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


without login/pw:
#!/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

#19. Gaz on 13 May 2011

Gravatar.com: GazHi. 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

#18. Holly on 23 April 2011

Gravatar.com: HollyThanks Kevin and Simpic. Edited the script with VI and works now.

Loopt als een tiet

#17. Jacob Korf on 20 April 2011

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

#16. Kevin on 19 April 2011

Twitter.com: kvz@ 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.

#15. Jacob Korf on 19 April 2011

Gravatar.com: 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?

... [more] 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

#14. Senne on 18 April 2011

Gravatar.com: SenneThe 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?

#13. Jacob Korf on 18 April 2011

Gravatar.com: Jacob KorfThanks 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
... [more]
Seems that I don't have the proper permission?

Alvast bedankt, (thanks in advance)

Jacob Korf

#12. Senne on 18 April 2011

Gravatar.com: SenneFor 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

vi /usr/syno/etc/rc.d/S99SABnzbd.sh


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.

#11. Kevin on 18 April 2011

Twitter.com: kvz@ 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.
... [more]
Als not sure why you're using either Vim or nano, when you can just copy-paste the heredoc.

#10. Jacob Korf on 18 April 2011

Gravatar.com: Jacob KorfYou 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

#9. Kevin on 17 April 2011

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

#8. TorRK on 16 April 2011

Gravatar.com: 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...

#7. TorRK on 16 April 2011

Gravatar.com: TorRKHi 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...

... [more] Please help.

#6. simpic on 15 April 2011

Gravatar.com: simpicJacob & 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.

#5. Jacob Korf on 15 April 2011

Gravatar.com: Jacob KorfI 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.

#4. Holly on 26 March 2011

Gravatar.com: HollyHi,

The auto start script does not seem to execute here.

When i run

/usr/syno/etc/rc.d/S99SABnzbd.sh start
i get
Start, stop or restart service? Use a parameter...


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

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

#3. Kevin on 10 March 2011

Twitter.com: kvz@ 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.net/techblog/article/optimize_your_synology_for_downloading/

#2. ege on 21 February 2011

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

#1. Ovidiu on 01 February 2011

Gravatar.com: OvidiuGreat setup you have there :)

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