How to launch Mac standalone version automatically on login
Subsonic Version: 5.2.1 (build 4427) – March 4, 2015
Server Version: jetty-6.1.x, java 1.6.0_65, Mac OS X (73.5 MB / 121.8 MB)
Hardware Platform: Mac OS 10.6.8
I have the standalone version installed in /var/subsonic on my Mac. To run it, I have to run the following from a terminal window:
I want to Subsonic to launch automatically on startup/login. I have tried:
1. Creating an Automator application to run the subsonic.sh script, and setting it as a login item. This fails silently, I guess because it's not able to run as root.
2. Creating an AppleScript to run the subsonic.sh script as an administrator. This fails silently, probably for the same reasons as above.
3. Setting up launchd to run subsonic.sh for all users under root, using the following plist file in /Library/LaunchAgents:
To test this, I tried:
This just fails silently. There is nothing in the subsonic.log file.
Why does Subsonic have to run as root? And if so, how do I launch it automatically?
Server Version: jetty-6.1.x, java 1.6.0_65, Mac OS X (73.5 MB / 121.8 MB)
Hardware Platform: Mac OS 10.6.8
I have the standalone version installed in /var/subsonic on my Mac. To run it, I have to run the following from a terminal window:
- Code: Select all
sudo bash /var/subsonic/subsonic.sh
I want to Subsonic to launch automatically on startup/login. I have tried:
1. Creating an Automator application to run the subsonic.sh script, and setting it as a login item. This fails silently, I guess because it's not able to run as root.
2. Creating an AppleScript to run the subsonic.sh script as an administrator. This fails silently, probably for the same reasons as above.
3. Setting up launchd to run subsonic.sh for all users under root, using the following plist file in /Library/LaunchAgents:
- 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>
<!-- YOUR SELF-CHOSEN LABEL (TASK ID) HERE -->
<string>LoginScripts.Subsonic.sh</string>
<key>ProgramArguments</key>
<array>
<!-- YOUR LITERAL SCRIPT PATH HERE -->
<string>/var/subsonic/subsonic.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
To test this, I tried:
- Code: Select all
sudo launchctl load /Library/LaunchAgents/LoginScripts.Subsonic.plist
This just fails silently. There is nothing in the subsonic.log file.
Why does Subsonic have to run as root? And if so, how do I launch it automatically?