Sick Beard: Difference between revisions

From Leo's Notes
This page was last edited on 3 January 2022, at 06:14.
m removed guides category
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sick Beard is a web application written in Python that can automatically fetches TV shows from Usenet.
{{Warning|Development has stopped|The development of Sick Beard appears to have stopped. I have since switched to [[Sonaar]] which has additional features and better download failure handling.}}
== Installation ==
== Installation ==
To install sickbeard with SABnzbd, please refer to http://sickbeard.com/install.html#Source and also http://wiki.sabnzbd.org/.
I have used Sick Beard on both CentOS 6 and CentOS 7 systems. The installation steps are outlined in this section.  
 
=== CentOS 7 ===
The installation process under CentOS 7 is very straight forward.
 
{{highlight|lang=terminal|code=
## Install dependencies
# yum -y install python-cheetah pyOpenSSL git wget


The steps outlined below was done on CentOS 6.4. The startup script and configuration is given below as well.
## Setup sickbeard user & home directory
# groupadd -r -g 250 downloaders
# adduser -M -d /usr/local/sickbeard -r -u 250 -g 250 sickbeard
# mkdir /usr/local/sickbeard
# chown sickbeard:downloaders /usr/local/sickbeard


=== Steps ===
# su - sickbeard -c "git clone https://github.com/midgetspy/Sick-Beard.git /usr/local/sickbeard"
<syntaxhighlight lang="bash" line start="1" enclose="div">
}}
 
Go through the configuration file at {{code|/usr/local/sickbeard/config.ini}} and ensure that {{code|web_port}} and {{code|web_host}} are set properly.
 
{{Info|Serve Sick Beard on its own domain|If you are running this on a remote server, you may want to serve Sick Beard on a domain name such as sickbeard.mydomain.com. You may either change the {{code|web_port}} to port 80, or use IPTables to reroute port 80 to the 8081 using the rule:
 
{{code|iptables -A PREROUTING -t nat -i eno16777736 -p tcp -d 10.1.2.3 --dport 80 -j REDIRECT --to-port 8081}}
}}
 
Starting Sick Beard can be done using a systemd startup script which executes:
{{highlight|lang=terminal|code=
screen -S sickbeard -dm su - sickbeard -c "/usr/local/sickbeard/SickBeard.py --datadir=/home/sickbeard/data"
}}
 
=== CentOS 6 ===
Because the distro packages are too old, you will need to compile some of the dependencies manually. The shell script below should help you get SickBeard set up.
 
{{highlight|lang=bash|code=
#!/bin/bash
# Install EPEL repo
# Install EPEL repo
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Line 76: Line 109:
chkconfig --add sickbeard
chkconfig --add sickbeard
chkconfig --level 234 sickbeard on
chkconfig --level 234 sickbeard on
</syntaxhighlight>
}}
 
=== /etc/init.d/SABnzbd ===
<syntaxhighlight lang="bash" line start="1" enclose="div">
#!/bin/sh
 
# chkconfig: - 20 80
# description: SABnzbd
 
exec="/usr/share/SABnzbd/SABnzbd.py"
prog="SABnzbd"
 
if [ -f /etc/sysconfig/$prog ]; then
        . /etc/sysconfig/$prog
fi
 
if [ ! -n "$sabuser" -o ! -n "$apikey" -o ! -n "$protocol" -o ! -n  "$host"  -o ! -n "$port" ]; then
  echo "Please configure /etc/sysconfig/$prog first."
  [ ! -n "$sabuser"  ] && echo -n " sabuser"
  [ ! -n "$apikey"  ] && echo -n " apikey"
  [ ! -n "$protocol" ] && echo -n " protocol"
  [ ! -n "$host"    ] && echo -n " host"
  [ ! -n "$port"    ] && echo -n " port"
  echo " variable(s) undefined"
  exit 1
fi


if [ ! -f "$config" ]; then
You may configure sick beard by editing the sysconfig file at {{code|/etc/sysconfig/sickbeard}}
  echo "Can't find $config."
{{highlight|lang=text|code=
  echo "Please run SABnzbd as $sabuser manually to configure it first."
  exit 1
fi
 
 
# Source function library.
. /etc/rc.d/init.d/functions
 
start() {
    [ -x $exec ] || exit 5
    [ -f $config ] || exit 6
 
    echo -n $"Starting $prog: "
    # if not running, start it up here, usually something like "daemon $exec"
    daemon --user=$sabuser $nicecmd $exec -d -f $config
    retval=$?
    echo
    return $retval
}
 
stop() {
    echo -n $"Stopping $prog: "
    if [ -n "$username" ]; then
        /usr/bin/wget -q --delete-after --no-check-certificate "${protocol}://${host}:${port}/sabnzbd/api?mode=shutdown&ma_username=${username}&ma_password=${password}&apikey=${apikey}"
    else
        /usr/bin/wget -q --delete-after --no-check-certificate "${protocol}://${host}:${port}/sabnzbd/api?mode=shutdown&apikey=${apikey}"
    fi
 
    for sleepval in 1s 5s 10s 20s;do
        sleep $sleepval
        if [ ! `rh_status_q` ];then
            echo_success
            echo
            return 0
        fi
    done
    echo_failure
    return 1
}
 
restart() {
    stop
    start
}
 
reload() {
    restart
}
 
force_reload() {
    restart
}
 
rh_status() {
    # run checks to determine if the service is running or use generic status
 
    /usr/bin/nc -z $host $port &> /dev/null
    retval=$?
 
    if [ $retval -eq 0 ];then
        pid=`ps -fu $sabuser | grep -v grep | grep SABnzbd.py | awk '{print $2}'`
        echo "$prog (pid $pid) is running..."
        return $retval
    else
        echo "$prog is stopped"
        return $retval
    fi
 
}
 
rh_status_q() {
    rh_status >/dev/null 2>&1
}
 
 
case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
        ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
        exit 2
esac
exit $?
 
</syntaxhighlight>
 
=== /etc/sysconfig/SABnzbd ===
<syntaxhighlight lang="text" line start="1" enclose="div">
# SABnzbd service configuration
 
#run SABnzbd as
sabuser=sabnzbd
 
#modify if SABnzbd config file is somewhere else for some reason
config="/usr/share/SABnzbd/sabnzbd.ini"
 
#API key (can be found in the above config file)
apikey=asdfkljsadfkj
 
#gui address, eg: ${protocol}://${host}:${port}/sabznbd/
protocol=http
host=localhost
port=8080
 
#leave blank if no username/password is required to access the gui
username=
password=
 
#use nice, ionice, taskset to start SABnzbd
nicecmd=
#  example: nicecmd="nice -n 19 ionice -c3"
 
</syntaxhighlight>
 
=== /etc/sysconfig/sickbeard ===
<syntaxhighlight lang="text" line start="1" enclose="div">
SB_USER=sickbeard
SB_USER=sickbeard
SB_HOME=/usr/share/sickbeard
SB_HOME=/usr/share/sickbeard
Line 251: Line 120:
host=10.1.1.16
host=10.1.1.16
port=8081
port=8081
</syntaxhighlight>
}}
 


== Troubleshooting ==
== Troubleshooting ==
If you have issues starting Sick Beard, ensure that [[SELinux]] is disabled.


You may want to check if you have [[SELinux|SELinux disabled]] or if your firewall is letting through port 8080 and 8081 for SABnzbd and Sickbeard, respectively.
== See Also ==
* http://sickbeard.com/ - Official Website


[[Category:Linux]]
{{Navbox Linux}}[[Category:Linux]]
[[Category:Guides]]
[[Category:Usenet]]
[[Category:Deprecated]]
{{Navbox Web}}[[Category:WebApp]]

Latest revision as of 06:14, 3 January 2022

Sick Beard is a web application written in Python that can automatically fetches TV shows from Usenet.

Development has stopped
The development of Sick Beard appears to have stopped. I have since switched to Sonaar which has additional features and better download failure handling.


Installation

I have used Sick Beard on both CentOS 6 and CentOS 7 systems. The installation steps are outlined in this section.

CentOS 7

The installation process under CentOS 7 is very straight forward.

## Install dependencies
# yum -y install python-cheetah pyOpenSSL git wget

## Setup sickbeard user & home directory
# groupadd -r -g 250 downloaders
# adduser -M -d /usr/local/sickbeard -r -u 250 -g 250 sickbeard
# mkdir /usr/local/sickbeard
# chown sickbeard:downloaders /usr/local/sickbeard

# su - sickbeard -c "git clone https://github.com/midgetspy/Sick-Beard.git /usr/local/sickbeard"

Go through the configuration file at /usr/local/sickbeard/config.ini and ensure that web_port and web_host are set properly.

Serve Sick Beard on its own domain
If you are running this on a remote server, you may want to serve Sick Beard on a domain name such as sickbeard.mydomain.com. You may either change the web_port to port 80, or use IPTables to reroute port 80 to the 8081 using the rule: iptables -A PREROUTING -t nat -i eno16777736 -p tcp -d 10.1.2.3 --dport 80 -j REDIRECT --to-port 8081


Starting Sick Beard can be done using a systemd startup script which executes:

screen -S sickbeard -dm su - sickbeard -c "/usr/local/sickbeard/SickBeard.py --datadir=/home/sickbeard/data"

CentOS 6

Because the distro packages are too old, you will need to compile some of the dependencies manually. The shell script below should help you get SickBeard set up.

#!/bin/bash
# Install EPEL repo
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# Update system and install dependencies.
yum -y update
yum -y install wget git unzip par2cmdline pyOpenSSL openssl gcc python-devel

#
# Install unrar
#
cd ~
wget http://www.rarlab.com/rar/unrar-linux-x64.gz
gunzip unrar-linux-x64.gz
chmod 755 unrar-linux-x64
mv unrar-linux-x64  /usr/bin/unrar

#
# Install python-yenc
#
cd ~
wget http://sabnzbd.sourceforge.net/yenc-0.3.tar.gz
tar -xzf yenc-*.tar.gz
cd yenc-0.3
python setup.py install

#
# Install python-cheetah
#
cd ~
wget http://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz
tar -zxvf Cheetah-2.4.4.tar.gz
cd Cheetah-2.4.4
python setup.py install

#
# Install SABnzbd
#
cd ~
wget http://downloads.sourceforge.net/project/sabnzbdplus/sabnzbdplus/0.7.13/SABnzbd-0.7.13-src.tar.gz
tar -xzf SABnzbd-0.7.13-src.tar.gz
mv SABnzbd-0.7.13 /usr/share/SABnzbd
useradd -r -M sabnzbd
chown -R sabnzbd:sabnzbd /usr/share/SABnzbd
# Create /etc/init.d/SABnzbd with the contents defined below.
# Create /etc/sysconfig/SABnzbd with the contents below.
cd /usr/share/SABnzbd
sudo -u sabnzbd python SABnzbd.py
# You may ctrl+c out. Running this once will show whether there are any issues.
# If all is good, enable the service:
chkconfig --add SABnzbd
chkconfig --level 234 SABnzbd on
# You might want to check out the .ini file that was generated on the first run at /usr/share/SABnzbd/sabnzbd.ini

#
# Install sickbeard
#
cd ~
git clone git://github.com/midgetspy/Sick-Beard.git my-sickbeard-install
mv my-sickbeard-instal /usr/share/sickbeard
useradd -r -M sickbeard
chown -R sickbeard:sickbeard /usr/share/sickbeard
vi /etc/sysconfig/sickbeard   # edit it to contain the contents below.
mv init.fedora  /etc/init.d/sickbeard
rm init.*
sudo -u sickbeard python SickBeard.py
# You may ctrl+c out. 
# Running this once will show whether there are any issues.
# If all is good, enable the service:
chkconfig --add sickbeard
chkconfig --level 234 sickbeard on

You may configure sick beard by editing the sysconfig file at /etc/sysconfig/sickbeard

SB_USER=sickbeard
SB_HOME=/usr/share/sickbeard
SB_DATA=/usr/share/sickbeard
SB_PIDFILE=/var/run/sickbeard/sickbeard.pid
protocol=http
host=10.1.1.16
port=8081

Troubleshooting

If you have issues starting Sick Beard, ensure that SELinux is disabled.

See Also