Page 1 of 1

Run subsonic as non root

PostPosted: Thu Apr 26, 2012 12:12 pm
by marcel
Hi,

I've installed Subsonic on my server. It's running ClearOS (RHEL). So my question is it possible to run subsonic as non root user. I've found the wiki with the following article:http://sourceforge.net/apps/mediawiki/subsonic/index.php?title=Debian_prebuilt I know this is for a other distro but i only followed this:
Code: Select all
Running as a Non-Root User

For security reasons it is better to run subsonic as non-root. Choose the same user that you expect to be logged-in to allow the jukebox to function. Subsonic will try to attach to the sound server, and if it is not running as the same user as the one logged in, then it will not be allowed to play over the sound system.
After getting through the install you will need to make a few changes to have the install run as non-root. For this example we will operate as user tv under directory /var/subsonic. Please change tv to whatever user you want to run subsonic as.
Run sudo -i to become root
Run service subsonic stop to stop the current running subsonic
Edit /etc/init.d/subsonic and change the following:
PIDFILE=/var/subsonic/$NAME.pid
Under do_start() add -c tv to the start-stop-daemon line to have the daemon start as user tv.
Remove the tmp files that were created as root with rm -rf /tmp/subsonic
Give the tv user permissions to the subsonic directory with chown -R tv:audio /var/subsonic Do the same for your music/video storage directories.
Restart Subsonic with service start subsonic


So i have to add "-c user" to /etc/init.d/subsonic (start/stop script).

Code: Select all

do_start()
{
    # Check if daemon is already running.
    if [ -e $PIDFILE ]
    then
        ps -p $(cat $PIDFILE) > /dev/null
        [ "$?" = 0 ] && return 1
    fi

    echo $"Starting $NAME ..."
    $DAEMON $DAEMON_ARGS
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch $LOCKFILE
    return $RETVAL
}


where do add "-c user"? I'll hope you can help me..

Re: Run subsonic as non root

PostPosted: Mon May 14, 2012 6:45 pm
by marcel
Nobody?

:(