NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

erikkramer's avatar
erikkramer
Aspirant
Sep 11, 2011

CouchPotato and SickBeard

I'd like to share with you the way I got CouchPotato and SickBeard to work on my ReadyNAS Duo. It's FYI and please inform me if I'm abusing my ReadyNAS too much.

My goal was to get both programs working with Transmission, since I'm not a big newsgroup user. Using RAIDiator 4.1.7, Windows 7 and putty.

SSH into the readynas and install the sqlite thingy:

apt-get -y install sqlite
apt-get -y install libsqlite3-dev

LDFLAGS='-L/usr/local/lib'
CPPFLAGS="-I/usr/local/include"

cd /root/src

wget http://www.sqlite.org/sqlite-autoconf-3070400.tar.gz
#wget http://www.sqlite.org/sqlite-autoconf-3070500.tar.gz
gunzip -d -c sqlite-autoconf-3070400.tar.gz | tar xf -
cd sqlite-autoconf-3070400
./configure --build=sparc-linux

# The following takes a long time
make && make install


Next, install python:

apt-get update
apt-get install libc6-dev
apt-get install gcc
apt-get install gdb
apt-get install libtag1-dev
apt-get install uuid-dev
apt-get install libssl-dev
apt-get install zlibc
apt-get install zlib1g-dev

mkdir /root/src/
cd /root/src/

wget ftp://ftp.gnome.org/cdimage/snapshot/Debian/pool/main/c/coreutils/coreutils_5.2.1-2_sparc.deb
dpkg-deb -x coreutils_5.2.1-2_sparc.deb .

wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz
gzip -d Python-2.6.6.tgz
tar xf Python-2.6.6.tar
cd Python-2.6.6
./configure --build=sparc-linux
make
make install


I also had to install pysqllite (I put it in /src/root):

wget http://pysqlite.googlecode.com/files/pysqlite-2.6.3.tar.gz
gzip -d pysqlite-2.6.3.tar.gz
tar xf pysqlite-2.6.3.tar
cd pysqlite-2.6.3

python setup.py build_static install


Then, download Couchpotato from https://github.com/RuudBurger/CouchPotato. Extract it and copy it to somewhere on the ReadyNAS, I used /home/couchpotato.

cp /shared/couchpotato /home


Now when you run:

python /home/couchpotato/CouchPotato.py -d


it starts and you can reach it on http://[ip]:5000

To get it to start on booting the readynas I changed the initd script that comes with couchpotato to:

#! /bin/sh

### BEGIN INIT INFO
# Provides: CouchPotato application instance
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts instance of CouchPotato
# Description: starts instance of CouchPotato using start-stop-daemon
### END INIT INFO

############### EDIT ME ##################
# path to app
APP_PATH=/home/couchpotato

# path to python bin
DAEMON=python /home/couchpotato/CouchPotato.py -d

# startup args
DAEMON_OPTS=" CouchPotato.py -q"

# script name
NAME=couchpotato

# app name
DESC=CouchPotato

# user
RUN_AS=root

PID_FILE=/var/run/couchpotato.pid

############### END EDIT ME ##################

test -x $DAEMON || exit 0

set -e

case "$1" in
start)
echo "Starting $DESC"
start-stop-daemon $RUN_AS --start --quiet --pidfile "$PIDFILE" --make-pidfile --exec "$DAEMON" -- $OPTIONS &>/dev/null
;;
stop)
echo "Stopping $DESC"
start-stop-daemon --stop --pidfile $PID_FILE
;;

restart|force-reload)
echo "Restarting $DESC"
start-stop-daemon --stop --pidfile $PID_FILE
sleep 15
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0

named the script couchpotato and copied it to /etc/init.d. Then performed these steps:

sudo chmod 755 /etc/init.d/couchpotato
sudo chown root.root /etc/init.d/couchpotato
sudo update-rc.d couchpotato defaults

It still doesn't start on boot, though, so I added the line below to /etc/frontview/addons/addons.conf:

COUCHPOTATO!!Couchpotato!!0.1!!sudo /etc/init.d/couchpotato start!!sudo /etc/init.d/couchpotato stop

and added COUCHPOTATO=1 to /etc/default/services.

And now it works!

Sickbeard worked exactly the same, but I had to install cheetah beforehand. And I changed the startup script (in /etc/init.d/sickbeard) to:

#! /bin/sh

# Author: daemox
# Basis: Parts of the script based on and inspired by work from
# tret (sabnzbd.org), beckstown (xbmc.org),
# and midgetspy (sickbeard.com).
# Fixes: James (ainer.org), Tophicles (ainer.org), croontje (sickbeard.com)
# Contact: http://www.ainer.org
# Version: 3.0

### BEGIN INIT INFO
# Provides: sickbeard
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts and stops sick beard
# Description: Sick Beard is an Usenet PVR. For more information see:
# http://www.sickbeard.com
### END INIT INFO

#Required -- Must Be Changed!
USER="root" #Set Linux Mint, Ubuntu, or Debian username here.

#Required -- Defaults Provided (only change if you know you need to).
HOST="127.0.0.1" #Set Sick Beard address here.
PORT="8081" #Set Sick Beard port here.

#Optional -- Unneeded unless you have added a Username and Password to Sick Beard.
SBUSR="" #Set Sick Beard Username (if you use one) here.
SBPWD="" #Set Sick Beard Password (if you use one) here.

#Script -- No changes needed below.
case "$1" in
start)
#Start Sick Beard and send all messages to /dev/null.
cd /home/sickbeard
echo "Starting Sick Beard"
sudo -u $USER -H nohup python /home/sickbeard/SickBeard.py -q > /dev/null 2>&1 &
;;
stop)
#Shutdown Sick Beard and delete the index.html files that wget generates.
echo "Stopping Sick Beard"
wget -q --user=$SBUSR --password=$SBPWD "http://$HOST:$PORT/home/shutdown/" --delete-after
sleep 6s
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac

exit 0

P.S.
I'm probably abusing my ReadyNAS a little, by not using http://www.readynas.com/forum/viewtopic.php?f=47&t=52246 or http://www.readynas.com/forum/viewtopic.php?f=47&t=51609. But so far I've not found performance or resource issues. Another downside may be missing the ability to enable/disable the services from the frontview panel.

P.P.S.
While I was editing /etc/default/services I noticed that TRANSMISSION=0! Which makes sense, cause it didn't start on boot. So I set it to TRANSMISSION=1 and now also transmission auto-starts on boot.

Sources:
http://iandykes.blogspot.com/2010/10/install-python-26-on-readynas-nv.html
http://www.thibernet.com/442-install-sabnzbd-on-a-readynas-duo
https://github.com/RuudBurger/CouchPotato
http://www.readynas.com/forum/viewtopic.php?f=47&t=52246
http://www.ainer.org/couch-potato-install-setup-configuration-guide-for-ubuntu-linux-mint/2
http://sickbeard.com/forums/viewtopic.php?f=4&t=689
http://blog.vacs.fr/index.php?post/2009/03/21/Connecting-to-a-ReadyNAS-duo-using-SSH%3A
http://forums.sabnzbd.org/viewtopic.php?f=1&t=1668&start=15
http://www.readynas.com/forum/viewtopic.php?f=35&t=20829
http://www.mstuttle.com/2010/07/27/couchpotato/
http://hd420p.wordpress.com/guides/usenet-guides/part-two-adding-couchpotato/
http://gathering.tweakers.net/forum/list_messages/1438396/20

http://www.ainer.org/sick-beard-install-setup-configuration-guide-for-ubuntu-linux-mint
http://www.readynas.com/forum/viewtopic.php?f=36&t=50342

http://www.readynas.com/forum/viewtopic.php?p=77106#p77106

11 Replies

Replies have been turned off for this discussion

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More