Can't start service

Artist radio, genre radio & related artists. A Subsonic server for music nerds.

Moderator: moderators

Can't start service

Postby daneren2005 » Tue Mar 19, 2013 9:38 pm

So I decided it was past time to get MusicCabinet running on my own server. If for no other reason, I want it to be able to better support users are using it. So I went about duplicating everything from the default install so that it starts/stops the same, but with using the runtimes/scripts from the standalone installer. I then copied over the entire /var/subsonic folder over to /var/musiccabinet so that it imports all my old settings. Everything appears to start up correctly, but when I try to go to my site, it gives me this error:

HTTP ERROR: 503

Problem accessing /musiccabinet/. Reason:

Service Unavailable




So when I look inside of subsonic_sh.log I see this:

net.sf.ehcache.CacheException: Disk store path can't be created: /var/www/subsonic/ecache
... 40000000000000 lines of intermediate steps
at net.sourceforge.subsonic.booter.Main <init>(Main.java: 24)
at net.sourceforge.subsonic.booter.Main.main (Main.java: 63)

Now this is probably a permissions issue, but my question is why is it trying to create a file at /var/www/subsonic in the first place? I've poured over the configs over and over again, and there is absolutely nothing that points to that directory. Everything points to /var/musiccabinet, which mirrors the original installation at /var/subsonic.

PS Everything still works on the main installation fine.
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm

Re: Can't start service

Postby shadow.8 » Tue Mar 19, 2013 10:07 pm

What distro are you running? I have musiccabinet running on Arch Linux from the same folder (/var/musiccabinet) with the following subsonic.sh file:

Code: Select all
#!/bin/sh

###############################################################################$
# Shell script for starting Subsonic.  See http://subsonic.org.
#
# Author: Sindre Mehus
###############################################################################$

SUBSONIC_HOME=/var/musiccabinet
SUBSONIC_HOST=0.0.0.0
SUBSONIC_PORT=4040
SUBSONIC_HTTPS_PORT=0
SUBSONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=150
SUBSONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/var/music
SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists

JAVA_HOME=/opt/java/jre:/usr/lib/jvm/java-7-openjdk
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
quiet=0

usage() {
    echo "Usage: subsonic.sh [options]"
    echo "  --help               This small usage guide."
    echo "  --home=DIR           The directory where Subsonic will create files."
    echo "                       Make sure it is writable. Default: /var/subsonic"
    echo "  --host=HOST          The host name or IP address on which to bind Subsonic."
    echo "                       Only relevant if you have multiple network interfaces and want"
    echo "                       to make Subsonic available on only one of them. The default value"
    echo "                       will bind Subsonic to all available network interfaces. Default: 0.0.0.0"
    echo "  --port=PORT          The port on which Subsonic will listen for"
    echo "                       incoming HTTP traffic. Default: 4040"
    echo "  --https-port=PORT    The port on which Subsonic will listen for"
    echo "                       incoming HTTPS traffic. Default: 0 (disabled)"
    echo "  --context-path=PATH  The context path, i.e., the last part of the Subsonic"
    echo "                       URL. Typically '/' or '/subsonic'. Default '/'"
    echo "  --max-memory=MB      The memory limit (max Java heap size) in megabytes."
    echo "                       Default: 100"
    echo "  --pidfile=PIDFILE    Write PID to this file. Default not created."
    echo "  --quiet              Don't print anything to standard out. Default false."
    echo "  --default-music-folder=DIR    Configure Subsonic to use this folder for music.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/music'"
    echo "  --default-podcast-folder=DIR  Configure Subsonic to use this folder for Podcasts.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/music/Podcast'"
    echo "  --default-playlist-folder=DIR Configure Subsonic to use this folder for playlists.  This option "
    echo "                                only has effect the first time Subsonic is started. Default '/var/playlists'"
    exit 1
}

# Parse arguments.
while [ $# -ge 1 ]; do
    case $1 in
        --help)
            usage
            ;;
        --home=?*)
            SUBSONIC_HOME=${1#--home=}
            ;;
        --host=?*)
            SUBSONIC_HOST=${1#--host=}
            ;;
        --port=?*)
            SUBSONIC_PORT=${1#--port=}
            ;;
        --https-port=?*)
            SUBSONIC_HTTPS_PORT=${1#--https-port=}
            ;;
        --context-path=?*)
            SUBSONIC_CONTEXT_PATH=${1#--context-path=}
            ;;
        --max-memory=?*)
            SUBSONIC_MAX_MEMORY=${1#--max-memory=}
            ;;
        --pidfile=?*)
            SUBSONIC_PIDFILE=${1#--pidfile=}
            ;;
        --quiet)
            quiet=1
            ;;
        --default-music-folder=?*)
            SUBSONIC_DEFAULT_MUSIC_FOLDER=${1#--default-music-folder=}
            ;;
        --default-podcast-folder=?*)
            SUBSONIC_DEFAULT_PODCAST_FOLDER=${1#--default-podcast-folder=}
            ;;
        --default-playlist-folder=?*)
            SUBSONIC_DEFAULT_PLAYLIST_FOLDER=${1#--default-playlist-folder=}
            ;;
        *)
            usage
            ;;
    esac
    shift
done

# Use JAVA_HOME if set, otherwise assume java is in the path.
JAVA=java
if [ -e "${JAVA_HOME}" ]
    then
    JAVA=${JAVA_HOME}/bin/java
fi

# Create Subsonic home directory.
mkdir -p ${SUBSONIC_HOME}
LOG=${SUBSONIC_HOME}/subsonic_sh.log
rm -f ${LOG}

cd $(dirname $0)
if [ -L $0 ] && ([ -e /bin/readlink ] || [ -e /usr/bin/readlink ]); then
    cd $(dirname $(readlink $0))
fi

#${JAVA} -Xmx${SUBSONIC_MAX_MEMORY}m \
sudo -u musiccabinet ${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} \
  -Dsubsonic.war=subsonic.war \
  -Djava.awt.headless=true \
  -verbose:gc \
  -jar subsonic-booter.jar > ${LOG} 2>&1 &

# Write pid to pidfile if it is defined.
if [ $SUBSONIC_PIDFILE ]; then
    echo $! > ${SUBSONIC_PIDFILE}
fi

if [ $quiet = 0 ]; then
    echo Started Subsonic [PID $!, ${LOG}]
fi


The main changes I had to make were the SUBSONIC_HOME folder at the top of the config file and I had to change the reference to the jar file and war near the bottom to match the one in the standalone zip.
676 artists
2,348 albums
26,738 songs
276.51 GB (~ 1,993 hours)
User avatar
shadow.8
 
Posts: 110
Joined: Wed Sep 26, 2012 12:12 am

Re: Can't start service

Postby hakko » Tue Mar 19, 2013 10:56 pm

Thanks for pointing that out! I haven't looked at the ehcache configuration lately (it was used heavily in Subsonic 4.6 but not anymore) but now that I look at it, I realize that I changed it back then and that I should clean it up now that those days are past.

The reason it is trying to create a file there is because of this: https://github.com/hakko/subsonic/blob/ ... hcache.xml
I should use java.io.tmpdir instead of user.home.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Can't start service

Postby daneren2005 » Tue Mar 19, 2013 11:22 pm

@shadow.8: I'm using Ubuntu. My subsonic.sh file looks pretty identical to that one as well :D

@hakko: So now that you know the cause, it is:
a) a simple fix
b) going to go into the next release? I'm no hurry, so I am more then fine with waiting for it to get fixed to get started. I'm just curious whether I can expect it in there or not.
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm

Re: Can't start service

Postby hakko » Tue Mar 19, 2013 11:29 pm

My plan for the next release is to build some more auto-tests for the REST 1.8 interface thing, and fix what people report here related to that. This is a quick fix so I'll add it too, somebody else reported it before but I didn't realize then that I should do something about it.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Can't start service

Postby hakko » Sun Mar 24, 2013 6:49 pm

The cache is now stored in a temp directory (meaning any account should have write access), and I've tested deleting playlists and adding songs to playlists using DSub, so hopefully you'll get less error reports on that from now on.
MusicCabinet developer
hakko
 
Posts: 1416
Joined: Tue Apr 17, 2012 7:05 pm
Location: Sweden

Re: Can't start service

Postby daneren2005 » Sun Mar 24, 2013 7:21 pm

That is awesome. Thanks for all the good work on this fork

Sent from my HTC One X using Tapatalk 2
Developer of DSub for Android
daneren2005
 
Posts: 1709
Joined: Fri Jul 06, 2012 7:52 pm


Return to MusicCabinet

Who is online

Users browsing this forum: No registered users and 13 guests