Page 1 of 1

Subsonic always runs as root

PostPosted: Sun Oct 20, 2013 3:13 am
by wrmesq
For some reason I cannot get Subsonic to run as a non-root user. I am running it on Ubuntu Server 12.04

I stopped the service and added a user named "subsonic".

sudo su
service subsonic stop
adduser --system --no-create-home subsonic
adduser subsonic audio


Edited /etc/default/subsonic and added the line "SUBSONIC_USER=subsonic" (obviously without the quote marks)

Then made the necessary changes to the directories....

chown -R subsonic:nogroup /tmp/subsonic
chown -R subsonic:nogroup /var/subsonic
chown -R root:root /var/subsonic/transcode
chown -R root:root /var/subsonic/jetty/*/webapp
chown subsonic /etc/default/subsonic
chmod 754 /etc/default/subsonic


(no error messages were returned...)

restarted subsonic.....

service subsonic restart

and I still get the following:

root@subsonic:/etc/init.d# ps -Af | grep subsonic
root 2130 1 49 22:52 pts/0 00:00:07 java -Xmx100m -Dsubsonic.home=/var/subsonic -Dsubsonic.host=0.0.0.0 -Dsubsonic.port=4040 -Dsubsonic.httpsPort=0 -Dsubsonic.contextPath=/ -Dsubsonic.defaultMusicFolder=/var/music -Dsubsonic.defaultPodcastFolder=/var/music/Podcast -Dsubsonic.defaultPlaylistFolder=/var/playlists -Djava.awt.headless=true -verbose:gc -jar subsonic-booter-jar-with-dependencies.jar
root 2165 1972 0 22:52 pts/0 00:00:00 grep --color=auto subsonic


Also I get the warning message when accessing subsonic from its URL.

I must be missing something very basic here... What am I missing or not doing?

Re: Subsonic always runs as root

PostPosted: Thu May 08, 2014 11:30 pm
by JC90
I know this is a bit old, but did you ever find a solution to this? I've just set-up Subsonic on a headless Ubuntu 12.04.4 server and am having the same issue where it continues to run as root user even after making the necessary changes from the documentation.

I access my server from the internet so really would like to change this if possible.

Re: Subsonic always runs as root

PostPosted: Fri May 09, 2014 3:56 am
by daneren2005
I would maybe try changing it to a regular user (ie: one with a home setup and everything) and see if it tries to start like that correctly. I have mine set to SUBSONIC_USER=www-data and it seems to work correctly like that. Or you can try editing /etc/init.d/subsonic directly. You can search for root and just replace it there. It shouldn't be necessary, but I'm not sure what the issue with your installation is. Also, maybe try checking the /var/subsonic/subsonic_sh.log (or whatever it is) to see if it is throwing an error trying to become that user.

Re: Subsonic always runs as root

PostPosted: Fri May 09, 2014 7:24 am
by chickenbits
Sorry but I have to ask..

did you make the user subsonic?

grep sub* /etc/passwd


->> EDIT:

How are you starting subsonic?

If you're launching the subsonic.sh with sudo > that's your problem

easiest way to launch it is to su as the user and then just run the script

su subsonic
./subsonic.sh
((provided the permissions are correct)

I use my subsonic streaming user as the identified owner then a streaming group which my main user is in for the group.

Re: Subsonic always runs as root

PostPosted: Fri May 09, 2014 9:48 am
by JC90
All sorted now. I originally installed it from a repository after following a guide elsewhere on the net - it must have been an old version before the alternate user support was implemented. I removed it all and installed the latest .deb on the Subsonic website and it appears to be working correctly now.