]> git.saurik.com Git - apple/launchd.git/blob - launchd/src/launchd.8
launchd-106.10.tar.gz
[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 v
11 .Op Fl s
12 .Op Fl x
13 .Op Ar -- command Op Ar args ...
14 .Sh DESCRIPTION
15 .Nm
16 manages daemons, both for the system as a whole and for individual users. Ideal daemons can launch
17 on demand based on criteria specified in their respective XML property lists located in one of the
18 directories specified in the FILES section.
19 .Pp
20 When run with a command, a specific instance of
21 .Nm
22 is created and the command is implicitly added to the list of jobs maintained by
23 .Nm .
24 If the command exits, that instance of
25 .Nm
26 will clean up all jobs maintained by itself and exit. All children of the command will use that
27 instance of
28 .Nm .
29 .Pp
30 During boot
31 .Nm
32 is invoked by the kernel to run as the first process on the system and to further bootstrap the rest of the system.
33 .Sh OPTIONS WHEN RUN AS PID 1
34 .Bl -tag -width -indent
35 .It Fl d
36 Daemonize. Useful when passing a command to launchd on the command line.
37 .It Fl v
38 Verbose boot.
39 .It Fl s
40 Single user mode. Instructs
41 .Nm launchd
42 to give a shell prompt before booting the system.
43 .It Fl x
44 Safe mode boot. Instructs the system to boot conservatively.
45 .El
46 .Sh ENVIRONMENTAL VARIABLES
47 .Bl -tag -width -indent
48 .It Pa LAUNCHD_SOCKET
49 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.
50 .El
51 .Sh NOTES
52 In Darwin it is preferable to have your daemon launch via launchd instead of modifying
53 .Nm rc
54 or creating a
55 .Nm SystemStarter
56 Startup Item.
57 .Pp
58 At some point in the future, we hope to completely phase out the use of
59 .Nm rc .
60 .Sh FILES
61 .Bl -tag -width "/System/Library/LaunchDaemons" -compact
62 .It Pa ~/Library/LaunchAgents
63 Per-user agents provided by the user.
64 .It Pa /Library/LaunchAgents
65 Per-user agents provided by the administrator.
66 .It Pa /Library/LaunchDaemons
67 System wide daemons provided by the administrator.
68 .It Pa /System/Library/LaunchAgents
69 Mac OS X Per-user agents.
70 .It Pa /System/Library/LaunchDaemons
71 Mac OS X System wide daemons.
72 .El
73 .Sh SEE ALSO
74 .Xr launchctl 1 ,
75 .Xr launchd.plist 5 ,
76 .Xr rc 8 ,
77 .Xr SystemStarter 8