After getting tired of starting Instiki by hand all the time, I finally sat down and figured out how to write launchd configs this morning. Launchd is the new way to start daemons, cron jobs and inetd style services in OS X Tiger. You’ll need to create an unpriviledged user for Instiki and give them read/write access to the storage directory. Without further ado, here is the config file.
Update: I received an email the other day with a fix for this launchd plist. Apparently, I had forgotten to include the program itself in ProgramArguments array, which exec treats as the argv array. Thanks go to Adam Ingram-Goble of Indiana University for pointing this out to me. Sneers to Apple for misnaming the key. Given this information, they should have called it CommandLine instead.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>org.instiki.instiki</string> <key>OnDemand</key> <false/> <key>Program</key> <string>/usr/bin/instiki</string> <key>ProgramArguments</key> <array> <string>/usr/bin/instiki</string> <string>--port=2500</string> <string>--storage=/Library/WebServer/Instiki</string> </array> <key>RunAtLoad</key> <true/> <key>ServiceDescription</key> <string>The Instiki Wiki</string> <key>StandardErrorPath</key> <string>/Library/Logs/Instiki-error.log</string> <key>StandardOutPath</key> <string>/Library/Logs/Instiki.log</string> <key>UserName</key> <string>instiki</string> <key>WorkingDirectory</key> <string>/Library/WebServer/Instiki</string> </dict> </plist>