]> git.saurik.com Git - apple/launchd.git/blob - launchd/src/launchd.8
315b255a32959b5c0bc9f6258d9b152b473aa538
[apple/launchd.git] / launchd / src / launchd.8
1 .Dd September 30, 2004
2 .Dt launchd 8
3 .Os Darwin
4 .Sh NAME
5 .Nm launchd
6 .Nd System wide and per-user daemon/agent manager
7 .Sh SYNOPSIS
8 .Nm
9 .Op Fl d
10 .Op Fl D
11 .Op Fl s
12 .Op Fl S Ar SessionType
13 .Op Ar -- command Op Ar args ...
14 .Sh DESCRIPTION
15 .Nm
16 manages processes, both for the system as a whole and for individual users.
17 The primary and preferred interface to
18 .Nm
19 is via the
20 .Xr launchctl 1
21 tool which (among other options) allows the user or administrator to load and unload jobs.
22 Where possible, it is preferable for jobs to launch on demand based on criteria specified
23 in their respective configuration files.
24 .Pp
25 When run with a command, a specific instance of
26 .Nm
27 is created and the command is implicitly added to the list of jobs maintained by
28 .Nm .
29 If the command exits, that instance of
30 .Nm
31 will clean up all jobs maintained by itself and exit. All children of the command will use that
32 instance of
33 .Nm .
34 .Pp
35 During boot
36 .Nm
37 is invoked by the kernel to run as the first process on the system and to further bootstrap the rest of the system.
38 .Sh OPTIONS
39 .Bl -tag -width -indent
40 .It Fl D
41 Debug. Prints syslog messages to stderr and adjusts logging via
42 .Xr syslog 3
43 to LOG_DEBUG.
44 .El
45 .Sh OPTIONS WHEN RUN AS PID 1
46 .Bl -tag -width -indent
47 .It Fl s
48 Single user mode. Instructs
49 .Nm launchd
50 to give a shell prompt before booting the system.
51 .El
52 .Sh ENVIRONMENTAL VARIABLES
53 .Bl -tag -width -indent
54 .It Pa LAUNCHD_SOCKET
55 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.
56 .El
57 .Sh NOTES
58 In Darwin it is preferable to have your daemon launch via launchd instead of modifying
59 .Nm rc
60 or creating a
61 .Nm SystemStarter
62 Startup Item.
63 .Pp
64 At some point in the future, we hope to completely phase out the use of
65 .Nm rc .
66 .Sh FILES
67 .Bl -tag -width "/System/Library/LaunchDaemons" -compact
68 .It Pa ~/Library/LaunchAgents
69 Per-user agents provided by the user.
70 .It Pa /Library/LaunchAgents
71 Per-user agents provided by the administrator.
72 .It Pa /Library/LaunchDaemons
73 System wide daemons provided by the administrator.
74 .It Pa /System/Library/LaunchAgents
75 Mac OS X Per-user agents.
76 .It Pa /System/Library/LaunchDaemons
77 Mac OS X System wide daemons.
78 .El
79 .Sh SEE ALSO
80 .Xr launchctl 1 ,
81 .Xr launchd.plist 5 ,
82 .Xr rc 8 ,
83 .Xr SystemStarter 8