Running multiple subsonic daemons ubuntu

General discussions.

Moderator: moderators

Running multiple subsonic daemons ubuntu

Postby jim715 » Wed Jul 10, 2013 1:08 am

So I am at a loss what needs to be done. Essentially, I want vanilla subsonic ('v4.8') and musiccabinet (subsonic 'v4.7') to run on the same ubuntu 12.04 server.

I've gotten both services to run at the same time. woohoo :mrgreen: . The issue is both services are using the same exact 'subsonic-booter-jar-with-dependencies.jar' from /usr/share/subsonic. I know this because when I hit either in a browser, I see the vanilla subsonic theme. Where do I specify which /usr/share to use? /usr/bin/subsonic has this line:
Code: Select all
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
  -Dsubsonic.home=${SUBSONIC_HOME} \
  -Dsubsonic.host=${SUBSONIC_HOST} \
  -Dsubsonic.port=${SUBSONIC_PORT} \
  -Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
  -Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
  -Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
  -Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
  -Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
  -Djava.awt.headless=true \
  -verbose:gc \
  -jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &

but I have no idea how it specifies the location. Maybe I am unaware of how apps work on ubuntu? :oops:

One thing to note is that I had musiccabinet running on top of subsonic. I then decided to run both musiccabinet and vanilla subsonic. I moved the subsonic installation (with music cabinet) into musiccabinet specific folders and files. Then I installed subsonic with the 4.8 deb.

So far what I've done.

  • Create /etc/default/musiccabinet
    Code: Select all
    SUBSONIC_ARGS="--port=8081 --https-port=4433  --max-memory=300 --home=/var/musiccabinet"
    SUBSONIC_USER=root
  • Update /etc/default/subsonic
    Code: Select all
    SUBSONIC_ARGS="--port=8080 --https-port=443  --max-memory=300"
    SUBSONIC_USER=root
  • Created /etc/init.d/musiccabinet (copy of /etc/init.d/subsonic with changes below)
    Code: Select all
    [ -r /etc/default/musiccabinet ] && . /etc/default/musiccabinet

    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="Musiccabinet Subsonic Daemon"
    NAME=musiccabinet
    PIDFILE=/var/run/$NAME.pid
    DAEMON=/usr/bin/subsonic
    DAEMON_ARGS="--pidfile=$PIDFILE $SUBSONIC_ARGS"
    SCRIPTNAME=/etc/init.d/$NAME
    ...
    [ -e /var/$NAME ] && chown -R $SUBSONIC_USER /var/$NAME
    [ -e /tmp/$NAME ] && chown -R $SUBSONIC_USER /tmp/$NAME
  • Moved /var/subsonic to /var/musiccabinet.
  • Made a copy of /usr/share/subsonic in /usr/share/musicabinet. Replaced subsonic-booter-jar-with-dependencies.jar and subsonic.sh with those found in music cabinet standalone zip.

Start both services.
Code: Select all
root@xy:/usr/share/musiccabinet# service subsonic start
Started Subsonic [PID 5519, /var/subsonic/subsonic_sh.log]

root@xy:/usr/share/musiccabinet# service musiccabinet start
Started Subsonic [PID 5559, /var/musiccabinet/subsonic_sh.log]


ps -ef
Code: Select all
root      5559     1 10 19:52 pts/0    00:00:05 java -Xmx300m -Dsubsonic.home=/var/musiccabinet -Dsubsonic.host=0.0.0.0 -Dsubsonic.port=8081 -Dsubsonic.httpsPort=4433 -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      5519     1  3 19:52 pts/0    00:00:01 java -Xmx300m -Dsubsonic.home=/var/subsonic -Dsubsonic.host=0.0.0.0 -Dsubsonic.port=8080 -Dsubsonic.httpsPort=443 -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
jim715
 
Posts: 3
Joined: Wed Jul 10, 2013 12:06 am

Re: Running multiple subsonic daemons ubuntu

Postby jim715 » Fri Jul 12, 2013 2:44 pm

So I figured it out.
Prior to the initial post I tried replacing the following into /usr/bin/musiccabinet which is just a copy of /usr/bin/subsonic. It didn't work because subsonic-booter-jar-with-dependencies.jar wasn't executable (facepalm).
Well the following works, but I don't like the idea of hardcoding it.
[code]
${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
-Dsubsonic.home=${SUBSONIC_HOME} \
-Dsubsonic.host=${SUBSONIC_HOST} \
-Dsubsonic.port=${SUBSONIC_PORT} \
-Dsubsonic.httpsPort=${SUBSONIC_HTTPS_PORT} \
-Dsubsonic.contextPath=${SUBSONIC_CONTEXT_PATH} \
-Dsubsonic.defaultMusicFolder=${SUBSONIC_DEFAULT_MUSIC_FOLDER} \
-Dsubsonic.defaultPodcastFolder=${SUBSONIC_DEFAULT_PODCAST_FOLDER} \
-Dsubsonic.defaultPlaylistFolder=${SUBSONIC_DEFAULT_PLAYLIST_FOLDER} \
-Djava.awt.headless=true \
-verbose:gc \
- -jar subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &
+ -jar /usr/bin/musiccabinet/subsonic-booter-jar-with-dependencies.jar > ${LOG} 2>&1 &
Last edited by jim715 on Sun Jul 14, 2013 3:06 am, edited 1 time in total.
jim715
 
Posts: 3
Joined: Wed Jul 10, 2013 12:06 am

Re: Running multiple subsonic daemons ubuntu

Postby jim715 » Sun Jul 14, 2013 3:05 am

So I am a fool. /usr/bin/subsonic was a symbolic link to /usr/share/subsonic/subsonic.sh .When run the current path is /usr/share/subsonic where the subsonic-booter-jar-with-dependencies.jar is located. (facepalm)

No modification of of /usr/bin/subsonic was needed. Just had to create a symbolic link from /usr/bin to /usr/share/musiccabinet/subsonic.sh
jim715
 
Posts: 3
Joined: Wed Jul 10, 2013 12:06 am


Return to General

Who is online

Users browsing this forum: No registered users and 6 guests