I did get this working...to a point. I am running the standalone version on a 10.5.8 PPC. The issue seems to be that launchctl wants to be in control so once the script passes off process it will quit it. Meaning once Java takes over then launchctl has nothing to run so it kills the process.
The LaunchDaemon I have come up with that works looks like this:
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.subsonic.serverStart</string>
<key>WorkingDirectory</key>
<string>/var/subsonic/standalone/</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-Xmx100m</string>
<string>-Dsubsonic.home=/var/subsonic</string>
<string>-Dsubsonic.host=0.0.0.0</string>
<string>-Dsubsonic.port=4040</string>
<string>-Dsubsonic.contextPath=/</string>
<string>-Dsubsonic.defaultMusicFolder=/var/music</string>
<string>-Dsubsonic.defaultPodcastFolder=/var/music/Podcast</string>
<string>-Dsubsonic.defaultPlaylistFolder=/var/playlists</string>
<string>-jar</string>
<string>/var/subsonic/standalone/subsonic-booter-jar-with-dependencies.jar</string>
</array>
<key>StandardOutPath</key>
<string>/dev/null</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
The downfall to this is that you have to manually change this file to adjust the amount of memory and all of the other variables that you can set by using the script.
A word of caution, though. If you use this as a LaunchDaemon so that it runs on machine boot rather than a LaunchAgent which will run when a user logs in, most of the album art will not be displayed. This is because an untrusted application is not allowed to run before the Window Server is launched, which happens at login. You will see an error in the system logs similar to this:
<Warning>: 3891612: (connectAndCheck) Untrusted apps are not allowed to connect to or launch Window Server before login.
followed by
[btpool0-15] WARN org.mortbay.log - /coverArt.view: java.io.IOException: Failed to create thumbnail for.....
I haven't found a workaround for that yet other than to have a user auto-login on the server which then launches Subsonic from a LaunchAgent. It kind of defeats the purpose and if you don't care about the cover art then this will work ok for you.