There are two types of services that launchd manages:
- launch daemons can run without a user logged in. Launch daemons cannot display information using the GUI. Launch daemon configuration plist files are stored in the /System/Library/LaunchDaemons folder (for those provided by Apple et al) and /Library/LaunchDaemons (for the rest).
- Launch agents run on behalf of a user and therefore need the user to be logged in to run. Launch agents can display information through the window server. As with launch daemons, launch agent configuration plist files are stored in the /System/Library/LaunchAgents and /Library/LaunchAgents. User launch agents are installed in the ~/Library/LaunchAgents folder.
An example launch agent:
<?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>com.apple.TextEdit</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/Applications/TextEdit.app/Contents/MacOS/TextEdit</string> </array> </dict> </plist>