.Dd September 30, 2004 .Dt launchd 8 .Os Darwin .Sh NAME .Nm launchd .Nd System wide and per-user daemon/agent manager .Sh SYNOPSIS .Nm .Op Fl d .Op Fl D .Op Fl s .Op Fl S Ar SessionType .Op Ar -- command Op Ar args ... .Sh DESCRIPTION .Nm manages processes, both for the system as a whole and for individual users. The primary and preferred interface to .Nm is via the .Xr launchctl 1 tool which (among other options) allows the user or administrator to load and unload jobs. Where possible, it is preferable for jobs to launch on demand based on criteria specified in their respective configuration files. .Pp When run with a command, a specific instance of .Nm is created and the command is implicitly added to the list of jobs maintained by .Nm . If the command exits, that instance of .Nm will clean up all jobs maintained by itself and exit. All children of the command will use that instance of .Nm . .Pp During boot .Nm is invoked by the kernel to run as the first process on the system and to further bootstrap the rest of the system. .Sh OPTIONS .Bl -tag -width -indent .It Fl D Debug. Prints syslog messages to stderr and adjusts logging via .Xr syslog 3 to LOG_DEBUG. .El .Sh OPTIONS WHEN RUN AS PID 1 .Bl -tag -width -indent .It Fl s Single user mode. Instructs .Nm launchd to give a shell prompt before booting the system. .El .Sh ENVIRONMENTAL VARIABLES .Bl -tag -width -indent .It Pa LAUNCHD_SOCKET This variable is exported when invoking a command via the launchd command line. It informs launchctl how to find the correct launchd to talk to. .El .Sh NOTES In Darwin it is preferable to have your daemon launch via launchd instead of modifying .Nm rc or creating a .Nm SystemStarter Startup Item. .Pp At some point in the future, we hope to completely phase out the use of .Nm rc . .Sh FILES .Bl -tag -width "/System/Library/LaunchDaemons" -compact .It Pa ~/Library/LaunchAgents Per-user agents provided by the user. .It Pa /Library/LaunchAgents Per-user agents provided by the administrator. .It Pa /Library/LaunchDaemons System wide daemons provided by the administrator. .It Pa /System/Library/LaunchAgents Mac OS X Per-user agents. .It Pa /System/Library/LaunchDaemons Mac OS X System wide daemons. .El .Sh SEE ALSO .Xr launchctl 1 , .Xr launchd.plist 5 , .Xr rc 8 , .Xr SystemStarter 8