Subsonic always runs as root

Need help? Post your questions here.

Moderator: moderators

Subsonic always runs as root

Postby wrmesq » Sun Oct 20, 2013 3:13 am

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?
wrmesq
 
Posts: 2
Joined: Sun Oct 20, 2013 1:59 am

Re: Subsonic always runs as root

Postby JC90 » Thu May 08, 2014 11:30 pm

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.
JC90
 
Posts: 2
Joined: Thu May 08, 2014 11:24 pm

Re: Subsonic always runs as root

Postby daneren2005 » Fri May 09, 2014 3:56 am

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.
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm

Re: Subsonic always runs as root

Postby chickenbits » Fri May 09, 2014 7:24 am

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.
chickenbits
 
Posts: 9
Joined: Tue May 06, 2014 4:01 pm

Re: Subsonic always runs as root

Postby JC90 » Fri May 09, 2014 9:48 am

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.
JC90
 
Posts: 2
Joined: Thu May 08, 2014 11:24 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 88 guests