Blog

Pick a selection with the buttons in the left margin, then click on one of the titles or subscribe to my RSS feed.

Wed, 01 Feb 2012 15:51:29 GMT
Running Hypnotoad as a service on OS X Lion
Description of plist file for launchd
Permalink

Here is how to run Hypnotoad using launchctl automatically after reboot. Create the file

/Library/LaunchDaemons/us.mojolicio.hypnotoad.plist

with the following content:
<?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>/opt/local/bin/hypnotoad</string>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>UserName</key>
    <string>myusername</string>
    <key>ProgramArguments</key>
    <array>
        <string>hypnotoad</string>
        <string>myapp.pl</string>
    </array>
    <key>WorkingDirectory</key>
    <string>Path/to/MojoliciousApp</string>
  </dict>
</plist>
To automatically run/respawn Hypnotoad after reboot, run

sudo launchctl load -w /Library/LaunchDaemons/↵
us.mojolicio.hypnotoad.plist

(Replace load with unload in the previous command to remove the entry.)

Click the back button to return to your selection, or create a random one using the buttons in the margin.