Here is a small howto on making SABnzbd work on CentOS 5.x (and therefore should also work on any other Red Hat like Distro). I'm not going to chew out everything in complete detail. Since you're using CentOS I'm assuming you have at least some basic experience with Linux.
CentOS uses python 2.4 for almost of it's internal scriping functions (like yum and the likes). Since python 2.4 is quite ancient (oldest man-pages were on clay tablets
As root:
* To install python 2.6 and the python-yenc to increase SABnzbd's efficiency
Code: Select all
yum install python26 python-yenc* Create a user for SABnzbd and su to that user
As your SABnzbd user:
* Download the latest version of SABnzbd to that home directory and unpack the directory
* Create a symlink This will make it easier for upgrades. Something like:
Code: Select all
ln -s SABnzbd-0.5.3 sabnzbd * Create a symlink for the ini-file. Something like:
Code: Select all
ln -s sabnzbd/sabnzbd.ini .sabnzbd/sabnzbd.iniCode: Select all
python26 sabnzbd/sabnzbd.py -d -f .sabnzbd/sabnzbd.ini* Shut down SABnzbd using the web interface.
As root:
* Create a new stop-start script for SABnzbd (make the config adjustments for your system - It should be self-explainatory)
Code: Select all
#!/bin/bash
#
# chkconfig: - 16 84
# description: Start up SABnzbd
#
# processname: SABnzbd
#
# source function library
. /etc/rc.d/init.d/functions
# Get network config
. /etc/sysconfig/network
# Defaults
PATH=/usr/bin:/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin
PYTHON_LOCATION="/usr/bin/python26"
# Daemon info
DAEMON_USER="YOUR SABNZBD USER"
DAEMON_HOME="/home/$DAEMON_USER"
DAEMON_LOCATION="$DAEMON_HOME/sabnzbd/SABnzbd.py"
DAEMON_INIFILE="$DAEMON_HOME/.sabnzbd/sabnzbd.ini"
DAEMON_ARGS="-d -f $DAEMON_INIFILE"
DAEMON_URL="YOUR SABNZBD URL"
DAEMON_API="YOUR SABNZBD API KEY"
# For if you secured your web interface with a username and password
DAEMON_USEPASS="no"
DAEMON_USER="sabnzbd"
DAEMON_PASS="sabpass"
case "$1" in
start)
echo "Starting SABnzbd."
/usr/bin/sudo -u $DAEMON_USER -H $PYTHON_LOCATION $DAEMON_LOCATION $DAEMON_ARGS
;;
stop)
echo "Shutting down SABnzbd."
if [ $DAEMON_USEPASS == "yes" ]; then
/usr/bin/wget -q --delete-after "$DAEMON_URL/sabnzbd/api?mode=shutdown&ma_username=$DAEMON_USER&ma_password=$DAEMON_PASS&apikey=$DAEMON_API"
else
/usr/bin/wget -q --delete-after "$DAEMON_URL/sabnzbd/api?mode=shutdown&apikey=$DAEMON_API"
fi
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0
Code: Select all
chkconfig SABnzbd onAll done
Just fire up your nice and shiny SABnzbd install using the service command and download all those legal Linux ISO's and the likes.
When upgrading: Just unpack it next to your previous version and change the symbolic link from the old to the new version!! This should always work unless the SABnzbd developers make EPIC changes to the config file.
