NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
erikkramer
Sep 11, 2011Aspirant
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:
Next, install python:
I also had to install pysqllite (I put it in /src/root):
Then, download Couchpotato from https://github.com/RuudBurger/CouchPotato. Extract it and copy it to somewhere on the ReadyNAS, I used /home/couchpotato.
Now when you run:
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:
named the script couchpotato and copied it to /etc/init.d. Then performed these steps:
It still doesn't start on boot, though, so I added the line below to /etc/frontview/addons/addons.conf:
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:
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
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
- sisaoAspirantIs everything running via the root account? If so you may want to have those daemons run via the admin or the nobody users to keep the OS safe.
- erikkramerAspirantI suppose it's running via the root account. How do I run it via the admin account?
- WhoCares_MentorYou already have the $USER variable in the scripts, just change that. An other way would be to use real init scripts and there by using the start-stop-daemon command you can run any tools as any user.
-Stefan - mdgm-ntgrNETGEAR Employee RetiredIf you have the skills to install stuff like this via the command line then go for it.
The add-ons were created using http://www.readynas.com/sdk. Advantage of addons is not just the web-interface but also easy install on multiple systems. With add-ons, the developer does testing to check if it works, when you install stuff yourself manually you do the testing and checking to make sure it works, but it does give you the increased flexibility to configure things how you like which may not always be the same as how an add-on developer chooses to configure things. - polux400AspirantAMAZING !
I've googled for hours and finally i found your post.
I'm using a fork of sickbeard for ThePiratebay, and have some others python soft (couchpotato, maraschino) which work when I launch them manually but I couldn't find how to launch them at the startup of my readyNAS ultra 2.
script for sickbeard is working fine, but i have an issue with the one for couchpotato :
-i use putty with root ssh to try to launch the script /etc/init.d/couchpotato --> couchpotato start
- i close the session with putty --> couchpotato stop
how can I keep couchpotato working afer closing the putty session (again, it's workign for sickbeard) ?
Thank you so much erikkramer
polux - WhoCares_MentorThis sounds like you're not starting CP as a daemon process in the background but rather have it tied to your current PuTTY session. But it's hard to tell without seeing the actual script.
-Stefan - polux400Aspiranthello,
Thank you for your answer WhoCares? (and all your add on btw!).
My script is :# Author: RuudBurger
# Edited by: daemox
# Details: Cleaned up script to make it easier to enter in the USER info for the guide on Ainer.org.
# Last updated: August 3, 2011
### BEGIN INIT INFO
# Provides: CouchPotato application instance
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Should-Start: $NetworkManager
# Should-Stop: $NetworkManager
# 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
#Required -- Must be changed!
USER="root" #Set Ubuntu or Linux Mint username here.
#Required -- Defaults provided (only change if you know you need to!).
DAEMON=python /c/home/CouchPotatoServer-master/CouchPotato.py
DAEMON_OPTS=" CouchPotato.py -q"
NAME=couchpotato
DESC=CouchPotato
PID_FILE=/var/run/couchpotato.pid
#Script -- No changes should be needed below!
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo "Starting $DESC"
start-stop-daemon -d /home/$USER/.couchpotato -c $USER --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
;;
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 /home/$USER/.couchpotato -c $USER --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
is anything wrong with the daemon process in my script ?
i just change the paths.
thanks
polux - F_L_Tutorisnt it CouchPotato.py -d for "daemon mode"?
- polux400AspirantI guess so, but the "-d" arg doesn't seem to be recognized with couchpotato... i think i use the last version but i will try to donwload the last one in case from here https://github.com/RuudBurger/CouchPotatoServer
The error with "-d" is :
Alakazam:~# /etc/init.d/couchpotato
usage: CouchPotato.py [-h] [--data_dir DATA_DIR] [--config_file CONFIG_FILE]
[--debug] [--console_log] [--quiet] [--daemon]
[--pid_file PID_FILE]
CouchPotato.py: error: unrecognized arguments: -d
Usage: /etc/init.d/couchpotato {start|stop|restart|force-reload} - polux400Aspirantok, the log gave me the answer :)
The right line/arg is :# path to python bin
DAEMON=python /home/couchpotato/CouchPotato.py --daemon
instead of# path to python bin
DAEMON=python /home/couchpotato/CouchPotato.py -d
thanks for your help guys !
Related Content
NETGEAR Academy

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