In my spare time I’ve been playing around with the Drobo file system and installing some DroboApps. Unlike my Netgear ReadyNAS and it’s packages, DroboApps are a little more primitive when it comes to installation. I guess that is a good thing as it allows for some customisation. But there is of course a learning curve that goes along with that. Just this week I helped my brother install and setup SABnzbd, CouchPotato and SickBeard on his Drobo box.
The installation of the DroboApps was relatively straightforward, and there is some good material out there that helps you to do just that. But one thing we noticed was the lack of information relating to how to get the apps running automatically upon system startup. So here I have included the scripts we used to get the daemons running after a system reboot.
Copy the contents to a file called service.sh in the DroboApps directory for each of the applications. To do this you should SSH into the Drobo, change into the directory of the app and open a ‘vi’ window and paste the contents into it. If you copy the contents to a file on Windows then you will have DOS carriage return characters in the scripts and this will cause issues when Drobo tries to run it. The way things work is that when the Drobo file system starts up it looks inside each of the DroboApps directory and looks for a file called service.sh. The file system then runs this script with the argument start, this is used to start the application. The way that the script works is that a center include set of subroutines are included in each service.sh script that wants you to provide a subroutine called start() that will start your application. That’s fairly straightforward, but the key thing is that when you start your application you need make sure a file is created that stores the Process ID of the running application. This important because this file, called the pidfile, and it’s contents is then used to stop the process upon system shutdown or when the application wants to be restarted.
Below is sample service scripts for SABnzbd, CouchPotato and SickBeard.
SABnzbd
#!/bin/sh
#
# SABnzbd daemon
. /etc/service.subr
prog_dir=`dirname \`realpath $0\``
piddir=${prog_dir}
cfgfile=/mnt/DroboFS/.sabnzbd/sabnzbd.ini
python=/mnt/DroboFS/Shares/DroboApps/python2/bin/python
name="SABnzbd"
version="1.0"
start()
{
${python} ${prog_dir}/SABnzbd.py --daemon --config-file ${cfgfile} --pid ${piddir}
}
case "$1" in
start)
start_service
;;
stop)
stop_service
;;
restart)
stop_service
sleep 3
start_service
;;
status)
status
;;
*)
echo "Usage: $0 [start|stop|restart|status]"
exit 1
;;
esac
CouchPotato
#!/bin/sh
#
# CouchPotato daemon
. /etc/service.subr
prog_dir=`dirname \`realpath $0\``
pidfile=${prog_dir}/couchpotato.pid
python=/mnt/DroboFS/Shares/DroboApps/python2/bin/python
name="CouchPotato"
version="1.0"
start()
{
${python} ${prog_dir}/CouchPotato.py -d --pidfile ${pidfile}
}
case "$1" in
start)
start_service
;;
stop)
stop_service
;;
restart)
stop_service
sleep 3
start_service
;;
status)
status
;;
*)
echo "Usage: $0 [start|stop|restart|status]"
exit 1
;;
esac
SickBeard
#!/bin/sh
#
# SickBeard daemon
. /etc/service.subr
prog_dir=`dirname \`realpath $0\``
pidfile=${prog_dir}/sickbeard.pid
python=/mnt/DroboFS/Shares/DroboApps/python2/bin/python
name="SickBeard"
version="1.0"
start()
{
rm -f ${pidfile}
${python} ${prog_dir}/SickBeard.py --daemon --pidfile ${pidfile}
}
case "$1" in
start)
start_service
;;
stop)
stop_service
;;
restart)
stop_service
sleep 3
start_service
;;
status)
status
;;
*)
echo "Usage: $0 [start|stop|restart|status]"
exit 1
;;
esac
UPDATE: After some testing, I found that SickBeard wasn’t starting after a reboot of the Drobo. Apparently the PID file was not being deleted on shutdown, so I updated the service script to remove the pidfile when start is called.

How did you install sabnzbd and sickbeard on Drobo? i would appreciate some help on that since I am new on the drobo apps world but i see that is possible
Thanks
Install Python into DroboApps from http://www.droboports.com, you may also want to install OpenSSH as an alternative to DropBear.
Follow “Automatically adding DroboApps to the PATH” (http://www.droboports.com/using-command-line-apps)
Install Cheetah library into Python (http://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz#md5=853917116e731afbc8c8a43c37e6ddba)
./python setup.py install
For each of SABnzbd, SickBeard and CouchPotato download the Python/Linux version (from their respective websites) and extract them into the DroboApps directory (install SABnzbd first so the other two can configure themselves to use it).
Each app will have a Python script that will install the application. Then you need to edit the configuration files with the IP address and ports you wish to use. Once that is done restart the application and browser to it through a web browser to finish setting them up.
You will also need to have unrar and par2 installed for SABnzbd. Use the following as a guide:
http://danonit.blogspot.com/2011/11/par2-and-unrar-for-drobo-fs.html
I was finally able to install sabnzbd successfully. Thanks a lot for your instructions and as you said the process is pretty straightforward. However, I had a couple more questions. After i created the service.sh for sabnzbd and rebooted my Drobo, I got a warning message on sabnzbd saying that unrar and par2 were not found. Since the error came from the folder /usr/bin I just copied the unrar and par2 files to that location from the DrboboApps folder and it seems to work fine now. I was asking the question because while copying the binary files to the /usr/bin folder I received an error saying that only unrar and par2 were able to copy, the rest of par2 files didn’t copy over because there was no more enough space. Wondering if that was the correct way to fix the warnings ??? I am unable to select ssl option on my server setup since it says is not installed
Thanks again for your help
barbecuy: see my post below..
Thanks very much for putting this online. It started me off on the process of installing sabnzb. There are somethings I need to complete such as get Openssl installed (for ssl encryption) however your guide was very useful.
To answer babecuy: What I did – Install the PAR2 and UNRAR Drobo ports as you would normally then create a symbolic link in /usr/bin to point to unrar and another for par2.
Eg: ln -s /mnt/DroboFS/Shares/DroboApps/unrar/unrar unrar
Test by running unrar
Restart sab and check your logs (either via the GUI or via command line). You shouldn’t see the par2 or unrar errors again.
I also updated my complete and incomplete folders to sit on Public e.g. /mnt/DroboFS/Shares/Public/complete
HTH someone..
The one thing which I haven’t configured as of yet (as I haven’t had the time) is the OpenSSL component which I consider to be a critical part to the overall setup. There is a python package called pyOpenSSL which I believe needs to be installed similar to UNRAR and PAR2 however how to configure the python runtime to speak openssl is where it may come to be a little tricky. Maybe a reverse proxy is in order.
If anyone does successfully install and configure OpenSSL in this environment, please post the steps involved to do so, thanks.