eg-blog

Feed Rss

Subsonic 4.7 beta 1 Synology package

05.28.2012, Allgemein, Download / Release Notes, Subsonic on Synology DS, by .

Hi again today,

The Subsonic 4.7 beta 1 package is finally ready. As with every beta there may be some errors or bugs, if you don’t want to risk anything stay with 4.6 and wait for the 4.7 stable release.

What is new?

  • Subsonic 4.7 beta 1 included, infos here
  • Included html5 interfaces MiniSub and Subtunes. You can choose which one you want to install during the installation, upgrade process.
  • Included DSM links to the html5 interfaces
  • I have included an auto-RAM-detection part to the subsonic.sh so you don’t have to configure it by yourself. I copied this from the “serviio-wrapper.sh” by patters, click here to see the original script. It now sets the max Java heap size automatically depending on the amount of RAM available.
  • Enabled https on port 4041 for save streaming (don’t forget to change your firewall settings for Internet streaming). If you don’t want to have https enabled change line 12 in the /volumeX/@appstore/Subsonic/subsonic.sh to SUBSONIC_HTTPS_PORT=0.
  • minor bug fixes

Upgrading / installation works like before (more info here). If you want to be 100% sure not to lose your database, copy the Subsonic folder to a save place or use the subsonic-backup-creator… Your music folder will not be touched.

Download and install it automatically from the germany Synology package repo (more info here)

or directly from here and install it manually:

ARM version: Subsonic4.7b1-023-ARM.spk (37 MB)

x86 version:   Subsonic4.7b1-023-x86.spk (36,2 MB)

Scripts:

preinst

#!/bin/sh

#--------Subsonic preinstall script
#--------package maintained at synology-forum.de

source /etc/profile

########################################
#check if Java is installed

if [ -z ${JAVA_HOME} ]; then
	echo "Java is not installed or not properly configured. JAVA_HOME is not defined. " > $SYNOPKG_TEMP_LOGFILE
        echo "Download and install the Java Synology package from http://wp.me/pVshC-z5" >> $SYNOPKG_TEMP_LOGFILE
	exit 1
fi

if [ ! -f ${JAVA_HOME}/bin/java ]; then
	echo "Java is not installed or not properly configured. The Java binary could not be located. " > $SYNOPKG_TEMP_LOGFILE
        echo "Download and install the Java Synology package from http://wp.me/pVshC-z5" >> $SYNOPKG_TEMP_LOGFILE
	exit 1
fi

#########################################
#check if Subsonic folder is in public folder wehn restore is selected
if [ ! -z ${install_restore} ]; then
	PUBLIC=`cat /usr/syno/etc/smb.conf | sed -r '/\/public$/!d;s/^.*path=(\/volume[0-9]{1,3}\/public).*$/\1/'`

	if [ ! -d $PUBLIC/Subsonic ]; then
		echo "Can't find a folder named 'Subsonic' in your public folder. " > $SYNOPKG_TEMP_LOGFILE
		echo "Please check your public folder and make sure there is a folder called Subsonic (with Capital S) in it. Or select 'No' if you don't want to restore anything and just install Subsonic normally" >> $SYNOPKG_TEMP_LOGFILE
		exit 1
	fi
fi

exit 0

postinst

#!/bin/sh

#--------SUBSONIC postinstall script
#--------package maintained at eg-blog.de

#variable for process ID
PID=""

subsonic_get_pid ()
{
	PID=`ps | grep java | grep subsonic | awk '{print $1}'`
}

####################################
#subsonic user settings

#create subsonic daemon user
synouser --add subsonic `${SYNOPKG_PKGDEST}/passgen 1 20` "Subsonic daemon user" 0 "" ""

#determine the subsonic user homedir and save that variable in the user's profile
#this is needed because librtmp needs to write a file called ~/.swfinfo
#and new users seem to inherit a HOME value of /root which they have no permissions for
SUBSONIC_HOMEDIR=`cat /etc/passwd | sed -r '/Subsonic daemon user/!d;s/^.*:Subsonic daemon user:(.*):.*$/\1/'`
su - subsonic -s /bin/sh -c "echo export HOME=${SUBSONIC_HOMEDIR} >> .profile"

#####################################
#other stuff

#make the Subsonic start script executable
chmod +x ${SYNOPKG_PKGDEST}/subsonic.sh

#set ownership of Subsonic folder tree
chown -R subsonic ${SYNOPKG_PKGDEST}

#if beckup is selected check if Backup source is available
if [ ! -z ${install_restore} ]; then
	PUBLIC=`cat /usr/syno/etc/smb.conf | sed -r '/\/public$/!d;s/^.*path=(\/volume[0-9]{1,3}\/public).*$/\1/'`
	if [ ! -d $PUBLIC/Subsonic ]; then
		echo "Can't find a folder named 'Subsonic' in your public folder." > $SYNOPKG_TEMP_LOGFILE
		echo "Please check your public folder and make sure there is a folder called Subsonic (with Capital S) in it. Or select 'No' if you don't want to restore anything and just install Subsonic normally" >> $SYNOPKG_TEMP_LOGFILE
		exit 1
	fi
fi

#####################################
#start Subsonic

#set up symlink for the DSM GUI
ln -s ${SYNOPKG_PKGDEST}/ /usr/syno/synoman/webman/3rdparty/Subsonic

#create custom temp folder so temp files can be bigger
if [ ! -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
	mkdir ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
	chown -R subsonic ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
fi
#create symlink to the created directory
if [ ! -L /tmp/subsonic ]; then
	ln -s ${SYNOPKG_PKGDEST}/../../@tmp/subsonic /tmp/
fi

#start subsonic as subsonic user
su - subsonic -s /bin/sh -c /usr/syno/synoman/webman/3rdparty/Subsonic/subsonic.sh

#give it some time to start up
sleep 90

#stop subsonic
subsonic_get_pid
kill $PID
sleep 5

#copy MiniSub and Subtunes html5 web interface to web directory
chown -R root ${SYNOPKG_PKGDEST}
if [ ! -z ${minisub_install} ]; then
	cp -r ${SYNOPKG_PKGDEST}/MiniSub /usr/syno/synoman/webman/3rdparty/Subsonic/jetty/2988/webapp/
fi
rm -r ${SYNOPKG_PKGDEST}/MiniSub

if [ ! -z ${subtunes_install} ]; then
	cp -r ${SYNOPKG_PKGDEST}/Subtunes /usr/syno/synoman/webman/3rdparty/Subsonic/jetty/2988/webapp/
fi
rm -r ${SYNOPKG_PKGDEST}/Subtunes

chown -R subsonic ${SYNOPKG_PKGDEST}/

#delete symlink
rm /usr/syno/synoman/webman/3rdparty/Subsonic
#delete temp files
if [ -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
	rm -r ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
fi

#restart Web Station to clear webserver caches
if [ -f /usr/syno/etc/rc.d/S97apache-user.sh ]; then
	/usr/syno/etc/rc.d/S97apache-user.sh restart
fi

#########################################
#install user backup from public folder

if [ ! -z ${install_restore} ]; then
	PUBLIC=`cat /usr/syno/etc/smb.conf | sed -r '/\/public$/!d;s/^.*path=(\/volume[0-9]{1,3}\/public).*$/\1/'`
	#copy files
	cp -r $PUBLIC/Subsonic/* ${SYNOPKG_PKGDEST}/

	#new files might not be owned by subsonic user
	chown -R subsonic ${SYNOPKG_PKGDEST}/

	#make the Subsonic start script executable
	chmod +x ${SYNOPKG_PKGDEST}/subsonic.sh
fi
exit 0

preupgrade

#!/bin/sh

#--------Subsonic preupgrade script
#--------package maintained at eg-blog.de

#variable for process ID
PID=""

##############################################
#function to get the process id of Subsonic

subsonic_get_pid ()
{
   PID=`ps | grep java | grep subsonic | awk '{print $1}'`
}

###########################
#stop Subsonic if it is runing

subsonic_get_pid

if [ -z $PID ]; then
	kill $PID
	sleep 2
fi

if [ -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
	rm -r ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
fi

###########################
#backup subsonic.properties and db Folder

if [ -z ${update_restore} ]; then
	if [ ! -d ${SYNOPKG_PKGDEST}/../subsonic_update_backup ]; then
		mkdir ${SYNOPKG_PKGDEST}/../subsonic_update_backup
		cp ${SYNOPKG_PKGDEST}/subsonic.properties ${SYNOPKG_PKGDEST}/*.index ${SYNOPKG_PKGDEST}/../subsonic_update_backup/
		cp -r ${SYNOPKG_PKGDEST}/db ${SYNOPKG_PKGDEST}/../subsonic_update_backup
		cp -r ${SYNOPKG_PKGDEST}/lucene ${SYNOPKG_PKGDEST}/../subsonic_update_backup
		cp -r ${SYNOPKG_PKGDEST}/thumbs ${SYNOPKG_PKGDEST}/../subsonic_update_backup
	fi
fi

exit 0

postupgrade

#!/bin/sh

#--------SUBSONIC postupgrade script
#--------package maintained at eg-blog.de

#variable for process ID
PID=""

##############################################
#function to get the process id of Subsonic

subsonic_get_pid ()
{
	PID=`ps | grep java | grep subsonic | awk '{print $1}'`
}

################################
#make it working again

#restart Web Station to clear webserver caches
if [ -f /usr/syno/etc/rc.d/S97apache-user.sh ]; then
	/usr/syno/etc/rc.d/S97apache-user.sh restart
fi

###############################
#start and stop subsonic for first initialisation

#set up symlink for the DSM GUI
ln -s ${SYNOPKG_PKGDEST}/ /usr/syno/synoman/webman/3rdparty/Subsonic

#create custom temp folder so temp files can be bigge
if [ ! -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
	mkdir ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
	chown -R subsonic ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
fi

#create symlink to the created directory
if [ ! -L /tmp/subsonic ]; then
	ln -s ${SYNOPKG_PKGDEST}/../../@tmp/subsonic /tmp/
fi

#make the Subsonic start script executable
chmod +x ${SYNOPKG_PKGDEST}/subsonic.sh

#subsonic daemon user has been deleted and recreated so we need to reset ownership (new UID)
chown -R subsonic ${SYNOPKG_PKGDEST}/

#start subsonic as subsonic user
su - subsonic -s /bin/sh -c /usr/syno/synoman/webman/3rdparty/Subsonic/subsonic.sh

#give it some time to start up
sleep 90

#stop subsonic
subsonic_get_pid
kill $PID
sleep 5

#copy MiniSub and Subtunes html5 web interface to web directory
chown -R root ${SYNOPKG_PKGDEST}
if [ ! -z ${minisub_install} ]; then
	cp -r ${SYNOPKG_PKGDEST}/MiniSub /usr/syno/synoman/webman/3rdparty/Subsonic/jetty/2988/webapp/
fi
rm -r ${SYNOPKG_PKGDEST}/MiniSub

if [ ! -z ${subtunes_install} ]; then
	cp -r ${SYNOPKG_PKGDEST}/Subtunes /usr/syno/synoman/webman/3rdparty/Subsonic/jetty/2988/webapp/
fi
rm -r ${SYNOPKG_PKGDEST}/Subtunes

chown -R subsonic ${SYNOPKG_PKGDEST}/

#delete Symlink
rm /usr/syno/synoman/webman/3rdparty/Subsonic

#delete temp files
if [ -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
	rm -r ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
fi

#restart Web Station to clear webserver caches
if [ -f /usr/syno/etc/rc.d/S97apache-user.sh ]; then
	/usr/syno/etc/rc.d/S97apache-user.sh restart
fi

###############################
#restore subsonic db index and settings
if [ ! -z ${update_restore} ]; then
	PUBLIC=`cat /usr/syno/etc/smb.conf | sed -r '/\/public$/!d;s/^.*path=(\/volume[0-9]{1,3}\/public).*$/\1/'`
	if [ ! -d $PUBLIC/Subsonic ]; then
		echo "Can't find a folder named 'Subsonic' found in your public folder." > $SYNOPKG_TEMP_LOGFILE
		echo "Please check your public folder and make sure there is a folder called Subsonic (with Capital S) in it. Or select 'No' if you don't want to restore anything and just install Subsonic normally" >> $SYNOPKG_TEMP_LOGFILE
		exit 1
	else
		cp -r $PUBLIC/Subsonic/* ${SYNOPKG_PKGDEST}/
	fi
else
	cp -r ${SYNOPKG_PKGDEST}/../subsonic_update_backup/* ${SYNOPKG_PKGDEST}/

	#remove backup folder
	#remove the next lines to keep a backup in the @appstore folder
	if [ -d ${SYNOPKG_PKGDEST}/../subsonic_update_backup ]; then
		rm -r ${SYNOPKG_PKGDEST}/../subsonic_update_backup
	fi
fi

#subsonic may not own all new files
chown -R subsonic ${SYNOPKG_PKGDEST}/

#make the Subsonic start script executable
chmod +x ${SYNOPKG_PKGDEST}/subsonic.sh

exit 0

preuninst

#!/bin/sh

#--------SUBSONIC preuninstall script
#--------package maintained at eg-blog.de

#variable for process ID
PID=""

##############################################
#function to get the process id of Subsonic

subsonic_get_pid ()
{
	PID=`ps | grep java | grep subsonic | awk '{print $1}'`
}

subsonic_get_pid

if [ -z $PID ]; then
	sleep 1
else
	kill $PID
	sleep 2
	if [ -d /usr/syno/synoman/webman/3rdparty/Subsonic ]; then
		rm /usr/syno/synoman/webman/3rdparty/Subsonic
	fi

	if [ -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
		rm -r ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
	fi
fi

################################################
#create a backup in public folder in public folder
if [ ! -z ${uninstall_backup} ]; then
	PUBLIC=`cat /usr/syno/etc/smb.conf | sed -r '/\/public$/!d;s/^.*path=(\/volume[0-9]{1,3}\/public).*$/\1/'`
	if [ ! -d $PUBLIC/Subsonic ]; then
		mkdir $PUBLIC/Subsonic
	fi

	cp ${SYNOPKG_PKGDEST}/subsonic.properties *.index $PUBLIC/Subsonic
	cp -r ${SYNOPKG_PKGDEST}/db $PUBLIC/Subsonic
	cp -r ${SYNOPKG_PKGDEST}/lucene $PUBLIC/Subsonic
	cp -r ${SYNOPKG_PKGDEST}/thumbs $PUBLIC/Subsonic
fi

exit 0

postuninst

#!/bin/sh

#--------SUBSONIC postuninstall script
#--------package maintained at eg-blog.de

#remove subsonic daemon user
synouser --del subsonic

#remove DSM icon symlink
if [ -d /usr/syno/synoman/webman/3rdparty/Subsonic ]; then
	rm /usr/syno/synoman/webman/3rdparty/Subsonic
fi

#remove temp symlink
rm /tmp/subsonic

exit 0

start-stop-status

#!/bin/sh

#--------Subsonic start-stop-status script
#--------package maintained at eg-blog.de

#variable for process ID
PID=""

##############################################
#function to get the process id of Subsonic

subsonic_get_pid ()
{
	PID=`ps | grep java | grep subsonic | awk '{print $1}'`
}

case "$1" in
   start)
	  SUBSONIC_HOMEDIR=`cat /etc/passwd | sed -r '/Subsonic daemon user/!d;s/^.*:Subsonic daemon user:(.*):.*$/\1/'`

	  #set the current timezone for Java so that Subsonic log timestamps are accurate
      TZ=`cat /etc/TZ`
      grep "^export TZ" $SUBSONIC_HOMEDIR/.profile > /dev/null \
      && sed -i "s%^export TZ.*$%export TZ="$TZ"%" $SUBSONIC_HOMEDIR/.profile \
      || echo export TZ=${TZ} >> $SUBSONIC_HOMEDIR/.profile

	  #set up symlinks for the DSM GUI icon
	  #Subsonic main
	  if [ -d /usr/syno/synoman/webman/3rdparty ]; then
		ln -s ${SYNOPKG_PKGDEST}/ /usr/syno/synoman/webman/3rdparty/Subsonic
		#MiniSub
		if [ -d ${SYNOPKG_PKGDEST}/jetty/2988/webapp/MiniSub ]; then
			ln -s ${SYNOPKG_PKGDEST}/jetty/2988/webapp/MiniSub /usr/syno/synoman/webman/3rdparty/MiniSub
		fi
		#Subtunes
		if [ -d ${SYNOPKG_PKGDEST}/jetty/2988/webapp/Subtunes ]; then
			ln -s ${SYNOPKG_PKGDEST}/jetty/2988/webapp/Subtunes /usr/syno/synoman/webman/3rdparty/Subtunes
		fi
	  fi
      #create custom temp folder so temp files can be bigger
	  if [ ! -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
		mkdir ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
		chown -R subsonic ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
	  fi
	  #create symlink to the created directory
	  if [ ! -L /tmp/subsonic ]; then
		ln -s ${SYNOPKG_PKGDEST}/../../@tmp/subsonic /tmp/
	  fi
	  # starting subsonic as subsonic daemon user
      su - subsonic -s /bin/sh -c /usr/syno/synoman/webman/3rdparty/Subsonic/subsonic.sh
      sleep 5
	  exit 0
   ;;
   stop)
      #stop subsonic
	  subsonic_get_pid
      kill $PID
      sleep 2
	  #delete Symlinks and DSM icon
	  if [ -L /usr/syno/synoman/webman/3rdparty/Subsonic ]; then
		rm /usr/syno/synoman/webman/3rdparty/Subsonic
	  fi
	  if [ -L /usr/syno/synoman/webman/3rdparty/MiniSub ]; then
		rm /usr/syno/synoman/webman/3rdparty/MiniSub
	  fi
	  if [ -L /usr/syno/synoman/webman/3rdparty/Subtunes ]; then
		rm /usr/syno/synoman/webman/3rdparty/Subtunes
	  fi
	  if [ -d ${SYNOPKG_PKGDEST}/../../@tmp/subsonic ]; then
		rm -r ${SYNOPKG_PKGDEST}/../../@tmp/subsonic
	  fi
	  exit 0
   ;;
   status)
      subsonic_get_pid
      if [ -z  $PID ]; then
	  #Subsonic is not running
		exit 1
	  else
	  #subsonic is running
		exit 0
      fi
   ;;
   log)
	  echo "${SYNOPKG_PKGDEST}/subsonic.log"
	  exit 0
   ;;
esac

install_uifile

[{
	"step_title": "Restore Backup",
	"items":
	[{
		"type": "singleselect",
		"desc": "Would you like to restore a backup of Subsonic? Create a folder with all relevant files in it, name it Subsonic (with capital S)and place it into your public folder",
		"subitems":
		[{
			"key": "No",
			"desc": "No"
		 },
		 {
			"key": "install_restore",
			"desc": "Yes"
		}]
	}]
},
{
	"step_title": "html5 interfaces",
	"items":
	[{
		"type": "multiselect",
		"desc": "Would you like to install an additional html5 Interface?",
		"subitems":
		[{
			"key": "minisub_install",
			"desc": "MiniSub"
		},
		{
			"key": "subtunes_install",
			"desc": "Subtunes"
		}]
	}]
}]

upgrade_uifile

[{
	"step_title": "Restore Backup",
	"items":
	[{
		"type": "singleselect",
		"desc": "Would you like to restore a backup of Subsonic? Create a folder with all relevant files in it, name it Subsonic (with capital S)and place it into your public folder",
		"subitems":
		[{
			"key": "no",
			"desc": "No"
		 },
		 {
			"key": "install_restore",
			"desc": "Yes"
		}]
	}]
},
{
	"step_title": "html5 interfaces",
	"items":
	[{
		"type": "multiselect",
		"desc": "Would you like to install an additional html5 Interface?",
		"subitems":
		[{
			"key": "minisub_install",
			"desc": "MiniSub"
		},
		{
			"key": "subtunes_install",
			"desc": "Subtunes"
		}]
	}]
}]

uninstall_uifile

[{
	"step_title": "Create Backup",
	"items":
	[{
		"type": "singleselect",
		"desc": "Would you like to create a backup of Subsonic in the public folder?",
		"subitems":
		[{
			"key": "uninstall_backup",
			"desc": "Yes"
		},
		{
			"key": "No",
			"desc": "No"
		}]
	}]
}]

INFO

package="Subsonic"
version="4.7b1-023"
description="Subsonic is a free, web-based media streamer, providing ubiquitous access to your music."
maintainer="Subsonic is developed by: Sindre Mehus (subsonic.org), MiniSub is developed by: tsquillario (forum.subsonic.org), Synology package is maintained at eg-blog.de"
arch="88f6281 88f6282"
adminport="4040"
adminurl="/"
firmware="3.1-1594"
helpurl="http://eg-blog.de"
report_url="http://eg-blog.de"
package_icon="base64 icon code, too long to post it here"
install_reboot="yes"

application.cfg (Subsonic)

text = Subsonic
description = Subsonic Music Streamer
icon_16 = images/icon_16.png
icon_32 = images/icon_32.png
type = popup
protocol = http
port = 4040
path = /
adminonly = false

application.cfg (MiniSub)

text = MiniSub
description = Subsonic Music Streamer - MiniSub html5 interface
icon_16 = images/icon_16.png
icon_32 = images/icon_32.png
type = popup
protocol = http
port = 4040
path = /MiniSub/
adminonly = false

application.cfg (Subtunes)

text = Subtunes
description = Subsonic Music Streamer - Subtunes html5 interface
icon_16 = images/icon_16.png
icon_32 = images/icon_32.png
type = popup
protocol = http
port = 4040
path = /Subtunes/
adminonly = false

subsonic.sh (changes in lines 9, 12, 16-19, 22-31)

#!/bin/sh

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

SUBSONIC_HOME=/usr/syno/synoman/webman/3rdparty/Subsonic
SUBSONIC_HOST=0.0.0.0
SUBSONIC_PORT=4040
SUBSONIC_HTTPS_PORT=4041
SUBSONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=100
SUBSONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/volume1/music
SUBSONIC_DEFAULT_PODCAST_FOLDER=/volume1/music/Podcast
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/volume1/music/playlists

quiet=0

###added by gigon, see eg-blog.de for details---------------------------
RAM=$((`free | grep Mem: | sed -e "s/^ *Mem: *\([0-9]*\).*$/\1/"`/1024))
if [ $RAM -le 128 ]; then
    SUBSONIC_MAX_MEMORY=80
elif [ $RAM -le 256 ]; then
    SUBSONIC_MAX_MEMORY=192
elif [ $RAM -gt 256 ]; then
	SUBSONIC_MAX_MEMORY=384
fi
###---------------------------------------------------------------------

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 \
  -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 &

# 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

13 Kommentare zu Subsonic 4.7 beta 1 Synology package

  1. Hello,

    Thanks for this new version !
    I do have an issue sine a long time related to the displayed characters.
    I do have a lot of French songs and all special characters are not displayed correctly (é à è…).
    I readed many forums and I now it’s related to the LC_CTYPE entry but I’m unable to make it working.

    Since you’re German and should have the same issue with the ö ä ü… I wonder how you fixed it ?

    Any way to add something to your package to fix that ?

    Thanks in advance for your support.

    Antworten
    • Hmm I don’t have these problems. ä, ö, ü are displayed correctly in every case (menu, song title, player) maybe you can have a look at the subsonic forum, there are a lot more people around who know Subsonic a lot better than me…

      Antworten
      • Thanks for your reply.
        I found many information around the web who suggest to add the following on the synology.sh

        export LANG=en_US.UTF-8

        This didn’t worked for me.
        I added the locale, localedef and i18n folder and set the locale for my synology.
        Type /opt/bin/locale provide me :

        LANG=en_US.UTF-8
        LC_CTYPE=”en_US.UTF-8″
        LC_NUMERIC=”en_US.UTF-8″
        LC_TIME=”en_US.UTF-8″
        LC_COLLATE=”en_US.UTF-8″
        LC_MONETARY=”en_US.UTF-8″
        LC_MESSAGES=”en_US.UTF-8″
        LC_PAPER=”en_US.UTF-8″
        LC_NAME=”en_US.UTF-8″
        LC_ADDRESS=”en_US.UTF-8″
        LC_TELEPHONE=”en_US.UTF-8″
        LC_MEASUREMENT=”en_US.UTF-8″
        LC_IDENTIFICATION=”en_US.UTF-8″
        LC_ALL=en_US.UTF-8

        So, according this, it should work but special characters are still not visible (not showed at all for some albums and create issue on client -> aka subwii).

        I know… You don’t have any issue but if anybody else is ready and got the same issue fixed, I will appreciate.

        By the way : GOOD WORK !

        Antworten
        • I finally been made to make it work !
          I had to configure the LOCALE then, the reason it didn’t worked correctly right after, was because my Synology configuration was not correct.

          On the configuration panel, under regional settings, under language tab, I selected English to the 2 latests optios.

          Then it worked out !

          Antworten
  2. 2012-06-02 at 22:59 gothax

    Hi, This version is not working on 411Slim with java7 (latest): simply not starting ! I come back to 4.6 ;)
    thx

    Antworten
  3. I got a problem with this package. I can’t access to Subsonic with the 4040 port. I have a 404 page. I should use the port 4041 =/

    Antworten
  4. Sorry I don’t see your note.

    Antworten
  5. I have a new question related to the MP3 streaming.
    On my iPhone I use the great iSub application (expensive but great).

    I can see the streaming quality and I always have 128kbps !
    The original source is much higher and I didn’t set any limitation on Subsonic !

    Anyone can tell me where I can increase that ?
    I would like to go to 320kbps on WIFI and 128 for 3G.

    Thanks in advance.

    Antworten
  6. It’s the best time to make some plans for the future and it’s time to be happy.

    I have read this post and if I could I wish to suggest you some interesting things or
    tips. Perhaps you could write next articles
    referring to this article. I desire to read even more things about it!

    Antworten
  7. So, as opposed to coffee inside mug just drink beer the like stronger.
    Having a relative as being a tattoo is in fact employed by some
    people to immortalize a deceased family member.
    The show uses frequent cutaway gags, often inside the form of tangential vignettes
    which parody American culture.

    Antworten
  8. Hi would you mind letting me know which webhost you’re using?
    I’ve loaded your blog in 3 different web browsers and I
    must say this blog loads a lot quicker then most. Can you recommend a good internet hosting provider at a honest price?
    Many thanks, I appreciate it!

    Antworten
  9. Good write-up, I am regular visitor of one’s blog, maintain up the excellent operate, andd It’s going to be a regular visitor for a lengthy time.

    Antworten

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>