eg-blog

Feed Rss

subsonic4.6_spkv17 download

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

Download: subsonic4.6_spkv17

  • Update should now work properly
  • a backup is kept in /volumeX/@appstore/subsonic_update_backup even after uninstall
  • DSM link is dynamic now
  • Subsonic music folder is set to /volume1/music. Change it if your music is somewhere else

Scripts

INFO
package="Subsonic"
version="4.6-17"
maintainer="Sindre Mehus, syno package maintained at synology-forum.de"
description="Subsonic is a free, web-based media streamer, providing ubiquitous access to your music."
arch="88f6281 88f6282"
firmware="3.1-1594"
package_icon="<base64 code of package center icon, far too long to post it here>"
install_reboot="yes"
preinst (this script and parts of other scripts were copied from scripts published on pcloadletter.co.uk)
#!/bin/sh

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

source /etc/profile

########################################
#check if Jva 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

exit 0
postinst
#!/bin/sh

#--------SUBSONIC postinstall script
#--------package maintained at synology-forum.de

####################################
#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"

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

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

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

#set up symlink for the DSM GUI
if [ -d /usr/syno/synoman/webman/3rdparty ]; then
	ln -s ${SYNOPKG_PKGDEST}/ /usr/syno/synoman/webman/3rdparty/Subsonic
fi

exit 0
preupgrade
#!/bin/sh

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

#variable for process ID
PID=""

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

subsonic_get_pid ()
{
   #use "-f 1"
   PID=`ps |grep java |grep subsonic |cut -d " " -f 1`

   #if PID is <10000 than "-f 1" is empty so use "-f 2"
   if [ -z $PID ]; then
      PID=`ps |grep java |grep subsonic |cut -d " " -f 2`
   fi
}

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

subsonic_get_pid

kill $PID
sleep 5
#delete temp files
rm -r /tmp/subsonic

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

mkdir ${SYNOPKG_PKGDEST}/../subsonic_update_backup
cp ${SYNOPKG_PKGDEST}/subsonic.properties *.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

exit 0
postupgrade
#!/bin/sh

#--------SUBSONIC postupgrade script
#--------package maintained at synology-forum.de

#variable for process ID
PID=""

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

subsonic_get_pid ()
{
   #use "-f 1"
   PID=`ps |grep java |grep subsonic |cut -d " " -f 1`

   #if PID is <10000 than "-f 1" is empty so use "-f 2"
   if [ -z $PID ]; then
      PID=`ps |grep java |grep subsonic |cut -d " " -f 2`
   fi
}

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

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

#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

#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
#delete temp files
rm -r /tmp/subsonic

#sleep 5

###############################
#restore subsonic db index and settings

cp -r ${SYNOPKG_PKGDEST}/../subsonic_update_backup/* ${SYNOPKG_PKGDEST}/

#remove backup folder
#remove the # in the next line if you want to delete the backup in the @appstore folder
#rm -r ${SYNOPKG_PKGDEST}/../subsonic_update_backup/

exit 0
preuninstall
#!/bin/sh

#--------SUBSONIC preuninstall script
#--------package maintained at synology-forum.de

#variable for process ID
PID=""

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

subsonic_get_pid ()
{
   #use "-f 1"
   PID=`ps |grep java |grep subsonic |cut -d " " -f 1`

   #if PID is <10000 than "-f 1" is empty so use "-f 2"
   if [ -z $PID ]; then
      PID=`ps |grep java |grep subsonic |cut -d " " -f 2`
   fi
}

subsonic_get_pid

if [ -z $PID ]; then
	sleep 1
else
	kill $PID
	sleep 5
	#delete temp files
	rm -r /tmp/subsonic
fi

exit 0
postuninstall
#!/bin/sh

#--------SUBSONIC postuninstall script
#--------package maintained at synology-forum.de

#remove subsonic daemon user
synouser --del subsonic

#remove DSM icon symlink
rm /usr/syno/synoman/webman/3rdparty/Subsonic

exit 0
start-stop-status
#!/bin/sh

#--------Subsonic start-stop-status script
#--------package maintained at synology-forum.de

#variable for process ID
PID=""

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

subsonic_get_pid ()
{
   #use "-f 1"
   PID=`ps |grep java |grep subsonic |cut -d " " -f 1`

   #if PID is <10000 than "-f 1" is empty so use "-f 2"
   if [ -z $PID ]; then
      PID=`ps |grep java |grep subsonic |cut -d " " -f 2`
   fi
}

case "$1" in
   start)
      # 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 temp files
	  rm -r /tmp/subsonic
	  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

20 Responses to subsonic4.6_spkv17 download

  1. Hi Eric, apologies for the English comment – I speak French and I studied Spanish at school, but unfortunately no German! Thanks for crediting the origin of the scripts, it looks like you’ve done a nice job. I saw at the German Synology forum that Matthieu suggested for you to add the setting „install_dep_service“ in INFO.
    There’s a reason I don’t do this for Serviio – if you look at the latest versions of my Java packages, they are called java6 and java7. They need to have different names for update notification via the repository. Since you don’t know which Java version a Synology NAS may have, you can’t force a dependency (there is no OR condition) – so I prefer to use the checks you have copied in your preinst script.
    I think you guys on the German forum have your own package repository, but I’d be happy to host this on mine if you want, then it could be in the same place with the Java packages.

    Antworten
  2. Hi patters, thanks =)
    That is exactly what I said to Matthieu. The missing „OR“ condition and the far more ways to install Java.

    The package source url is http://update.10trum.de/packageupdate/getpackages.php . My package would have been uploaded there yesterday but the admin changed the maximum file size to 4MB instead of 40… -.-

    Of course you can add this package to your repository. =)
    If you have some kind of package-uploader you can send me a link to upload the package by myself. If not I can send you a link to the new package every time there is a new version out or you subscribe to the rss feed.

    You can also add your packages to the Cummunity Package Hub if you want to. There is a package manager installed on the Homepage.
    I can write a message to Matthieu to get you an user account.

    Thanks again, I apologize for my English, its based on hundreds of TopGear Episodes. Eric

    Antworten
  3. Cool, ok I’ll add your current version to my repo. I just put the data from INFO into the MySQL database. The actual download link will just be the same as the link you’re already hosting. Is your bandwidth for that ok? I use Dropbox for my stuff. I guess one advantage of putting it up with the Java packages is that there are already a lot of people who have my repo entered on their Synos. Since it’s something I coded myself, you would need to send me the details each time you make a new version.

    I’m not sure that you need 88f6282 in the arch settings – mine don’t have that and they’re fine on that processor. Would your package work on Intel? Or is there an underlying binary like FFmpeg?

    LOL about Top Gear!

    Antworten
  4. Ok, I’ve seen lame and ffmpeg. Are they the only binaries? I can probably cross compile lame for you to allow you to build an Intel version of the package (arch x86).

    I have a couple of suggestions:-
    Does the package really need to reboot? Most things don’t. In fact, I installed it I selected not to reboot. Subsonic seems ok.

    Synology have updated the package documentation here:
    http://download.synology.com/download/ds/userguide/Synology%20DiskStation%20Manager%203rd-Party%20Apps%20Developer%20Guide_V2.pdf

    There’s a useful new key called ‚dsmuidir‘ which allows the DSM icon to be hidden/revealed when the package is stopped/started (I guess the official PHPMyAdmin package uses this).

    Also, for the file INFO:
    install_dep_services=“apache-web“
    start_dep_services=“apache-web“
    adminurl=“/“
    adminport=“4040″
    checkport=“4040″
    helpurl=“http://forum.subsonic.org/“

    I used a three digit version number for the spk version (so 018 instead of 18). I noticed that Synology were doing that with their own official spks (like Mailstation) so it’s useful to use that same style to make a clear distinction from the actual Subsonic release version number.

    Antworten
  5. The package is now live at http://pcloadletter.comlu.com.

    I forgot to mention – I think it’s a good idea to use the helpurl feature which you see in More Info in Package Center, so as to make clear the origin of the underlying software, and where to get support (you could put your blog URL if you didn’t want people to go directly to the subsonic forum).

    Antworten
  6. Ignore the apache-web stuff I wrote above, I see that it’s using a Java web server.

    Antworten
  7. Holy crap. Just set this up and bought iSub for my iPhone 3G (no, I can’t see the point in upgrading).
    This is what I’ve been waiting for! I barely listen to music anymore because it’s such a huge pain to sync with iTunes, decide what to sync, etc. I tried Spotify for a bit but always listened to the same small set of stuff, plus it was quite buggy. This, though is brilliant! All 60GB of my collection at my fingertips, with artwork and no messing about.

    Antworten
  8. Hi patters, thanks again for the massive feedback and the updated user guide.
    I will implement the things you mentioned as soon as I can.
    A few answers to your questions:

    I use dropbox, too.

    ffmpeg, lame: It would be kind if you can compile a x86 version for me. lame is not used in the standard configuration, but you can fully customize the transcoding options in Settings->Transcoding, so it would be a mistake to leave it away.
    I thought about changing the transcoding path with a symbolic link in further versions as I don’t know how big die /tmp/ folder can get.

    Does the package really need to reboot? – Not after a fresh install, but after an upgrade, because I don’t know how to restart the jetty server or clear its cache a reboot seemed to be the only opinion. Otherwise Subsonic doesn’t work properly.
    I had other things to worry about ;).
    For example why Subsonic has to be started after upgrading, (the start is implemented in the postupgrade script) before copying back the backup files. If Subsonic is not started before that you just get an error message „503 service unavailable“ even after rebooting.

    I am a widows grown guy and this is my first linux project so everything is new to me, if you have got some improvements to make, please let me know.

    Holy crap: Yes =)
    I didn’t know about Subsonic until the great c’t magazine wrote about it last moth. The web GUI is quite ugly but the potential of the whole networking features are so huge.

    Haha I just got an update message for my Subsonic 😉

    Antworten
  9. If you can freely set the temp location in the config files before you package Subsonic, /volume1/@tmp might be better. It’s unlimited (it’s on your primary volume) and it’s automatically cleared when the NAS reboots. I think there’s not much space for /tmp. One attempt to remux a movie to that location using Serviio and it locks up the whole NAS.

    Not sure why you would have got a version update notification from the repo – I used the same version number from your INFO file (are you running a different version?). Notice that if you click on more info (I think) it gives you the changelog field from the repo database – pretty neat.

    I saw from your screenshots you’re running an older Java build of mine. The newest one has better scripting to prevent installing two different JREs, and some more tolerance for browsers that will auto-gunzip the tgz archives it expects from Oracle and Synology.

    As for Subsonic I actually like the WebUI because it’s so simple :). I find that iSub on the iPhone is quite a clumsy UI – however at least it runs on iOS 3. All the other clients require iOS4 which runs like crap on a 3G iPhone. The Android one looks really nice. I was a bit surprised that you need to buy Subsonic after 30 days though, when it says „free“ all over the website. Still, 10EUR isn’t much.

    I’m quite surprised that Subsonic isn’t using SSL, since using HTTP someone could sniff the password. I guess it’s only music though at the end of the day, and I made my iPhone account low privileged.

    It’s a shame that Dropbox doesn’t have download counters for public files. It would be nice to know how many people use the various syno packages. I read you can use ‚bit.ly‘ to point back to the file and track hits on that, but there are plenty of complaints that it counts search engine hits, which gives you fake high counts. Plus I think the syno Package Center may not deal with redirects properly. I will at some point start logging all the unique IPs of the synos that regularly check in with my repo, which should give me some idea of numbers.

    Antworten
  10. I installed the spkv17 just to test the update notification.
    Just googled how to count downloads in dropbox, before reading your post and ended up with the same result.

    I will update my Java in the evening. Now I’ve got to work on my C++ Raytracer for College.

    Antworten
  11. A rare 1949 Bigsby gig bag vs case fetched $266,
    000 in April at Heritage Auctions in Dallas, Texas, a price that more than doubled
    the sales record for any gig bag vs case at a Heritage auction.

    Antworten
  12. Everything is very open with a really clear clarification of the issues.
    It was definitely informative. Your website is very useful.

    Thanks for sharing!

    Antworten
  13. I think this is among the most important information for me.
    And i am glad reading your article. But want to remark on few general things, The site style is perfect, the articles is really great : D.
    Good job, cheers

    Antworten
  14. From 12 till 17 I was an electric guitar case rack. Let us know why
    you need to pay more attention to how the game looks and sounds on your individual
    phone. The first time I listened to the tracks, it was all
    a blur.

    Antworten
  15. Hello there! This is my first visit to your blog! We are a team of volunteers
    and starting a new project in a community in the same niche.
    Your blog provided us beneficial information to work on.
    You have done a extraordinary job!

    Antworten
  16. Hello there, You have done an excellent job. I will certainly digg it and personally recommend to my friends. I am confident they’ll be benefited from this website.

    Antworten
  17. Wow, wonderful weblog layout! How long have you been running a
    blog for? you made running a blog glance easy. The total glance of your website is fantastic,
    as smartly as the content!

    Antworten
  18. I’m extremely impressed with your writing abilities as well as with
    the layout to your weblog. Is this a paid subject matter or did you customize it your self?
    Anyway stay up the excellent high quality writing, it’s rare
    to look a nice blog like this one today..

    Antworten
  19. Hey there, You have done an excellent job. I’ll definitely digg it and personally
    suggest to my friends. I’m confident they’ll be benefited from this
    web site.

    Also visit my blog – Nina Edwards

    Antworten
  20. This article provides clear idea for the new visitors of blogging, that genuinely how to do
    blogging.

    Antworten

Schreibe einen Kommentar

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

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.