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