]> git.saurik.com Git - apple/launchd.git/blob - launchd/src/launchctl.1
604979283f92f46448c8e09a5d808c258a5f543c
[apple/launchd.git] / launchd / src / launchctl.1
1 .Dd September 30, 2004
2 .Dt launchctl 1
3 .Os Darwin
4 .Sh NAME
5 .Nm launchctl
6 .Nd Interfaces with launchd
7 .Sh SYNOPSIS
8 .Nm
9 .Op Ar subcommand Op Ar arguments ...
10 .Sh DESCRIPTION
11 .Nm
12 interfaces with
13 .Nm launchd
14 to load, unload daemons/agents and generally control
15 .Nm launchd .
16 .Nm
17 supports taking subcommands on the command line, interactively or even redirected from standard input.
18 These commands can be stored in
19 .Nm $HOME/.launchd.conf
20 or
21 .Nm /etc/launchd.conf
22 to be read at the time
23 .Nm launchd
24 starts.
25 .Sh SUBCOMMANDS
26 .Bl -tag -width -indent
27 .It Xo Ar load Op Fl w
28 .Ar paths ...
29 .Xc
30 Load the specified configuration files or directories of configuration files.
31 .Bl -tag -width -indent
32 .It Fl w
33 Remove the disabled key and write the configuration files back out to disk.
34 .El
35 .It Xo Ar unload Op Fl w
36 .Ar paths ...
37 .Xc
38 Unload the specified configuration files or directories of configuration files.
39 .Bl -tag -width -indent
40 .It Fl w
41 Add the disabled key and write the configuration files back out to disk.
42 .El
43 .It Ar start Ar joblabels ...
44 Start the specified jobs by label.
45 .It Ar stop Ar joblabels ...
46 Stop the specified jobs by label. Jobs may restart automatically if demand driven.
47 .It Ar list
48 List all of the jobs loaded into
49 .Nm launchd .
50 .It Ar setenv Ar key Ar value
51 Set an environmental variable inside of
52 .Nm launchd .
53 .It Ar unsetenv Ar key
54 Unset an environmental variable inside of
55 .Nm launchd .
56 .It Ar getenv Ar key
57 Get an environmental variable inside of
58 .Nm launchd .
59 .It Ar export
60 Export all of the environmental variables of
61 .Nm launchd
62 for use in a shell eval statement.
63 .It Ar getrusage self | children
64 Get the resource utilization statistics for
65 .Nm launchd
66 or the children of
67 .Nm launchd .
68 .It Xo Ar log
69 .Op Ar level loglevel
70 .Op Ar only | mask loglevels...
71 .Xc
72 Get and set the
73 .Xr syslog 3
74 log level mask. The available log levels are: debug, info, notice, warning, error, critical, alert and emergency.
75 .It Xo Ar limit
76 .Op Ar cpu | filesize | data | stack | core | rss | memlock | maxproc | maxfiles
77 .Op Ar both Op Ar soft | hard
78 .Xc
79 With no arguments, this command prints all the resource limits of
80 .Nm launchd
81 as found via
82 .Xr getrlimit 2 .
83 When a given resource is specified, it prints the limits for that resource.
84 With a third argument, it sets both the hard and soft limits to that value.
85 With four arguments, the third and forth argument represent the soft and hard limits respectively.
86 See
87 .Xr setrlimit 2 .
88 .It Ar stdout path
89 Set the standard out file descriptor to the given path.
90 .Nm launchd
91 .It Ar stderr path
92 Set the standard error file descriptor to the given path.
93 .Nm launchd
94 .It Ar shutdown
95 Tell
96 .Nm launchd
97 to prepare for shutdown by removing all jobs.
98 .It Ar reloadttys
99 Tell
100 .Nm launchd
101 to reread /etc/ttys. This option may go away in a future release.
102 .It Ar umask Op Ar newmask
103 Get or optionally set the
104 .Xr umask 2
105 of
106 .Nm launchd .
107 .It Ar help
108 Print out a quick usage statement.
109 .El
110 .Sh FILES
111 .Bl -tag -width "/System/Library/LaunchDaemons" -compact
112 .It Pa ~/Library/LaunchAgents
113 Per-user agents provided by the user.
114 .It Pa /Library/LaunchAgents
115 Per-user agents provided by the administrator.
116 .It Pa /Library/LaunchDaemons
117 System wide daemons provided by the administrator.
118 .It Pa /System/Library/LaunchAgents
119 Mac OS X Per-user agents.
120 .It Pa /System/Library/LaunchDaemons
121 Mac OS X System wide daemons.
122 .El
123 .Sh SEE ALSO
124 .Xr launchd.plist 5 ,
125 .Xr launchd.conf 5 ,
126 .Xr launchd 8