Have you ever gotten tired of starting lighttpd or ngircd manually because the SBSettings toggles don’t work or don’t exist?
I have. And I’m here to enlighten you on how to make your own launchdaemon.
My example will use lighttpd for which I’ve made a bash script located in /usr/bin named lighttpd-start containing all the info for lighttpd to use the correct conf file in /etc/:
<?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>net.lighttpd.start.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/lighttpd-start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>root</string>
</dict>
</plist>
As you can see, there really wasn’t much to figure out. Only real problem was figuring out WHICH LaunchDaemons folder to stick it in. I still haven’t gotten around to figuring that out…so just stick your custom launchdaemon in both /Library/LaunchDaemons/ and /System/Library/LaunchDaemons/ to be safe.







