General documentation / cheat sheets for various languages and services

Daemons vs. Agents

Daemons run apart from users, agents run specifically for users.

Read man launchctl for more.

Login Items

System PreferencesUsers & GroupsLogin Items

There aren't many configuration options. Right clicking the listed items will bring up a context menu with a single "Show in Finder" option.

Login items can be added programmatically with osascript, e.g.:

osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/TextEdit.app", hidden:false}'

Startup Items

More rarely used:

/Library/StartupItems
/System/Library/StartupItems

Kernel Extensions

Applications can also sneak themselves into your kernel extensions.

These are stored in the filesystem at /System/Library/Extensions.

List currently loaded extensions with:

sudo kextstat

Stop one like so:

sudo kextunload -b com.paceap.kext.pacesupport.snowleopard

While you can remove the files from /System/Library/Extensions, it appears that kextunload also causes the extension not to be loaded in future boots.

Debugging

Based on my Server Fault answer.

To enable one-off logging, without using the filesystem:

sudo launchctl debug service-target --stdout --stderr

For that dev.localmon service, the following will pipe the process's stdout and stderr into the shell the next time (and only the next time) the service starts:

sudo launchctl debug gui/$UID/dev.localmon --stdout --stderr

You must have already called launchctl load ~/Library/LaunchAgents/dev.localmon.plist before starting the debug session.

That command will hang with the open-and-ready TTYs. In another terminal, run:

launchctl start dev.localmon

Error interpretations

References: