Launching SABnzbd as user

Support for the freeBSD package, created by dbrooks
Post Reply
lrusak
Newbie
Newbie
Posts: 2
Joined: December 6th, 2011, 2:36 pm

Launching SABnzbd as user

Post by lrusak »

I need some help, I am running sabnzbd on my freenas box (therefor I thought it was appropriate to post in the freeBSD forum) and it is running great. I have an issue though and I am unsure about how to correct it as I have limited knowledge of BSD.

My issue is that sabnzbd (as well as couchpotato and sickbeard) are running as root on the box. This causes some permission problems when I try to edit or remove the files created by these programs. I can always ssh into the box and chown the folders to my user credentials, but this is a pain.

my installation basically follows this guide exactly except for the actual paths of course.
http://sourceforge.net/apps/phpbb/freen ... 15&t=11618

I have also followed the post further down that creates a startup script so the programs run when the box is turned on.
http://sourceforge.net/apps/phpbb/freen ... a70#p53542

I've tried editing the startup script to this, but it doesn't work

Code: Select all

#!/bin/bash
#startup.sh
PATH=$PATH:/mnt/SPACE/downloaders/bin
PYTHONPATH="/mnt/SPACE/downloaders/lib/python2.7/site-packages" su lukas -c "/usr/local/bin/python /mnt/SPACE/downloaders/SABnzbd/SABnzbd.py -d -f /mnt/SPACE/downloaders/sabconfig/sabnzbd.ini -s 0.0.0.0:8085"
PYTHONPATH="/mnt/SPACE/downloaders/lib/python2.7/site-packages" su lukas -c "/usr/local/bin/python /mnt/SPACE/downloaders/SickBeard/SickBeard.py --quiet &
PYTHONPATH="/mnt/SPACE/downloaders/lib/python2.7/site-packages" su lukas -c "/usr/local/bin/python /mnt/SPACE/downloaders/CouchPotato/CouchPotato.py -d"
I found this online, but am unsure where to put it.
SABNZBD_USER="sabnzbd"
SABNZBD_CONF="/opt/sabnzbd/sabnzbd.ini"

and that is only for sabnzbd, what about the other programs?

perhaps I have to edit the TV-daemon script somehow to make it run as user instead of root?

Code: Select all

#!/bin/sh
#
# PROVIDE: tv_daemon
# REQUIRE: zfs ix-*

tv_daemon_flags=${tv_daemon_flags-"-D"}

. /etc/rc.subr
. /usr/local/etc/gnome.subr

tv_daemon_enable=${tv_daemon_enable-${gnome_enable}}

name=tv_daemon
rcvar=`set_rcvar`

start_cmd=tv_daemon_start
stop_cmd=tv_daemon_stop

tv_daemon_start=/mnt/SPACE/startup.sh
tv_daemon_stop=/mnt/SPACE/shutdown.sh

tv_daemon_start() {
    echo "Starting tv-daemon." && \
        ${tv_daemon_start}
}

tv_daemon_stop() {
    echo "Stopping tv-daemon." && \
        ${tv_daemon_stop}
}

load_rc_config ${name}
run_rc_command "$1"
can anyone help me out? thanks

Post Reply