I struggled with running my Subsonic installation with Apple's LaunchDaemon. LaunchDaemon starts Subsonic as root at system startup. Here's how i did.
Step 1: Download Subsonic standalone version and put contents in "/opt/local/subonic" (be careful with rights: folder and files should have "755 root admin").
Step 2: Edit "/opt/local/subsonic/subsonic.sh" to set the startup variables.
- Code: Select all
SUBSONIC_HOME=/opt/local/var/subsonic
SUBSONIC_HOST=0.0.0.0
SUBSONIC_PORT=4040
SUBSONIC_HTTPS_PORT=0
SUBSONIC_CONTEXT_PATH=/
SUBSONIC_MAX_MEMORY=200
SUBSONIC_PIDFILE=
SUBSONIC_DEFAULT_MUSIC_FOLDER=/path/to/music
SUBSONIC_DEFAULT_PODCAST_FOLDER=/path/to/podcasts
SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/path/to/playlists
Step 3: Start Subsonic once with the startup script to ensure that all folders exist: "sh /opt/local/subsonic/subsonic.sh".
Step 4: Create LaunchDaemon ParameterList in "/Library/LaunchDaemons/org.subsonic.plist" with rights "755 root wheel".
- 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>org.subsonic</string>
<key>ProgramArguments</key>
<array>
<string>java</string>
<string>-Xmx200m</string>
<string>-Dsubsonic.home=/opt/local/var/subsonic</string>
<string>-Dsubsonic.host=0.0.0.0</string>
<string>-Dsubsonic.port=4040</string>
<string>-Dsubsonic.httpsPort=0</string>
<string>-Dsubsonic.contextPath=/</string>
<string>-Dsubsonic.defaultMusicFolder=/path/to/music</string>
<string>-Dsubsonic.defaultPodcastFolder=/path/to/podcasts</string>
<string>-Dsubsonic.defaultPlaylistFolder=/path/to/playlists</string>
<string>-Djava.awt.headless=true</string>
<string>-jar</string>
<string>subsonic-booter-jar-with-dependencies.jar</string>
</array>
<key>WorkingDirectory</key><string>/opt/local/subsonic</string>
<key>StandardErrorPath</key><string>/opt/local/var/subsonic/subsonic.log</string>
<key>StandardOutPath</key><string>/opt/local/var/subsonic/subsonic.log</string>
<key>Debug</key><false/>
<key>Disabled</key><false/>
<key>OnDemand</key><false/>
<key>RunAtLoad</key><true/>
</dict>
</plist>
Step 5: Reboot and check if subsonic started without problems (have a look at "/opt/local/var/subsonic/subsonic.log").
Improvement suggestions are welcome.
Good luck!
dandjo