[GUIDE] CouchPotato V2 on MBL

This guide assumes you have already installed SABnzb or Transmission following my guides

 

For more information, see https://github.com/RuudBurger/CouchPotatoServer

 

 Install python2.7

ipkg install python27

 Change dir

cd /opt/share/

 Download CouchPotato

wget http://github.com/RuudBurger/CouchPotatoServer/tarball/master

 Rename

mv master couch.tar.gz

 Extract

tar -xzvf couch.tar.gz

 Remove download

rm -f couch.tar.gz

 Rename directory

mv RuudBurger* CouchPotato

 Start CouchPotato

/opt/bin/python2.7 /opt/share/CouchPotato/CouchPotato.py

 Let it run for a minute or so and a menu will come up

 Hit q to quit and when asked if you are sure hit y

 Hit Control and c to get back to the command line

 Now we need to create the startup script

nano /etc/init.d/couchpotato

 Paste this

#! /bin/sh### BEGIN INIT INFO# Provides:          couchpotato# 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# Check for existance of defaults file# and utilze if availableif [-f /etc/default/couchpotato]; then    . /etc/default/couchpotatoelse    echo "/etc/default/couchpotato not found using default settings.";fi# Script nameNAME=couchpotato# App nameDESC=CouchPotato# Path to app rootCP_APP_PATH=${APP_PATH-/opt/share/CouchPotato}# User to run CP asCP_RUN_AS=${RUN_AS-root}# Path to python binCP_DAEMON=${DAEMON_PATH-/opt/bin/python2.7}# Path to store PID fileCP_PID_FILE=${PID_FILE-/var/run/couchpotato.pid}# Other startup argsCP_DAEMON_OPTS=" CouchPotato.py --daemon --pid_file=${CP_PID_FILE}"test -x $CP_DAEMON || exit 0set -ecase "$1" in  start)        echo "Starting $DESC"        rm -rf $CP_PID_FILE || return 1        touch $CP_PID_FILE        chown $CP_RUN_AS $CP_PID_FILE        start-stop-daemon -d $CP_APP_PATH -c $CP_RUN_AS --start --background --pidfile $CP_PID_FILE --exec $CP_DAEMON -- $CP_DAEMON_OPTS        ;;  stop)        echo "Stopping $DESC"        start-stop-daemon --stop --pidfile $CP_PID_FILE --retry 15        ;;  restart|force-reload)        echo "Restarting $DESC"        start-stop-daemon --stop --pidfile $CP_PID_FILE --retry 15        start-stop-daemon -d $CP_APP_PATH -c $CP_RUN_AS --start --background --pidfile $CP_PID_FILE --exec $CP_DAEMON -- $CP_DAEMON_OPTS        ;;  *)        N=/etc/init.d/$NAME        echo "Usage: $N {start|stop|restart|force-reload}" >&2        exit 1        ;;esacexit 0

Hit control and o

Hit enter

Hit control and x

This will save the edited file

 Now let’s set couchpotato to start on a MBL reboot

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

 Now start the server

/etc/init.d/couchpotato start

 Give the server a minute or 2 to start

Now open a web browser and login to your mbl name or ip:5050

Setup and enjoy!

Again I don’t use CouchPotato but there were some requests so I put this guide together

Please feel free to share any setup information you may have for incorporating this with SABnzb or Transmission

More to come…

3 Likes

Awesome! Can’t wait to get home tonight to set it up. :smiley:

Let me know how it goes as far as intergration

1 Like

Integration, Very good, go to the imdb pag for the movie you want, click a java embedded book mark and it does the rest, finds the best quality NZB and adds it to sab all on it’s own, once dl and extracted by sab it then procedes to rename the file to the correct file names, get all the meta data, subtitles and even the trailer (all optional)

Only one issue I’m having, and it’s with both couchpotato and headphones, the program runs perfectly but only when I use the line 

/opt/bin/python2.7 /opt/share/CouchPotato/CouchPotato.py

and the equivalent for headphones, but neither of them auto start at boot.

I’m sure it’s something that I’ve done but this is what happens when I try to start it with “start”

MyBookLive3TB:~# /etc/init.d/couchpotato start
/etc/default/couchpotato not found using default settings.
Starting CouchPotato

But it doesn’t actually start it, I’ve tried rebooting the drive and it doesn’t start automatically either. I’ve tried reinstalling it a few times with the same results (both couchpotato and headphones)

Ok, I’ll see if I can reproduce this later… The included scripts were Ubuntu scripts but they seemed to be starting the programs both when I typed the command and rebooted.

@lilmick it’s working fine here, I  think your not giving the server enough time to start before trying to login to the weboage?? Keep refreshing the webpage and it should eventually load as it didn’t come up for me right away either.

Will try headphones again and report back…

UPDATE: Headphone is starting fine too both on reboot and with the /etc/init.d/headphones start

It does throw a few errors but that is because these are ubuntu scripts… Haven’t been able to find any Debian NAS init scripts

 I  think your not giving the server enough time to start before trying to login to the weboage?? Keep refreshing the webpage and it should eventually load as it didn’t come up for me right away either.

I’ve given it a couple days now, sab and sickbeard have been running perfectly but still no couch or headphones, they both still run for me if I start them manually though. not sure what i’ve messed up but i do recall some error message the first time I added the startup links, I’ll see if I can get it again.

Try removing the old init symlinks for both programs

update-rc.d -f headphones remove

update-rc.d -f couchpotato remove

make sure the startup /etc/init.d scripts were 100% copied during the paste

And then try adding them again

update-rc.d headphones defaults

update-rc.d couchpotato defaults

Nope didn’t work. Think I might just start from scratch. Reflash the partition images and just start from the beginning. I had to have done something wrong somewhere. Probably be less of a headache that way, unless I do the same thing wrong again lol

Just went to start from scratch, when getting sab on there it came up with this and it is the same problem I had with couchpotato and headphones too. “Missing LSB information” then not actually running the program. Could it be to do with the latest updates? I first installed sab following your guide when I was on 02.11.09 and it worked perfectly, following the same guide only a couple days on trying to install it on version 02.42.03. Just a stab in the dark…

MyBookLive:~# chmod 755 /etc/init.d/sabnzbd
MyBookLive:~# update-rc.d sabnzbd defaults
update-rc.d: warning: /etc/init.d/sabnzbd missing LSB information
update-rc.d: see < http://wiki.debian.org/LSBInitScripts>
Adding system startup for /etc/init.d/sabnzbd …
/etc/rc0.d/K20sabnzbd → …/init.d/sabnzbd
/etc/rc1.d/K20sabnzbd → …/init.d/sabnzbd
/etc/rc6.d/K20sabnzbd → …/init.d/sabnzbd
/etc/rc2.d/S20sabnzbd → …/init.d/sabnzbd
/etc/rc3.d/S20sabnzbd → …/init.d/sabnzbd
/etc/rc4.d/S20sabnzbd → …/init.d/sabnzbd
/etc/rc5.d/S20sabnzbd → …/init.d/sabnzbd
MyBookLive:~# /etc/init.d/sabnzbd start
Starting SABnzbd.
MyBookLive:~#

Just started again from scratch, everything went exactly the same. SABNzb and SickBeard work perfectly fine but CouchPotato and HeadPhones do not.

I think for both couchpotato and headphones the python version used needs to be python2.7. So the startup script needs to be changed:

original line:

 CP_DAEMON=${DAEMON_PATH-/usr/bin/python}

change in:

CP_DAEMON=${DAEMON_PATH-/opt/bin/python2.7}

Now it should work!

Only wondering, will all these additional services interfere with the speed of the system? Would it be a good idea to run Sabnbd using the python2.7 instead of python2.5 (now the default python version)

Regards,

Ecori

2 Likes

Spot on! works perfectly with that changed. Thank you so much!!

sab seems to run faster with python 2.5, nfodiz got an extra 1Mb/s download speed by using 2.5. It seems to still be running fine with all these services running, though these services are all i use it for. previously i’ve had a laptop on 24/7 for my downloads and nothing else, now one of these. it is purely just for downloads, nothing else. even if it does hang at any point i’m probably not going to notice as it’s not often i will be in there fiddling with stuff, that is the purpose of all these automated services anyway.

Nice catch ecori, I will update the both guides ASAP

@ecori, python 2.6 and 2.7 didn’t seem to have a version of the yenc module compiled so the MBL was having to decode all the yenc posts which slowed speeds down by 1 megabyte per second on my connection which is huge.

I had read that you could compile the yenc module for 2.6 and 2.7 but I’m not that far along in my understanding of Linux :frowning:

@lilmick, I made the same change to the proper line in the headphones script that points to python as well. Is headphones working ok for you now too?

Yes they are both working great. 5 services running all at the same time and this thing seems to be going ok. (sabnzb, sickbeard, headphones, couchpotato and transmission)

I’m going to give it a go to get lazy librarian going on it too. From what you have given with the other 3, I might be able to get this one happening, starting to get the hang of the cammands needed now. I think this should be pretty much exactly the same as getting couchpotato and headphones going. fingers crossed, this one will put me in the good books with the wife lol

https://github.com/herman-rogers/LazyLibrarian-1

Looking forward for the new guide! Everything running smoothly!
Regards,
Ecori