]>
Commit | Line | Data |
---|---|---|
3802a3d3 | 1 | <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*--> |
7874bcd6 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
681eb9cf FB |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ |
4 | <!ENTITY % entities SYSTEM "custom-entities.ent" > | |
5 | %entities; | |
6 | ]> | |
7874bcd6 LP |
7 | |
8 | <!-- | |
b975b0d5 | 9 | This file is part of systemd. |
7874bcd6 | 10 | |
b975b0d5 | 11 | Copyright 2010 Lennart Poettering |
7874bcd6 | 12 | |
b975b0d5 ZJS |
13 | systemd is free software; you can redistribute it and/or modify it |
14 | under the terms of the GNU Lesser General Public License as published by | |
15 | the Free Software Foundation; either version 2.1 of the License, or | |
16 | (at your option) any later version. | |
7874bcd6 | 17 | |
b975b0d5 ZJS |
18 | systemd is distributed in the hope that it will be useful, but |
19 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
21 | Lesser General Public License for more details. | |
7874bcd6 | 22 | |
b975b0d5 ZJS |
23 | You should have received a copy of the GNU Lesser General Public License |
24 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
7874bcd6 LP |
25 | --> |
26 | ||
21ac6ff1 ZJS |
27 | <refentry id="systemctl" |
28 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
7874bcd6 | 29 | |
4a6022f0 ZJS |
30 | <refentryinfo> |
31 | <title>systemctl</title> | |
32 | <productname>systemd</productname> | |
33 | ||
34 | <authorgroup> | |
35 | <author> | |
36 | <contrib>Developer</contrib> | |
37 | <firstname>Lennart</firstname> | |
38 | <surname>Poettering</surname> | |
39 | <email>lennart@poettering.net</email> | |
40 | </author> | |
41 | </authorgroup> | |
42 | </refentryinfo> | |
43 | ||
44 | <refmeta> | |
45 | <refentrytitle>systemctl</refentrytitle> | |
46 | <manvolnum>1</manvolnum> | |
47 | </refmeta> | |
48 | ||
49 | <refnamediv> | |
50 | <refname>systemctl</refname> | |
51 | <refpurpose>Control the systemd system and service manager</refpurpose> | |
52 | </refnamediv> | |
53 | ||
54 | <refsynopsisdiv> | |
55 | <cmdsynopsis> | |
56 | <command>systemctl</command> | |
57 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
58 | <arg choice="plain">COMMAND</arg> | |
59 | <arg choice="opt" rep="repeat">NAME</arg> | |
60 | </cmdsynopsis> | |
61 | </refsynopsisdiv> | |
62 | ||
63 | <refsect1> | |
64 | <title>Description</title> | |
65 | ||
a4390b6b LP |
66 | <para><command>systemctl</command> may be used to introspect and |
67 | control the state of the <literal>systemd</literal> system and | |
68 | service manager. Please refer to | |
4a6022f0 | 69 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
a4390b6b LP |
70 | for an introduction into the basic concepts and functionality this |
71 | tool manages.</para> | |
4a6022f0 ZJS |
72 | </refsect1> |
73 | ||
74 | <refsect1> | |
75 | <title>Options</title> | |
76 | ||
77 | <para>The following options are understood:</para> | |
78 | ||
79 | <variablelist> | |
4a6022f0 ZJS |
80 | <varlistentry> |
81 | <term><option>-t</option></term> | |
82 | <term><option>--type=</option></term> | |
83 | ||
84 | <listitem> | |
e9dd9f95 | 85 | <para>The argument should be a comma-separated list of unit |
20b3f379 | 86 | types such as <option>service</option> and |
9b9b3d36 MW |
87 | <option>socket</option>. |
88 | </para> | |
20b3f379 ZJS |
89 | |
90 | <para>If one of the arguments is a unit type, when listing | |
7b870f60 | 91 | units, limit display to certain unit types. Otherwise, units |
4a6022f0 ZJS |
92 | of all types will be shown.</para> |
93 | ||
20b3f379 | 94 | <para>As a special case, if one of the arguments is |
4a6022f0 ZJS |
95 | <option>help</option>, a list of allowed values will be |
96 | printed and the program will exit.</para> | |
97 | </listitem> | |
98 | </varlistentry> | |
99 | ||
9b9b3d36 MW |
100 | <varlistentry> |
101 | <term><option>--state=</option></term> | |
102 | ||
103 | <listitem> | |
e16972e6 ZJS |
104 | <para>The argument should be a comma-separated list of unit |
105 | LOAD, SUB, or ACTIVE states. When listing units, show only | |
a8eaaee7 | 106 | those in the specified states. Use <option>--state=failed</option> |
e16972e6 ZJS |
107 | to show only failed units.</para> |
108 | ||
109 | <para>As a special case, if one of the arguments is | |
110 | <option>help</option>, a list of allowed values will be | |
111 | printed and the program will exit.</para> | |
9b9b3d36 MW |
112 | </listitem> |
113 | </varlistentry> | |
114 | ||
4a6022f0 ZJS |
115 | <varlistentry> |
116 | <term><option>-p</option></term> | |
117 | <term><option>--property=</option></term> | |
118 | ||
119 | <listitem> | |
54c31a79 | 120 | <para>When showing unit/job/manager properties with the |
ea539eb6 ZJS |
121 | <command>show</command> command, limit display to properties |
122 | specified in the argument. The argument should be a | |
d2bbca68 | 123 | comma-separated list of property names, such as |
ea539eb6 ZJS |
124 | <literal>MainPID</literal>. Unless specified, all known |
125 | properties are shown. If specified more than once, all | |
126 | properties with the specified names are shown. Shell | |
127 | completion is implemented for property names.</para> | |
128 | ||
129 | <para>For the manager itself, | |
130 | <command>systemctl show</command> will show all available | |
131 | properties. Those properties are documented in | |
132 | <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
133 | </para> | |
134 | ||
135 | <para>Properties for units vary by unit type, so showing any | |
136 | unit (even a non-existent one) is a way to list properties | |
b938cb90 | 137 | pertaining to this type. Similarly, showing any job will list |
ea539eb6 ZJS |
138 | properties pertaining to all jobs. Properties for units are |
139 | documented in | |
140 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
141 | and the pages for individual unit types | |
142 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
143 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
144 | etc.</para> | |
4a6022f0 ZJS |
145 | </listitem> |
146 | </varlistentry> | |
147 | ||
148 | <varlistentry> | |
149 | <term><option>-a</option></term> | |
150 | <term><option>--all</option></term> | |
151 | ||
152 | <listitem> | |
a5e4972c LP |
153 | <para>When listing units, show all loaded units, regardless |
154 | of their state, including inactive units. When showing | |
4a6022f0 ZJS |
155 | unit/job/manager properties, show all properties regardless |
156 | whether they are set or not.</para> | |
a5e4972c LP |
157 | <para>To list all units installed on the system, use the |
158 | <command>list-unit-files</command> command instead.</para> | |
4a6022f0 ZJS |
159 | </listitem> |
160 | </varlistentry> | |
161 | ||
1238ee09 LP |
162 | <varlistentry> |
163 | <term><option>-r</option></term> | |
164 | <term><option>--recursive</option></term> | |
165 | ||
166 | <listitem> | |
167 | <para>When listing units, also show units of local | |
168 | containers. Units of local containers will be prefixed with | |
169 | the container name, separated by a single colon character | |
170 | (<literal>:</literal>).</para> | |
171 | </listitem> | |
172 | </varlistentry> | |
173 | ||
afba4199 ZJS |
174 | <varlistentry> |
175 | <term><option>--reverse</option></term> | |
176 | ||
177 | <listitem> | |
178 | <para>Show reverse dependencies between units with | |
f6375e83 ZJS |
179 | <command>list-dependencies</command>, i.e. follow |
180 | dependencies of type <varname>WantedBy=</varname>, | |
181 | <varname>RequiredBy=</varname>, | |
ff9b60f3 | 182 | <varname>RequiredByOverridable=</varname>, |
f6375e83 ZJS |
183 | <varname>PartOf=</varname>, <varname>BoundBy=</varname>, |
184 | instead of <varname>Wants=</varname> and similar. | |
afba4199 ZJS |
185 | </para> |
186 | </listitem> | |
187 | </varlistentry> | |
188 | ||
189 | <varlistentry> | |
190 | <term><option>--after</option></term> | |
9029f642 JSJ |
191 | |
192 | <listitem> | |
193 | <para>With <command>list-dependencies</command>, show the | |
194 | units that are ordered before the specified unit. In other | |
f6375e83 ZJS |
195 | words, recursively list units following the |
196 | <varname>After=</varname> dependency.</para> | |
197 | ||
198 | <para>Note that any <varname>After=</varname> dependency is | |
199 | automatically mirrored to create a | |
200 | <varname>Before=</varname> dependency. Temporal dependencies | |
922d948b | 201 | may be specified explicitly, but are also created implicitly |
f6375e83 ZJS |
202 | for units which are <varname>WantedBy=</varname> targets |
203 | (see | |
204 | <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>), | |
205 | and as a result of other directives (for example | |
206 | <varname>RequiresMountsFor=</varname>). Both explicitly | |
207 | and implicitly introduced dependencies are shown with | |
208 | <command>list-dependencies</command>.</para> | |
9029f642 JSJ |
209 | </listitem> |
210 | </varlistentry> | |
211 | ||
212 | <varlistentry> | |
afba4199 ZJS |
213 | <term><option>--before</option></term> |
214 | ||
215 | <listitem> | |
9029f642 JSJ |
216 | <para>With <command>list-dependencies</command>, show the |
217 | units that are ordered after the specified unit. In other | |
f6375e83 ZJS |
218 | words, recursively list units following the |
219 | <varname>Before=</varname> dependency.</para> | |
afba4199 ZJS |
220 | </listitem> |
221 | </varlistentry> | |
222 | ||
4a6022f0 | 223 | <varlistentry> |
98a6e132 | 224 | <term><option>-l</option></term> |
4a6022f0 ZJS |
225 | <term><option>--full</option></term> |
226 | ||
227 | <listitem> | |
69d918b0 ZJS |
228 | <para>Do not ellipsize unit names, process tree entries, |
229 | journal output, or truncate unit descriptions in the output | |
230 | of <command>status</command>, <command>list-units</command>, | |
231 | <command>list-jobs</command>, and | |
232 | <command>list-timers</command>.</para> | |
4a6022f0 ZJS |
233 | </listitem> |
234 | </varlistentry> | |
235 | ||
991f2a39 ZJS |
236 | <varlistentry> |
237 | <term><option>--show-types</option></term> | |
238 | ||
239 | <listitem> | |
240 | <para>When showing sockets, show the type of the socket.</para> | |
241 | </listitem> | |
242 | </varlistentry> | |
243 | ||
23ade460 | 244 | <varlistentry> |
4dc5b821 | 245 | <term><option>--job-mode=</option></term> |
23ade460 MS |
246 | |
247 | <listitem> | |
e0e009c0 JE |
248 | <para>When queuing a new job, this option controls how to deal with |
249 | already queued jobs. It takes one of <literal>fail</literal>, | |
4dc5b821 LP |
250 | <literal>replace</literal>, |
251 | <literal>replace-irreversibly</literal>, | |
252 | <literal>isolate</literal>, | |
253 | <literal>ignore-dependencies</literal>, | |
254 | <literal>ignore-requirements</literal> or | |
255 | <literal>flush</literal>. Defaults to | |
256 | <literal>replace</literal>, except when the | |
257 | <command>isolate</command> command is used which implies the | |
258 | <literal>isolate</literal> job mode.</para> | |
259 | ||
260 | <para>If <literal>fail</literal> is specified and a requested | |
261 | operation conflicts with a pending job (more specifically: | |
262 | causes an already pending start job to be reversed into a stop | |
263 | job or vice versa), cause the operation to fail.</para> | |
264 | ||
265 | <para>If <literal>replace</literal> (the default) is | |
266 | specified, any conflicting pending job will be replaced, as | |
267 | necessary.</para> | |
268 | ||
269 | <para>If <literal>replace-irreversibly</literal> is specified, | |
270 | operate like <literal>replace</literal>, but also mark the new | |
271 | jobs as irreversible. This prevents future conflicting | |
9a92e77e DS |
272 | transactions from replacing these jobs (or even being enqueued |
273 | while the irreversible jobs are still pending). Irreversible | |
274 | jobs can still be cancelled using the <command>cancel</command> | |
275 | command.</para> | |
4dc5b821 LP |
276 | |
277 | <para><literal>isolate</literal> is only valid for start | |
278 | operations and causes all other units to be stopped when the | |
279 | specified unit is started. This mode is always used when the | |
280 | <command>isolate</command> command is used.</para> | |
281 | ||
282 | <para><literal>flush</literal> will cause all queued jobs to | |
283 | be canceled when the new job is enqueued.</para> | |
284 | ||
285 | <para>If <literal>ignore-dependencies</literal> is specified, | |
286 | then all unit dependencies are ignored for this new job and | |
287 | the operation is executed immediately. If passed, no required | |
288 | units of the unit passed will be pulled in, and no ordering | |
289 | dependencies will be honored. This is mostly a debugging and | |
290 | rescue tool for the administrator and should not be used by | |
291 | applications.</para> | |
292 | ||
293 | <para><literal>ignore-requirements</literal> is similar to | |
b040723e | 294 | <literal>ignore-dependencies</literal>, but only causes the |
4dc5b821 LP |
295 | requirement dependencies to be ignored, the ordering |
296 | dependencies will still be honoured.</para> | |
23ade460 | 297 | </listitem> |
4a6022f0 | 298 | |
4a6022f0 ZJS |
299 | </varlistentry> |
300 | ||
ac5e3a50 JS |
301 | <varlistentry> |
302 | <term><option>--fail</option></term> | |
303 | ||
304 | <listitem> | |
305 | <para>Shorthand for <option>--job-mode=</option>fail.</para> | |
306 | <para>When used with the <command>kill</command> command, | |
307 | if no units were killed, the operation results in an error. | |
308 | </para> | |
309 | </listitem> | |
310 | </varlistentry> | |
311 | ||
4a6022f0 ZJS |
312 | <varlistentry> |
313 | <term><option>-i</option></term> | |
314 | <term><option>--ignore-inhibitors</option></term> | |
315 | ||
316 | <listitem> | |
317 | <para>When system shutdown or a sleep state is requested, | |
318 | ignore inhibitor locks. Applications can establish inhibitor | |
319 | locks to avoid that certain important operations (such as CD | |
320 | burning or suchlike) are interrupted by system shutdown or a | |
321 | sleep state. Any user may take these locks and privileged | |
322 | users may override these locks. If any locks are taken, | |
323 | shutdown and sleep state requests will normally fail | |
494a6682 | 324 | (regardless of whether privileged or not) and a list of active locks |
7b870f60 JE |
325 | is printed. However, if <option>--ignore-inhibitors</option> |
326 | is specified, the locks are ignored and not printed, and the | |
4a6022f0 ZJS |
327 | operation attempted anyway, possibly requiring additional |
328 | privileges.</para> | |
329 | </listitem> | |
330 | </varlistentry> | |
331 | ||
332 | <varlistentry> | |
333 | <term><option>-q</option></term> | |
334 | <term><option>--quiet</option></term> | |
335 | ||
336 | <listitem> | |
bbd46aad ZJS |
337 | <para>Suppress printing of the results of various commands |
338 | and also the hints about truncated log lines. This does not | |
339 | suppress output of commands for which the printed output is | |
340 | the only result (like <command>show</command>). Errors are | |
341 | always printed.</para> | |
4a6022f0 ZJS |
342 | </listitem> |
343 | </varlistentry> | |
344 | ||
345 | <varlistentry> | |
346 | <term><option>--no-block</option></term> | |
347 | ||
348 | <listitem> | |
349 | <para>Do not synchronously wait for the requested operation | |
7b870f60 | 350 | to finish. If this is not specified, the job will be |
4a6022f0 | 351 | verified, enqueued and <command>systemctl</command> will |
3d161f99 LP |
352 | wait until the unit's start-up is completed. By passing this |
353 | argument, it is only verified and enqueued.</para> | |
4a6022f0 ZJS |
354 | </listitem> |
355 | </varlistentry> | |
356 | ||
88ae7333 ZJS |
357 | <xi:include href="user-system-options.xml" xpointer="user" /> |
358 | <xi:include href="user-system-options.xml" xpointer="system" /> | |
4a6022f0 | 359 | |
036359ba LP |
360 | <!-- we do not document -failed here, as it has been made |
361 | redundant by -state=failed, which it predates. To keep | |
b938cb90 | 362 | things simple, we only document the new switch, while |
036359ba | 363 | keeping the old one around for compatibility only. --> |
599b6322 | 364 | |
4a6022f0 ZJS |
365 | <varlistentry> |
366 | <term><option>--no-wall</option></term> | |
367 | ||
368 | <listitem> | |
7b870f60 | 369 | <para>Do not send wall message before halt, power-off, |
4a6022f0 ZJS |
370 | reboot.</para> |
371 | </listitem> | |
372 | </varlistentry> | |
373 | ||
374 | <varlistentry> | |
375 | <term><option>--global</option></term> | |
376 | ||
377 | <listitem> | |
378 | <para>When used with <command>enable</command> and | |
379 | <command>disable</command>, operate on the global user | |
380 | configuration directory, thus enabling or disabling a unit | |
381 | file globally for all future logins of all users.</para> | |
382 | </listitem> | |
383 | </varlistentry> | |
384 | ||
385 | <varlistentry> | |
386 | <term><option>--no-reload</option></term> | |
387 | ||
388 | <listitem> | |
389 | <para>When used with <command>enable</command> and | |
390 | <command>disable</command>, do not implicitly reload daemon | |
391 | configuration after executing the changes.</para> | |
392 | </listitem> | |
393 | </varlistentry> | |
394 | ||
395 | <varlistentry> | |
396 | <term><option>--no-ask-password</option></term> | |
397 | ||
398 | <listitem> | |
399 | <para>When used with <command>start</command> and related | |
400 | commands, disables asking for passwords. Background services | |
401 | may require input of a password or passphrase string, for | |
402 | example to unlock system hard disks or cryptographic | |
403 | certificates. Unless this option is specified and the | |
7b870f60 | 404 | command is invoked from a terminal, |
4a6022f0 ZJS |
405 | <command>systemctl</command> will query the user on the |
406 | terminal for the necessary secrets. Use this option to | |
7b870f60 | 407 | switch this behavior off. In this case, the password must be |
4a6022f0 ZJS |
408 | supplied by some other means (for example graphical password |
409 | agents) or the service might fail. This also disables | |
410 | querying the user for authentication for privileged | |
411 | operations.</para> | |
412 | </listitem> | |
4a6022f0 ZJS |
413 | </varlistentry> |
414 | ||
415 | <varlistentry> | |
416 | <term><option>--kill-who=</option></term> | |
417 | ||
418 | <listitem> | |
419 | <para>When used with <command>kill</command>, choose which | |
af7424af LP |
420 | processes to send a signal to. Must be one of |
421 | <option>main</option>, <option>control</option> or | |
422 | <option>all</option> to select whether to kill only the main | |
423 | process, the control process or all processes of the | |
424 | unit. The main process of the unit is the one that defines | |
425 | the life-time of it. A control process of a unit is one that | |
426 | is invoked by the manager to induce state changes of it. For | |
427 | example, all processes started due to the | |
428 | <varname>ExecStartPre=</varname>, | |
429 | <varname>ExecStop=</varname> or | |
430 | <varname>ExecReload=</varname> settings of service units are | |
431 | control processes. Note that there is only one control | |
432 | process per unit at a time, as only one state change is | |
433 | executed at a time. For services of type | |
b8bde116 | 434 | <varname>Type=forking</varname>, the initial process started |
af7424af LP |
435 | by the manager for <varname>ExecStart=</varname> is a |
436 | control process, while the process ultimately forked off by | |
437 | that one is then considered the main process of the unit (if | |
438 | it can be determined). This is different for service units | |
439 | of other types, where the process forked off by the manager | |
440 | for <varname>ExecStart=</varname> is always the main process | |
b8bde116 JE |
441 | itself. A service unit consists of zero or one main process, |
442 | zero or one control process plus any number of additional | |
af7424af | 443 | processes. Not all unit types manage processes of these |
b8bde116 | 444 | types however. For example, for mount units, control processes |
af7424af | 445 | are defined (which are the invocations of |
d31dd62b FB |
446 | <filename>&MOUNT_PATH;</filename> and |
447 | <filename>&UMOUNT_PATH;</filename>), but no main process | |
af7424af LP |
448 | is defined. If omitted, defaults to |
449 | <option>all</option>.</para> | |
4a6022f0 ZJS |
450 | </listitem> |
451 | ||
452 | </varlistentry> | |
453 | ||
454 | <varlistentry> | |
455 | <term><option>-s</option></term> | |
456 | <term><option>--signal=</option></term> | |
457 | ||
458 | <listitem> | |
459 | <para>When used with <command>kill</command>, choose which | |
460 | signal to send to selected processes. Must be one of the | |
b938cb90 | 461 | well-known signal specifiers such as <constant>SIGTERM</constant>, <constant>SIGINT</constant> or |
7b870f60 | 462 | <constant>SIGSTOP</constant>. If omitted, defaults to |
4a6022f0 ZJS |
463 | <option>SIGTERM</option>.</para> |
464 | </listitem> | |
465 | </varlistentry> | |
466 | ||
467 | <varlistentry> | |
468 | <term><option>-f</option></term> | |
469 | <term><option>--force</option></term> | |
470 | ||
471 | <listitem> | |
472 | <para>When used with <command>enable</command>, overwrite | |
473 | any existing conflicting symlinks.</para> | |
474 | ||
475 | <para>When used with <command>halt</command>, | |
476 | <command>poweroff</command>, <command>reboot</command> or | |
7b870f60 | 477 | <command>kexec</command>, execute the selected operation |
4a6022f0 ZJS |
478 | without shutting down all units. However, all processes will |
479 | be killed forcibly and all file systems are unmounted or | |
480 | remounted read-only. This is hence a drastic but relatively | |
481 | safe option to request an immediate reboot. If | |
482 | <option>--force</option> is specified twice for these | |
483 | operations, they will be executed immediately without | |
1e89266b | 484 | terminating any processes or unmounting any file |
4a6022f0 ZJS |
485 | systems. Warning: specifying <option>--force</option> twice |
486 | with any of these operations might result in data | |
487 | loss.</para> | |
488 | </listitem> | |
489 | </varlistentry> | |
490 | ||
9ef15026 JS |
491 | <varlistentry> |
492 | <term><option>--message=</option></term> | |
493 | ||
494 | <listitem> | |
495 | <para>When used with <command>halt</command>, | |
496 | <command>poweroff</command>, <command>reboot</command> or | |
497 | <command>kexec</command>, set a short message explaining the reason | |
498 | for the operation. The message will be logged together with the | |
499 | default shutdown message.</para> | |
500 | </listitem> | |
501 | </varlistentry> | |
502 | ||
57ab2eab JS |
503 | <varlistentry> |
504 | <term><option>--now</option></term> | |
505 | ||
506 | <listitem> | |
507 | <para>When used with <command>enable</command>, the units | |
508 | will also be started. When used with <command>disable</command> or | |
509 | <command>mask</command>, the units will also be stopped. The start | |
510 | or stop operation is only carried out when the respective enable or | |
511 | disable operation has been successful.</para> | |
512 | </listitem> | |
513 | </varlistentry> | |
514 | ||
4a6022f0 ZJS |
515 | <varlistentry> |
516 | <term><option>--root=</option></term> | |
517 | ||
518 | <listitem> | |
519 | <para>When used with | |
520 | <command>enable</command>/<command>disable</command>/<command>is-enabled</command> | |
a8eaaee7 | 521 | (and related commands), use an alternate root path when |
4a6022f0 ZJS |
522 | looking for unit files.</para> |
523 | </listitem> | |
524 | ||
525 | </varlistentry> | |
526 | ||
527 | <varlistentry> | |
528 | <term><option>--runtime</option></term> | |
529 | ||
530 | <listitem> | |
a330b376 | 531 | <para>When used with <command>enable</command>, |
7d4fb3b1 | 532 | <command>disable</command>, <command>edit</command>, |
4a6022f0 | 533 | (and related commands), make changes only temporarily, so |
a330b376 | 534 | that they are lost on the next reboot. This will have the |
4a6022f0 ZJS |
535 | effect that changes are not made in subdirectories of |
536 | <filename>/etc</filename> but in <filename>/run</filename>, | |
537 | with identical immediate effects, however, since the latter | |
538 | is lost on reboot, the changes are lost too.</para> | |
a330b376 | 539 | |
494a6682 | 540 | <para>Similarly, when used with |
fbce1139 | 541 | <command>set-property</command>, make changes only |
a330b376 LP |
542 | temporarily, so that they are lost on the next |
543 | reboot.</para> | |
4a6022f0 ZJS |
544 | </listitem> |
545 | </varlistentry> | |
546 | ||
d309c1c3 LP |
547 | <varlistentry> |
548 | <term><option>--preset-mode=</option></term> | |
549 | ||
550 | <listitem> | |
551 | <para>Takes one of <literal>full</literal> (the default), | |
552 | <literal>enable-only</literal>, | |
8d0e0ddd | 553 | <literal>disable-only</literal>. When used with the |
d309c1c3 | 554 | <command>preset</command> or <command>preset-all</command> |
8d0e0ddd | 555 | commands, controls whether units shall be disabled and |
d309c1c3 LP |
556 | enabled according to the preset rules, or only enabled, or |
557 | only disabled.</para> | |
558 | </listitem> | |
559 | </varlistentry> | |
560 | ||
4a6022f0 ZJS |
561 | <varlistentry> |
562 | <term><option>-n</option></term> | |
563 | <term><option>--lines=</option></term> | |
564 | ||
565 | <listitem> | |
7b870f60 | 566 | <para>When used with <command>status</command>, controls the |
4a6022f0 ZJS |
567 | number of journal lines to show, counting from the most |
568 | recent ones. Takes a positive integer argument. Defaults to | |
569 | 10.</para> | |
570 | </listitem> | |
571 | </varlistentry> | |
572 | ||
573 | <varlistentry> | |
574 | <term><option>-o</option></term> | |
575 | <term><option>--output=</option></term> | |
576 | ||
577 | <listitem> | |
7b870f60 | 578 | <para>When used with <command>status</command>, controls the |
4a6022f0 | 579 | formatting of the journal entries that are shown. For the |
7b870f60 | 580 | available choices, see |
4a6022f0 ZJS |
581 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. |
582 | Defaults to <literal>short</literal>.</para> | |
583 | </listitem> | |
584 | </varlistentry> | |
585 | ||
5bdf2243 JJ |
586 | <varlistentry> |
587 | <term><option>--firmware-setup</option></term> | |
588 | ||
589 | <listitem> | |
590 | <para>When used with the <command>reboot</command> command, | |
591 | indicate to the system's firmware to boot into setup | |
592 | mode. Note that this is currently only supported on some EFI | |
593 | systems and only if the system was booted in EFI | |
594 | mode.</para> | |
595 | </listitem> | |
596 | </varlistentry> | |
597 | ||
5d0c05e5 LN |
598 | <varlistentry> |
599 | <term><option>--plain</option></term> | |
600 | ||
601 | <listitem> | |
7b870f60 | 602 | <para>When used with <command>list-dependencies</command>, |
a20e43c0 MT |
603 | <command>list-units</command> or <command>list-machines</command>, the |
604 | the output is printed as a list instead of a tree, and the bullet | |
605 | circles are omitted.</para> | |
5d0c05e5 LN |
606 | </listitem> |
607 | </varlistentry> | |
608 | ||
4f50d2ef ZJS |
609 | <xi:include href="user-system-options.xml" xpointer="host" /> |
610 | <xi:include href="user-system-options.xml" xpointer="machine" /> | |
611 | ||
12f15e59 ZJS |
612 | <xi:include href="standard-options.xml" xpointer="no-pager" /> |
613 | <xi:include href="standard-options.xml" xpointer="no-legend" /> | |
dfdebb1b ZJS |
614 | <xi:include href="standard-options.xml" xpointer="help" /> |
615 | <xi:include href="standard-options.xml" xpointer="version" /> | |
4a6022f0 ZJS |
616 | </variablelist> |
617 | </refsect1> | |
618 | ||
619 | <refsect1> | |
620 | <title>Commands</title> | |
621 | ||
622 | <para>The following commands are understood:</para> | |
623 | ||
27722f96 LN |
624 | <refsect2> |
625 | <title>Unit Commands</title> | |
4a6022f0 | 626 | |
27722f96 LN |
627 | <variablelist> |
628 | <varlistentry> | |
4f8f66cb | 629 | <term><command>list-units <optional><replaceable>PATTERN</replaceable>...</optional></command></term> |
4a6022f0 | 630 | |
27722f96 LN |
631 | <listitem> |
632 | <para>List known units (subject to limitations specified | |
d8fba7c6 ZJS |
633 | with <option>-t</option>). If one or more |
634 | <replaceable>PATTERN</replaceable>s are specified, only | |
635 | units matching one of them are shown.</para> | |
991f2a39 | 636 | |
27722f96 LN |
637 | <para>This is the default command.</para> |
638 | </listitem> | |
639 | </varlistentry> | |
991f2a39 | 640 | |
27722f96 | 641 | <varlistentry> |
4f8f66cb | 642 | <term><command>list-sockets <optional><replaceable>PATTERN</replaceable>...</optional></command></term> |
27722f96 LN |
643 | |
644 | <listitem> | |
e0e009c0 | 645 | <para>List socket units ordered by listening address. |
d8fba7c6 ZJS |
646 | If one or more <replaceable>PATTERN</replaceable>s are |
647 | specified, only socket units matching one of them are | |
648 | shown. Produces output similar to | |
27722f96 | 649 | <programlisting> |
991f2a39 ZJS |
650 | LISTEN UNIT ACTIVATES |
651 | /dev/initctl systemd-initctl.socket systemd-initctl.service | |
652 | ... | |
653 | [::]:22 sshd.socket sshd.service | |
654 | kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service | |
655 | ||
9fccdb0f | 656 | 5 sockets listed.</programlisting> |
27722f96 LN |
657 | Note: because the addresses might contains spaces, this output |
658 | is not suitable for programmatic consumption. | |
659 | </para> | |
660 | ||
661 | <para>See also the options <option>--show-types</option>, | |
ed80170d | 662 | <option>--all</option>, and <option>--state=</option>.</para> |
27722f96 LN |
663 | </listitem> |
664 | </varlistentry> | |
665 | ||
cbb76c29 | 666 | <varlistentry> |
4f8f66cb | 667 | <term><command>list-timers <optional><replaceable>PATTERN</replaceable>...</optional></command></term> |
cbb76c29 LP |
668 | |
669 | <listitem> | |
d8fba7c6 ZJS |
670 | <para>List timer units ordered by the time they elapse |
671 | next. If one or more <replaceable>PATTERN</replaceable>s | |
672 | are specified, only units matching one of them are shown. | |
673 | </para> | |
cbb76c29 LP |
674 | |
675 | <para>See also the options <option>--all</option> and | |
ed80170d | 676 | <option>--state=</option>.</para> |
cbb76c29 LP |
677 | </listitem> |
678 | </varlistentry> | |
679 | ||
27722f96 | 680 | <varlistentry> |
e3e0314b | 681 | <term><command>start <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
682 | |
683 | <listitem> | |
684 | <para>Start (activate) one or more units specified on the | |
685 | command line.</para> | |
e3e0314b ZJS |
686 | |
687 | <para>Note that glob patterns operate on a list of currently | |
688 | loaded units. Units which are not active and are not in a | |
689 | failed state usually are not loaded, and would not be | |
690 | matched by any pattern. In addition, in case of | |
691 | instantiated units, systemd is often unaware of the | |
73e231ab | 692 | instance name until the instance has been started. Therefore, |
e3e0314b ZJS |
693 | using glob patterns with <command>start</command> |
694 | has limited usefulness.</para> | |
27722f96 LN |
695 | </listitem> |
696 | </varlistentry> | |
697 | <varlistentry> | |
e3e0314b | 698 | <term><command>stop <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
699 | |
700 | <listitem> | |
701 | <para>Stop (deactivate) one or more units specified on the | |
702 | command line.</para> | |
703 | </listitem> | |
704 | </varlistentry> | |
705 | <varlistentry> | |
e3e0314b | 706 | <term><command>reload <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
707 | |
708 | <listitem> | |
709 | <para>Asks all units listed on the command line to reload | |
710 | their configuration. Note that this will reload the | |
711 | service-specific configuration, not the unit configuration | |
712 | file of systemd. If you want systemd to reload the | |
79640424 | 713 | configuration file of a unit, use the |
27722f96 LN |
714 | <command>daemon-reload</command> command. In other words: |
715 | for the example case of Apache, this will reload Apache's | |
716 | <filename>httpd.conf</filename> in the web server, not the | |
717 | <filename>apache.service</filename> systemd unit | |
718 | file.</para> | |
719 | ||
720 | <para>This command should not be confused with the | |
d0a3fb75 | 721 | <command>daemon-reload</command> command.</para> |
27722f96 LN |
722 | </listitem> |
723 | ||
724 | </varlistentry> | |
725 | <varlistentry> | |
e3e0314b | 726 | <term><command>restart <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
727 | |
728 | <listitem> | |
729 | <para>Restart one or more units specified on the command | |
730 | line. If the units are not running yet, they will be | |
731 | started.</para> | |
732 | </listitem> | |
733 | </varlistentry> | |
734 | <varlistentry> | |
e3e0314b | 735 | <term><command>try-restart <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
736 | |
737 | <listitem> | |
738 | <para>Restart one or more units specified on the command | |
739 | line if the units are running. This does nothing if units are not | |
740 | running. Note that, for compatibility with Red Hat init | |
741 | scripts, <command>condrestart</command> is equivalent to this | |
742 | command.</para> | |
743 | </listitem> | |
744 | </varlistentry> | |
745 | <varlistentry> | |
e3e0314b | 746 | <term><command>reload-or-restart <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
747 | |
748 | <listitem> | |
749 | <para>Reload one or more units if they support it. If not, | |
750 | restart them instead. If the units are not running yet, they | |
751 | will be started.</para> | |
752 | </listitem> | |
753 | </varlistentry> | |
754 | <varlistentry> | |
e3e0314b | 755 | <term><command>reload-or-try-restart <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
756 | |
757 | <listitem> | |
758 | <para>Reload one or more units if they support it. If not, | |
759 | restart them instead. This does nothing if the units are not | |
760 | running. Note that, for compatibility with SysV init scripts, | |
761 | <command>force-reload</command> is equivalent to this | |
762 | command.</para> | |
763 | </listitem> | |
764 | </varlistentry> | |
765 | <varlistentry> | |
766 | <term><command>isolate <replaceable>NAME</replaceable></command></term> | |
767 | ||
768 | <listitem> | |
769 | <para>Start the unit specified on the command line and its | |
507e28d8 CA |
770 | dependencies and stop all others. If a unit name with no |
771 | extension is given, an extension of | |
772 | <literal>.target</literal> will be assumed.</para> | |
27722f96 LN |
773 | |
774 | <para>This is similar to changing the runlevel in a | |
775 | traditional init system. The <command>isolate</command> | |
776 | command will immediately stop processes that are not enabled | |
777 | in the new unit, possibly including the graphical | |
778 | environment or terminal you are currently using.</para> | |
779 | ||
780 | <para>Note that this is allowed only on units where | |
781 | <option>AllowIsolate=</option> is enabled. See | |
782 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
783 | for details.</para> | |
784 | </listitem> | |
785 | </varlistentry> | |
786 | <varlistentry> | |
e3e0314b | 787 | <term><command>kill <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
788 | |
789 | <listitem> | |
790 | <para>Send a signal to one or more processes of the | |
791 | unit. Use <option>--kill-who=</option> to select which | |
0088d631 LP |
792 | process to kill. Use <option>--signal=</option> to select |
793 | the signal to send.</para> | |
27722f96 LN |
794 | </listitem> |
795 | </varlistentry> | |
796 | <varlistentry> | |
e3e0314b | 797 | <term><command>is-active <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
798 | |
799 | <listitem> | |
800 | <para>Check whether any of the specified units are active | |
6db27428 ZJS |
801 | (i.e. running). Returns an exit code |
802 | <constant>0</constant> if at least one is active, or | |
803 | non-zero otherwise. Unless <option>--quiet</option> is | |
804 | specified, this will also print the current unit state to | |
805 | standard output.</para> | |
27722f96 LN |
806 | </listitem> |
807 | </varlistentry> | |
808 | <varlistentry> | |
e3e0314b | 809 | <term><command>is-failed <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 LN |
810 | |
811 | <listitem> | |
6db27428 ZJS |
812 | <para>Check whether any of the specified units are in a |
813 | "failed" state. Returns an exit code | |
814 | <constant>0</constant> if at least one has failed, | |
815 | non-zero otherwise. Unless <option>--quiet</option> is | |
816 | specified, this will also print the current unit state to | |
817 | standard output.</para> | |
27722f96 LN |
818 | </listitem> |
819 | </varlistentry> | |
820 | <varlistentry> | |
e3e0314b | 821 | <term><command>status</command> <optional><replaceable>PATTERN</replaceable>...|<replaceable>PID</replaceable>...]</optional></term> |
27722f96 LN |
822 | |
823 | <listitem> | |
824 | <para>Show terse runtime status information about one or | |
825 | more units, followed by most recent log data from the | |
8fcf784d | 826 | journal. If no units are specified, show system status. If |
b8bde116 | 827 | combined with <option>--all</option>, also show the status of |
8fcf784d LP |
828 | all units (subject to limitations specified with |
829 | <option>-t</option>). If a PID is passed, show information | |
830 | about the unit the process belongs to.</para> | |
27722f96 LN |
831 | |
832 | <para>This function is intended to generate human-readable | |
e213d1a3 | 833 | output. If you are looking for computer-parsable output, |
b938cb90 | 834 | use <command>show</command> instead. By default, this |
e213d1a3 ZJS |
835 | function only shows 10 lines of output and ellipsizes |
836 | lines to fit in the terminal window. This can be changes | |
837 | with <option>--lines</option> and <option>--full</option>, | |
838 | see above. In addition, <command>journalctl | |
839 | --unit=<replaceable>NAME</replaceable></command> or | |
840 | <command>journalctl | |
841 | --user-unit=<replaceable>NAME</replaceable></command> use | |
842 | a similar filter for messages and might be more | |
843 | convenient. | |
844 | </para> | |
27722f96 LN |
845 | </listitem> |
846 | </varlistentry> | |
847 | <varlistentry> | |
e3e0314b | 848 | <term><command>show</command> <optional><replaceable>PATTERN</replaceable>...|<replaceable>JOB</replaceable>...</optional></term> |
27722f96 LN |
849 | |
850 | <listitem> | |
851 | <para>Show properties of one or more units, jobs, or the | |
79640424 JE |
852 | manager itself. If no argument is specified, properties of |
853 | the manager will be shown. If a unit name is specified, | |
a8eaaee7 | 854 | properties of the unit is shown, and if a job ID is |
79640424 | 855 | specified, properties of the job is shown. By default, empty |
27722f96 | 856 | properties are suppressed. Use <option>--all</option> to |
79640424 | 857 | show those too. To select specific properties to show, use |
27722f96 LN |
858 | <option>--property=</option>. This command is intended to be |
859 | used whenever computer-parsable output is required. Use | |
860 | <command>status</command> if you are looking for formatted | |
861 | human-readable output.</para> | |
862 | </listitem> | |
863 | </varlistentry> | |
e93c33d4 | 864 | <varlistentry> |
e3e0314b | 865 | <term><command>cat <replaceable>PATTERN</replaceable>...</command></term> |
27722f96 | 866 | |
e93c33d4 | 867 | <listitem> |
e4c0fbe5 ZJS |
868 | <para>Show backing files of one or more units. Prints the |
869 | "fragment" and "drop-ins" (source files) of units. Each | |
870 | file is preceded by a comment which includes the file | |
871 | name.</para> | |
e93c33d4 SL |
872 | </listitem> |
873 | </varlistentry> | |
27722f96 LN |
874 | <varlistentry> |
875 | <term><command>set-property <replaceable>NAME</replaceable> <replaceable>ASSIGNMENT</replaceable>...</command></term> | |
876 | ||
877 | <listitem> | |
878 | <para>Set the specified unit properties at runtime where | |
879 | this is supported. This allows changing configuration | |
3fde5f30 | 880 | parameter properties such as resource control settings at |
27722f96 | 881 | runtime. Not all properties may be changed at runtime, but |
3fde5f30 LP |
882 | many resource control settings (primarily those in |
883 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>) | |
27722f96 LN |
884 | may. The changes are applied instantly, and stored on disk |
885 | for future boots, unless <option>--runtime</option> is | |
3fde5f30 LP |
886 | passed, in which case the settings only apply until the |
887 | next reboot. The syntax of the property assignment follows | |
27722f96 LN |
888 | closely the syntax of assignments in unit files.</para> |
889 | ||
890 | <para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para> | |
891 | ||
892 | <para>Note that this command allows changing multiple | |
893 | properties at the same time, which is preferable over | |
894 | setting them individually. Like unit file configuration | |
895 | settings, assigning the empty list to list parameters will | |
896 | reset the list.</para> | |
897 | </listitem> | |
898 | </varlistentry> | |
899 | ||
900 | <varlistentry> | |
e3e0314b | 901 | <term><command>help <replaceable>PATTERN</replaceable>...|<replaceable>PID</replaceable>...</command></term> |
27722f96 LN |
902 | |
903 | <listitem> | |
904 | <para>Show manual pages for one or more units, if | |
905 | available. If a PID is given, the manual pages for the unit | |
906 | the process belongs to are shown.</para> | |
907 | </listitem> | |
908 | </varlistentry> | |
909 | ||
910 | <varlistentry> | |
e3e0314b | 911 | <term><command>reset-failed [<replaceable>PATTERN</replaceable>...]</command></term> |
27722f96 LN |
912 | |
913 | <listitem> | |
914 | <para>Reset the <literal>failed</literal> state of the | |
915 | specified units, or if no unit name is passed, reset the state of all | |
916 | units. When a unit fails in some way (i.e. process exiting | |
917 | with non-zero error code, terminating abnormally or timing | |
918 | out), it will automatically enter the | |
919 | <literal>failed</literal> state and its exit code and status | |
920 | is recorded for introspection by the administrator until the | |
921 | service is restarted or reset with this command.</para> | |
922 | </listitem> | |
923 | </varlistentry> | |
924 | ||
925 | <varlistentry> | |
f6375e83 ZJS |
926 | <term> |
927 | <command>list-dependencies</command> | |
928 | <optional><replaceable>NAME</replaceable></optional> | |
929 | </term> | |
27722f96 LN |
930 | |
931 | <listitem> | |
f6375e83 ZJS |
932 | <para>Shows units required and wanted by the specified |
933 | unit. This recursively lists units following the | |
934 | <varname>Requires=</varname>, | |
935 | <varname>RequiresOverridable=</varname>, | |
936 | <varname>Requisite=</varname>, | |
937 | <varname>RequisiteOverridable=</varname>, | |
fb30c438 | 938 | <varname>ConsistsOf=</varname>, |
f6375e83 ZJS |
939 | <varname>Wants=</varname>, <varname>BindsTo=</varname> |
940 | dependencies. If no unit is specified, | |
941 | <filename>default.target</filename> is implied.</para> | |
942 | ||
943 | <para>By default, only target units are recursively | |
944 | expanded. When <option>--all</option> is passed, all other | |
945 | units are recursively expanded as well.</para> | |
946 | ||
947 | <para>Options <option>--reverse</option>, | |
948 | <option>--after</option>, <option>--before</option> | |
949 | may be used to change what types of dependencies | |
950 | are shown.</para> | |
27722f96 LN |
951 | </listitem> |
952 | </varlistentry> | |
953 | </variablelist> | |
954 | </refsect2> | |
955 | ||
956 | <refsect2> | |
957 | <title>Unit File Commands</title> | |
958 | ||
959 | <variablelist> | |
960 | <varlistentry> | |
d8fba7c6 | 961 | <term><command>list-unit-files <optional><replaceable>PATTERN...</replaceable></optional></command></term> |
27722f96 LN |
962 | |
963 | <listitem> | |
d8fba7c6 ZJS |
964 | <para>List installed unit files. If one or more |
965 | <replaceable>PATTERN</replaceable>s are specified, only | |
966 | units whose filename (just the last component of the path) | |
967 | matches one of them are shown.</para> | |
27722f96 LN |
968 | </listitem> |
969 | </varlistentry> | |
970 | ||
971 | <varlistentry> | |
972 | <term><command>enable <replaceable>NAME</replaceable>...</command></term> | |
973 | ||
974 | <listitem> | |
975 | <para>Enable one or more unit files or unit file instances, | |
976 | as specified on the command line. This will create a number | |
977 | of symlinks as encoded in the <literal>[Install]</literal> | |
978 | sections of the unit files. After the symlinks have been | |
979 | created, the systemd configuration is reloaded (in a way that | |
980 | is equivalent to <command>daemon-reload</command>) to ensure | |
981 | the changes are taken into account immediately. Note that | |
982 | this does <emphasis>not</emphasis> have the effect of also | |
983 | starting any of the units being enabled. If this | |
57ab2eab JS |
984 | is desired, either <option>--now</option> should be used |
985 | together with this command, or an additional <command>start</command> | |
b938cb90 | 986 | command must be invoked for the unit. Also note that, in case of |
57ab2eab JS |
987 | instance enablement, symlinks named the same as instances |
988 | are created in the install location, however they all point to the | |
989 | same template unit file.</para> | |
27722f96 LN |
990 | |
991 | <para>This command will print the actions executed. This | |
992 | output may be suppressed by passing <option>--quiet</option>. | |
993 | </para> | |
994 | ||
995 | <para>Note that this operation creates only the suggested | |
996 | symlinks for the units. While this command is the | |
997 | recommended way to manipulate the unit configuration | |
998 | directory, the administrator is free to make additional | |
999 | changes manually by placing or removing symlinks in the | |
1000 | directory. This is particularly useful to create | |
1001 | configurations that deviate from the suggested default | |
1002 | installation. In this case, the administrator must make sure | |
1003 | to invoke <command>daemon-reload</command> manually as | |
1004 | necessary to ensure the changes are taken into account. | |
1005 | </para> | |
1006 | ||
1007 | <para>Enabling units should not be confused with starting | |
1008 | (activating) units, as done by the <command>start</command> | |
1009 | command. Enabling and starting units is orthogonal: units | |
1010 | may be enabled without being started and started without | |
1011 | being enabled. Enabling simply hooks the unit into various | |
1012 | suggested places (for example, so that the unit is | |
1013 | automatically started on boot or when a particular kind of | |
1014 | hardware is plugged in). Starting actually spawns the daemon | |
1015 | process (in case of service units), or binds the socket (in | |
1016 | case of socket units), and so on.</para> | |
1017 | ||
1018 | <para>Depending on whether <option>--system</option>, | |
1bee43de | 1019 | <option>--user</option>, <option>--runtime</option>, |
72f4d966 | 1020 | or <option>--global</option> is specified, this enables the unit |
1bee43de ZJS |
1021 | for the system, for the calling user only, for only this boot of |
1022 | the system, or for all future logins of all users, or only this | |
1023 | boot. Note that in the last case, no systemd daemon | |
27722f96 | 1024 | configuration is reloaded.</para> |
751ea8de JS |
1025 | |
1026 | <para>Using <command>enable</command> on masked units | |
1027 | results in an error.</para> | |
27722f96 LN |
1028 | </listitem> |
1029 | </varlistentry> | |
1030 | ||
1031 | <varlistentry> | |
1032 | <term><command>disable <replaceable>NAME</replaceable>...</command></term> | |
1033 | ||
1034 | <listitem> | |
1035 | <para>Disables one or more units. This removes all symlinks | |
1036 | to the specified unit files from the unit configuration | |
1037 | directory, and hence undoes the changes made by | |
1038 | <command>enable</command>. Note however that this removes | |
1039 | all symlinks to the unit files (i.e. including manual | |
1040 | additions), not just those actually created by | |
1041 | <command>enable</command>. This call implicitly reloads the | |
1042 | systemd daemon configuration after completing the disabling | |
1043 | of the units. Note that this command does not implicitly | |
57ab2eab JS |
1044 | stop the units that are being disabled. If this is desired, either |
1045 | <option>--now</option> should be used together with this command, or | |
1046 | an additional <command>stop</command> command should be executed | |
1047 | afterwards.</para> | |
27722f96 LN |
1048 | |
1049 | <para>This command will print the actions executed. This | |
1050 | output may be suppressed by passing <option>--quiet</option>. | |
1051 | </para> | |
1052 | ||
1053 | <para>This command honors <option>--system</option>, | |
72f4d966 | 1054 | <option>--user</option>, <option>--runtime</option> and |
1bee43de ZJS |
1055 | <option>--global</option> in a similar way as |
1056 | <command>enable</command>.</para> | |
27722f96 LN |
1057 | </listitem> |
1058 | </varlistentry> | |
1059 | ||
b619ec8f LP |
1060 | <varlistentry> |
1061 | <term><command>reenable <replaceable>NAME</replaceable>...</command></term> | |
1062 | ||
1063 | <listitem> | |
1064 | <para>Reenable one or more unit files, as specified on the | |
1065 | command line. This is a combination of | |
1066 | <command>disable</command> and <command>enable</command> and | |
1067 | is useful to reset the symlinks a unit is enabled with to | |
1068 | the defaults configured in the <literal>[Install]</literal> | |
1069 | section of the unit file.</para> | |
1070 | </listitem> | |
1071 | </varlistentry> | |
1072 | ||
1073 | <varlistentry> | |
1074 | <term><command>preset <replaceable>NAME</replaceable>...</command></term> | |
1075 | ||
1076 | <listitem> | |
1077 | <para>Reset one or more unit files, as specified on the | |
1078 | command line, to the defaults configured in the preset | |
1079 | policy files. This has the same effect as | |
1080 | <command>disable</command> or <command>enable</command>, | |
1081 | depending how the unit is listed in the preset files.</para> | |
1082 | ||
1083 | <para>Use <option>--preset-mode=</option> to control | |
1084 | whether units shall be enabled and disabled, or only | |
1085 | enabled, or only disabled.</para> | |
1086 | ||
1087 | <para>For more information on the preset policy format, | |
1088 | see | |
1089 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
1090 | For more information on the concept of presets, please | |
1091 | consult the <ulink | |
1092 | url="http://freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink> | |
1093 | document.</para> | |
1094 | </listitem> | |
1095 | </varlistentry> | |
1096 | ||
1097 | <varlistentry> | |
1098 | <term><command>preset-all</command></term> | |
1099 | ||
1100 | <listitem> | |
1101 | <para>Resets all installed unit files to the defaults | |
1102 | configured in the preset policy file (see above).</para> | |
1103 | ||
1104 | <para>Use <option>--preset-mode=</option> to control | |
1105 | whether units shall be enabled and disabled, or only | |
1106 | enabled, or only disabled.</para> | |
1107 | </listitem> | |
1108 | </varlistentry> | |
1109 | ||
27722f96 LN |
1110 | <varlistentry> |
1111 | <term><command>is-enabled <replaceable>NAME</replaceable>...</command></term> | |
1112 | ||
1113 | <listitem> | |
1114 | <para>Checks whether any of the specified unit files are | |
171754aa ZJS |
1115 | enabled (as with <command>enable</command>). Returns an |
1116 | exit code of 0 if at least one is enabled, non-zero | |
1117 | otherwise. Prints the current enable status (see table). | |
1118 | To suppress this output, use <option>--quiet</option>. | |
1119 | </para> | |
1120 | ||
1121 | <table> | |
1122 | <title> | |
1123 | <command>is-enabled</command> output | |
1124 | </title> | |
1125 | ||
1126 | <tgroup cols='3'> | |
1127 | <thead> | |
1128 | <row> | |
94f099d8 LP |
1129 | <entry>Name</entry> |
1130 | <entry>Description</entry> | |
1131 | <entry>Exit Code</entry> | |
171754aa ZJS |
1132 | </row> |
1133 | </thead> | |
1134 | <tbody> | |
1135 | <row> | |
1136 | <entry><literal>enabled</literal></entry> | |
39f76ad8 | 1137 | <entry morerows='1'>Enabled through a symlink in <filename>.wants</filename> directory (permanently or just in <filename>/run</filename>).</entry> |
171754aa ZJS |
1138 | <entry morerows='1'>0</entry> |
1139 | </row> | |
1140 | <row> | |
1141 | <entry><literal>enabled-runtime</literal></entry> | |
1142 | </row> | |
1143 | <row> | |
1144 | <entry><literal>linked</literal></entry> | |
39f76ad8 | 1145 | <entry morerows='1'>Made available through a symlink to the unit file (permanently or just in <filename>/run</filename>).</entry> |
94f099d8 | 1146 | <entry morerows='1'>> 0</entry> |
171754aa ZJS |
1147 | </row> |
1148 | <row> | |
1149 | <entry><literal>linked-runtime</literal></entry> | |
1150 | </row> | |
1151 | <row> | |
1152 | <entry><literal>masked</literal></entry> | |
39f76ad8 | 1153 | <entry morerows='1'>Disabled entirely (permanently or just in <filename>/run</filename>).</entry> |
94f099d8 | 1154 | <entry morerows='1'>> 0</entry> |
171754aa ZJS |
1155 | </row> |
1156 | <row> | |
1157 | <entry><literal>masked-runtime</literal></entry> | |
1158 | </row> | |
1159 | <row> | |
1160 | <entry><literal>static</literal></entry> | |
a8eaaee7 | 1161 | <entry>The unit file is not enabled, and has no provisions for enabling in the <literal>[Install]</literal> section.</entry> |
91f0ac7d | 1162 | <entry>0</entry> |
171754aa | 1163 | </row> |
aedd4012 JS |
1164 | <row> |
1165 | <entry><literal>indirect</literal></entry> | |
a8eaaee7 | 1166 | <entry>The unit file itself is not enabled, but it has a non-empty <varname>Also=</varname> setting in the <literal>[Install]</literal> section, listing other unit files that might be enabled.</entry> |
aedd4012 JS |
1167 | <entry>0</entry> |
1168 | </row> | |
171754aa ZJS |
1169 | <row> |
1170 | <entry><literal>disabled</literal></entry> | |
a8eaaee7 | 1171 | <entry>The unit file is not enabled.</entry> |
94f099d8 | 1172 | <entry>> 0</entry> |
171754aa ZJS |
1173 | </row> |
1174 | </tbody> | |
1175 | </tgroup> | |
1176 | </table> | |
1177 | ||
27722f96 LN |
1178 | </listitem> |
1179 | </varlistentry> | |
1180 | ||
27722f96 LN |
1181 | <varlistentry> |
1182 | <term><command>mask <replaceable>NAME</replaceable>...</command></term> | |
1183 | ||
1184 | <listitem> | |
1185 | <para>Mask one or more unit files, as specified on the | |
1186 | command line. This will link these units to | |
1187 | <filename>/dev/null</filename>, making it impossible to | |
1188 | start them. This is a stronger version of | |
1189 | <command>disable</command>, since it prohibits all kinds of | |
751ea8de JS |
1190 | activation of the unit, including enablement and manual |
1191 | activation. Use this option with care. This honors the | |
72f4d966 | 1192 | <option>--runtime</option> option to only mask temporarily |
57ab2eab JS |
1193 | until the next reboot of the system. The <option>--now</option> |
1194 | option can be used to ensure that the units are also stopped.</para> | |
27722f96 LN |
1195 | </listitem> |
1196 | </varlistentry> | |
1197 | ||
1198 | <varlistentry> | |
1199 | <term><command>unmask <replaceable>NAME</replaceable>...</command></term> | |
1200 | ||
1201 | <listitem> | |
1202 | <para>Unmask one or more unit files, as specified on the | |
1203 | command line. This will undo the effect of | |
1204 | <command>mask</command>.</para> | |
1205 | </listitem> | |
1206 | </varlistentry> | |
1207 | ||
1208 | <varlistentry> | |
1209 | <term><command>link <replaceable>FILENAME</replaceable>...</command></term> | |
1210 | ||
1211 | <listitem> | |
1212 | <para>Link a unit file that is not in the unit file search | |
1213 | paths into the unit file search path. This requires an | |
1214 | absolute path to a unit file. The effect of this can be | |
1215 | undone with <command>disable</command>. The effect of this | |
1216 | command is that a unit file is available for | |
1217 | <command>start</command> and other commands although it | |
1218 | is not installed directly in the unit search path.</para> | |
1219 | </listitem> | |
1220 | </varlistentry> | |
1221 | ||
1222 | <varlistentry> | |
b619ec8f LP |
1223 | <term><command>add-wants <replaceable>TARGET</replaceable> |
1224 | <replaceable>NAME</replaceable>...</command></term> | |
1225 | <term><command>add-requires <replaceable>TARGET</replaceable> | |
1226 | <replaceable>NAME</replaceable>...</command></term> | |
27722f96 LN |
1227 | |
1228 | <listitem> | |
853382da | 1229 | <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal> |
a8eaaee7 | 1230 | dependencies, respectively, to the specified |
853382da | 1231 | <replaceable>TARGET</replaceable> for one or more units. </para> |
27722f96 | 1232 | |
b619ec8f LP |
1233 | <para>This command honors <option>--system</option>, |
1234 | <option>--user</option>, <option>--runtime</option> and | |
a8eaaee7 | 1235 | <option>--global</option> in a way similar to |
b619ec8f | 1236 | <command>enable</command>.</para> |
27722f96 | 1237 | |
27722f96 LN |
1238 | </listitem> |
1239 | </varlistentry> | |
7d4fb3b1 RC |
1240 | |
1241 | <varlistentry> | |
1242 | <term><command>edit <replaceable>NAME</replaceable>...</command></term> | |
1243 | ||
1244 | <listitem> | |
1245 | <para>Edit a drop-in snippet or a whole replacement file if | |
1246 | <option>--full</option> is specified, to extend or override the | |
1247 | specified unit.</para> | |
1248 | ||
1249 | <para>Depending on whether <option>--system</option> (the default), | |
1250 | <option>--user</option>, or <option>--global</option> is specified, | |
a8eaaee7 | 1251 | this command creates a drop-in file for each unit either for the system, |
b938cb90 | 1252 | for the calling user, or for all futures logins of all users. Then, |
7d4fb3b1 RC |
1253 | the editor (see the "Environment" section below) is invoked on |
1254 | temporary files which will be written to the real location if the | |
1255 | editor exits successfully.</para> | |
1256 | ||
1257 | <para>If <option>--full</option> is specified, this will copy the | |
1258 | original units instead of creating drop-in files.</para> | |
1259 | ||
1260 | <para>If <option>--runtime</option> is specified, the changes will | |
1261 | be made temporarily in <filename>/run</filename> and they will be | |
1262 | lost on the next reboot.</para> | |
1263 | ||
b938cb90 JE |
1264 | <para>If the temporary file is empty upon exit, the modification of |
1265 | the related unit is canceled.</para> | |
7d4fb3b1 RC |
1266 | |
1267 | <para>After the units have been edited, systemd configuration is | |
1268 | reloaded (in a way that is equivalent to <command>daemon-reload</command>). | |
1269 | </para> | |
1270 | ||
1271 | <para>Note that this command cannot be used to remotely edit units | |
1272 | and that you cannot temporarily edit units which are in | |
b938cb90 | 1273 | <filename>/etc</filename>, since they take precedence over |
7d4fb3b1 RC |
1274 | <filename>/run</filename>.</para> |
1275 | </listitem> | |
1276 | </varlistentry> | |
b619ec8f LP |
1277 | |
1278 | <varlistentry> | |
1279 | <term><command>get-default</command></term> | |
1280 | ||
1281 | <listitem> | |
1282 | <para>Return the default target to boot into. This returns | |
1283 | the target unit name <filename>default.target</filename> | |
1284 | is aliased (symlinked) to.</para> | |
1285 | </listitem> | |
1286 | </varlistentry> | |
1287 | ||
1288 | <varlistentry> | |
1289 | <term><command>set-default <replaceable>NAME</replaceable></command></term> | |
1290 | ||
1291 | <listitem> | |
1292 | <para>Set the default target to boot into. This sets | |
1293 | (symlinks) the <filename>default.target</filename> alias | |
1294 | to the given target unit.</para> | |
1295 | </listitem> | |
1296 | </varlistentry> | |
1297 | ||
27722f96 LN |
1298 | </variablelist> |
1299 | </refsect2> | |
1300 | ||
0d292f5e LP |
1301 | <refsect2> |
1302 | <title>Machine Commands</title> | |
1303 | ||
1304 | <variablelist> | |
1305 | <varlistentry> | |
1306 | <term><command>list-machines <optional><replaceable>PATTERN</replaceable>...</optional></command></term> | |
1307 | ||
1308 | <listitem> | |
1309 | <para>List the host and all running local containers with | |
1310 | their state. If one or more | |
1311 | <replaceable>PATTERN</replaceable>s are specified, only | |
1312 | containers matching one of them are shown. | |
1313 | </para> | |
1314 | </listitem> | |
1315 | </varlistentry> | |
1316 | </variablelist> | |
1317 | </refsect2> | |
1318 | ||
27722f96 LN |
1319 | <refsect2> |
1320 | <title>Job Commands</title> | |
1321 | ||
1322 | <variablelist> | |
1323 | <varlistentry> | |
d8fba7c6 | 1324 | <term><command>list-jobs <optional><replaceable>PATTERN...</replaceable></optional></command></term> |
27722f96 LN |
1325 | |
1326 | <listitem> | |
d8fba7c6 ZJS |
1327 | <para>List jobs that are in progress. If one or more |
1328 | <replaceable>PATTERN</replaceable>s are specified, only | |
1329 | jobs for units matching one of them are shown.</para> | |
27722f96 LN |
1330 | </listitem> |
1331 | </varlistentry> | |
1332 | <varlistentry> | |
1333 | <term><command>cancel <replaceable>JOB</replaceable>...</command></term> | |
1334 | ||
1335 | <listitem> | |
1336 | <para>Cancel one or more jobs specified on the command line | |
1337 | by their numeric job IDs. If no job ID is specified, cancel | |
1338 | all pending jobs.</para> | |
1339 | </listitem> | |
1340 | </varlistentry> | |
1341 | </variablelist> | |
27722f96 LN |
1342 | </refsect2> |
1343 | ||
1344 | <refsect2> | |
1345 | <title>Environment Commands</title> | |
1346 | ||
1347 | <variablelist> | |
1348 | <varlistentry> | |
1349 | <term><command>show-environment</command></term> | |
1350 | ||
1351 | <listitem> | |
1352 | <para>Dump the systemd manager environment block. The | |
1353 | environment block will be dumped in straight-forward form | |
1354 | suitable for sourcing into a shell script. This environment | |
1355 | block will be passed to all processes the manager | |
1356 | spawns.</para> | |
1357 | </listitem> | |
1358 | </varlistentry> | |
1359 | <varlistentry> | |
1360 | <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>...</command></term> | |
1361 | ||
1362 | <listitem> | |
1363 | <para>Set one or more systemd manager environment variables, | |
1364 | as specified on the command line.</para> | |
1365 | </listitem> | |
1366 | </varlistentry> | |
1367 | <varlistentry> | |
1368 | <term><command>unset-environment <replaceable>VARIABLE</replaceable>...</command></term> | |
1369 | ||
1370 | <listitem> | |
1371 | <para>Unset one or more systemd manager environment | |
1372 | variables. If only a variable name is specified, it will be | |
1373 | removed regardless of its value. If a variable and a value | |
1374 | are specified, the variable is only removed if it has the | |
1375 | specified value.</para> | |
1376 | </listitem> | |
ac3efa8a LP |
1377 | </varlistentry> |
1378 | <varlistentry> | |
3fb90db2 | 1379 | <term> |
b975b0d5 ZJS |
1380 | <command>import-environment</command> |
1381 | <optional><replaceable>VARIABLE...</replaceable></optional> | |
1382 | </term> | |
ac3efa8a LP |
1383 | |
1384 | <listitem> | |
1385 | <para>Import all, one or more environment variables set on | |
1386 | the client into the systemd manager environment block. If | |
73e231ab JE |
1387 | no arguments are passed, the entire environment block is |
1388 | imported. Otherwise, a list of one or more environment | |
1389 | variable names should be passed, whose client-side values | |
ac3efa8a LP |
1390 | are then imported into the manager's environment |
1391 | block.</para> | |
1392 | </listitem> | |
27722f96 LN |
1393 | </varlistentry> |
1394 | </variablelist> | |
1395 | </refsect2> | |
1396 | ||
1397 | <refsect2> | |
1398 | <title>Manager Lifecycle Commands</title> | |
1399 | ||
1400 | <variablelist> | |
1401 | <varlistentry> | |
1402 | <term><command>daemon-reload</command></term> | |
1403 | ||
1404 | <listitem> | |
a8eaaee7 | 1405 | <para>Reload the systemd manager configuration. This will |
432d5965 ZJS |
1406 | rerun all generators (see |
1407 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>), | |
1408 | reload all unit files, and recreate the entire dependency | |
1409 | tree. While the daemon is being reloaded, all sockets | |
1410 | systemd listens on behalf of user configuration will stay | |
1411 | accessible.</para> | |
1412 | ||
1413 | <para>This command should not be confused with the | |
1414 | <command>reload</command> command.</para> | |
27722f96 LN |
1415 | </listitem> |
1416 | </varlistentry> | |
1417 | <varlistentry> | |
1418 | <term><command>daemon-reexec</command></term> | |
1419 | ||
1420 | <listitem> | |
1421 | <para>Reexecute the systemd manager. This will serialize the | |
1422 | manager state, reexecute the process and deserialize the | |
1423 | state again. This command is of little use except for | |
79640424 | 1424 | debugging and package upgrades. Sometimes, it might be |
27722f96 | 1425 | helpful as a heavy-weight <command>daemon-reload</command>. |
79640424 | 1426 | While the daemon is being reexecuted, all sockets systemd listening |
27722f96 LN |
1427 | on behalf of user configuration will stay accessible. |
1428 | </para> | |
1429 | </listitem> | |
1430 | </varlistentry> | |
1431 | </variablelist> | |
1432 | </refsect2> | |
1433 | ||
1434 | <refsect2> | |
1435 | <title>System Commands</title> | |
1436 | ||
1437 | <variablelist> | |
99813a19 LP |
1438 | <varlistentry> |
1439 | <term><command>is-system-running</command></term> | |
1440 | ||
1441 | <listitem> | |
2de51fdc | 1442 | <para>Checks whether the system is operational. This |
94f099d8 LP |
1443 | returns success (exit code 0) when the system is fully up |
1444 | and running, specifically not in startup, shutdown or | |
1445 | maintenance mode, and with no failed services. Failure is | |
1446 | returned otherwise (exit code non-zero). In addition, the | |
2de51fdc | 1447 | current state is printed in a short string to standard |
a8eaaee7 | 1448 | output, see the table below. Use <option>--quiet</option> to |
2de51fdc ZJS |
1449 | suppress this output.</para> |
1450 | ||
1451 | <table> | |
94f099d8 LP |
1452 | <title><command>is-system-running</command> output</title> |
1453 | <tgroup cols='3'> | |
1454 | <colspec colname='name'/> | |
1455 | <colspec colname='description'/> | |
1456 | <colspec colname='exit-code'/> | |
2de51fdc ZJS |
1457 | <thead> |
1458 | <row> | |
1459 | <entry>Name</entry> | |
1460 | <entry>Description</entry> | |
94f099d8 | 1461 | <entry>Exit Code</entry> |
2de51fdc ZJS |
1462 | </row> |
1463 | </thead> | |
1464 | <tbody> | |
1465 | <row> | |
1466 | <entry><varname>initializing</varname></entry> | |
1467 | <entry><para>Early bootup, before | |
1fdfa094 LP |
1468 | <filename>basic.target</filename> is reached |
1469 | or the <varname>maintenance</varname> state entered. | |
2de51fdc | 1470 | </para></entry> |
94f099d8 | 1471 | <entry>> 0</entry> |
2de51fdc ZJS |
1472 | </row> |
1473 | <row> | |
1474 | <entry><varname>starting</varname></entry> | |
1fdfa094 LP |
1475 | <entry><para>Late bootup, before the job queue |
1476 | becomes idle for the first time, or one of the | |
1477 | rescue targets are reached.</para></entry> | |
94f099d8 | 1478 | <entry>> 0</entry> |
2de51fdc ZJS |
1479 | </row> |
1480 | <row> | |
1481 | <entry><varname>running</varname></entry> | |
1482 | <entry><para>The system is fully | |
1483 | operational.</para></entry> | |
94f099d8 | 1484 | <entry>0</entry> |
2de51fdc ZJS |
1485 | </row> |
1486 | <row> | |
1487 | <entry><varname>degraded</varname></entry> | |
1488 | <entry><para>The system is operational but one or more | |
1489 | units failed.</para></entry> | |
94f099d8 | 1490 | <entry>> 0</entry> |
2de51fdc ZJS |
1491 | </row> |
1492 | <row> | |
1493 | <entry><varname>maintenance</varname></entry> | |
1fdfa094 | 1494 | <entry><para>The rescue or emergency target is |
2de51fdc | 1495 | active.</para></entry> |
94f099d8 | 1496 | <entry>> 0</entry> |
2de51fdc ZJS |
1497 | </row> |
1498 | <row> | |
1499 | <entry><varname>stopping</varname></entry> | |
1500 | <entry><para>The manager is shutting | |
1501 | down.</para></entry> | |
94f099d8 LP |
1502 | <entry>> 0</entry> |
1503 | </row> | |
1504 | <row> | |
1505 | <entry><varname>offline</varname></entry> | |
1506 | <entry><para>The manager is not | |
1507 | running. Specifically, this is the operational | |
1508 | state if an incompatible program is running as | |
1509 | system manager (PID 1).</para></entry> | |
1510 | <entry>> 0</entry> | |
1511 | </row> | |
1512 | <row> | |
1513 | <entry><varname>unknown</varname></entry> | |
1514 | <entry><para>The operational state could not be | |
1515 | determined, due to lack of resources or another | |
1516 | error cause.</para></entry> | |
1517 | <entry>> 0</entry> | |
2de51fdc ZJS |
1518 | </row> |
1519 | </tbody> | |
1520 | </tgroup> | |
1521 | </table> | |
99813a19 LP |
1522 | </listitem> |
1523 | </varlistentry> | |
1524 | ||
27722f96 LN |
1525 | <varlistentry> |
1526 | <term><command>default</command></term> | |
1527 | ||
1528 | <listitem> | |
1529 | <para>Enter default mode. This is mostly equivalent to | |
1530 | <command>isolate default.target</command>.</para> | |
1531 | </listitem> | |
1532 | </varlistentry> | |
99813a19 | 1533 | |
27722f96 LN |
1534 | <varlistentry> |
1535 | <term><command>rescue</command></term> | |
1536 | ||
1537 | <listitem> | |
1538 | <para>Enter rescue mode. This is mostly equivalent to | |
1539 | <command>isolate rescue.target</command>, but also prints a | |
1540 | wall message to all users.</para> | |
1541 | </listitem> | |
1542 | </varlistentry> | |
1543 | <varlistentry> | |
1544 | <term><command>emergency</command></term> | |
1545 | ||
1546 | <listitem> | |
1547 | <para>Enter emergency mode. This is mostly equivalent to | |
1548 | <command>isolate emergency.target</command>, but also prints | |
1549 | a wall message to all users.</para> | |
1550 | </listitem> | |
1551 | </varlistentry> | |
1552 | <varlistentry> | |
1553 | <term><command>halt</command></term> | |
1554 | ||
1555 | <listitem> | |
1556 | <para>Shut down and halt the system. This is mostly equivalent to | |
903e7c37 | 1557 | <command>start halt.target --job-mode=replace-irreversibly</command>, but also |
27722f96 LN |
1558 | prints a wall message to all users. If combined with |
1559 | <option>--force</option>, shutdown of all running services is | |
1560 | skipped, however all processes are killed and all file | |
1561 | systems are unmounted or mounted read-only, immediately | |
1562 | followed by the system halt. If <option>--force</option> is | |
1563 | specified twice, the operation is immediately executed | |
1564 | without terminating any processes or unmounting any file | |
1565 | systems. This may result in data loss.</para> | |
1566 | </listitem> | |
1567 | </varlistentry> | |
1568 | <varlistentry> | |
1569 | <term><command>poweroff</command></term> | |
1570 | ||
1571 | <listitem> | |
1572 | <para>Shut down and power-off the system. This is mostly | |
903e7c37 | 1573 | equivalent to <command>start poweroff.target --job-mode=replace-irreversibly</command>, |
27722f96 LN |
1574 | but also prints a wall message to all users. If combined with |
1575 | <option>--force</option>, shutdown of all running services is | |
1576 | skipped, however all processes are killed and all file | |
1577 | systems are unmounted or mounted read-only, immediately | |
1578 | followed by the powering off. If <option>--force</option> is | |
1579 | specified twice, the operation is immediately executed | |
1580 | without terminating any processes or unmounting any file | |
1581 | systems. This may result in data loss.</para> | |
1582 | </listitem> | |
1583 | </varlistentry> | |
1584 | <varlistentry> | |
37185ec8 | 1585 | <term><command>reboot <optional><replaceable>arg</replaceable></optional></command></term> |
27722f96 LN |
1586 | |
1587 | <listitem> | |
1588 | <para>Shut down and reboot the system. This is mostly | |
903e7c37 | 1589 | equivalent to <command>start reboot.target --job-mode=replace-irreversibly</command>, |
27722f96 LN |
1590 | but also prints a wall message to all users. If combined with |
1591 | <option>--force</option>, shutdown of all running services is | |
1592 | skipped, however all processes are killed and all file | |
1593 | systems are unmounted or mounted read-only, immediately | |
1594 | followed by the reboot. If <option>--force</option> is | |
1595 | specified twice, the operation is immediately executed | |
1596 | without terminating any processes or unmounting any file | |
1597 | systems. This may result in data loss.</para> | |
37185ec8 WC |
1598 | |
1599 | <para>If the optional argument | |
1600 | <replaceable>arg</replaceable> is given, it will be passed | |
1601 | as the optional argument to the | |
1602 | <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> | |
1603 | system call. The value is architecture and firmware | |
1604 | specific. As an example, <literal>recovery</literal> might | |
1605 | be used to trigger system recovery, and | |
1606 | <literal>fota</literal> might be used to trigger a | |
1607 | <quote>firmware over the air</quote> update.</para> | |
27722f96 LN |
1608 | </listitem> |
1609 | </varlistentry> | |
b619ec8f | 1610 | |
27722f96 LN |
1611 | <varlistentry> |
1612 | <term><command>kexec</command></term> | |
1613 | ||
1614 | <listitem> | |
1615 | <para>Shut down and reboot the system via kexec. This is | |
903e7c37 | 1616 | mostly equivalent to <command>start kexec.target --job-mode=replace-irreversibly</command>, |
27722f96 LN |
1617 | but also prints a wall message to all users. If combined |
1618 | with <option>--force</option>, shutdown of all running | |
1619 | services is skipped, however all processes are killed and | |
1620 | all file systems are unmounted or mounted read-only, | |
1621 | immediately followed by the reboot.</para> | |
1622 | </listitem> | |
1623 | </varlistentry> | |
b619ec8f | 1624 | |
27722f96 | 1625 | <varlistentry> |
287419c1 | 1626 | <term><command>exit <optional><replaceable>EXIT_CODE</replaceable></optional></command></term> |
27722f96 LN |
1627 | |
1628 | <listitem> | |
1629 | <para>Ask the systemd manager to quit. This is only | |
1630 | supported for user service managers (i.e. in conjunction | |
287419c1 AC |
1631 | with the <option>--user</option> option) or in containers |
1632 | and is equivalent to <command>poweroff</command> otherwise.</para> | |
1633 | ||
1634 | <para>The systemd manager can exit with a non-zero exit | |
1635 | code if the optional argument | |
1636 | <replaceable>EXIT_CODE</replaceable> is given.</para> | |
27722f96 | 1637 | </listitem> |
b619ec8f | 1638 | </varlistentry> |
27722f96 | 1639 | |
b619ec8f LP |
1640 | <varlistentry> |
1641 | <term><command>switch-root <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></command></term> | |
1642 | ||
1643 | <listitem> | |
1644 | <para>Switches to a different root directory and executes a | |
1645 | new system manager process below it. This is intended for | |
1646 | usage in initial RAM disks ("initrd"), and will transition | |
b938cb90 | 1647 | from the initrd's system manager process (a.k.a. "init" |
b619ec8f LP |
1648 | process) to the main system manager process. This call takes two |
1649 | arguments: the directory that is to become the new root directory, and | |
1650 | the path to the new system manager binary below it to | |
1651 | execute as PID 1. If the latter is omitted or the empty | |
1652 | string, a systemd binary will automatically be searched for | |
1653 | and used as init. If the system manager path is omitted or | |
1654 | equal to the empty string, the state of the initrd's system | |
1655 | manager process is passed to the main system manager, which | |
1656 | allows later introspection of the state of the services | |
1657 | involved in the initrd boot.</para> | |
1658 | </listitem> | |
27722f96 | 1659 | </varlistentry> |
b619ec8f | 1660 | |
27722f96 LN |
1661 | <varlistentry> |
1662 | <term><command>suspend</command></term> | |
1663 | ||
1664 | <listitem> | |
1665 | <para>Suspend the system. This will trigger activation of | |
1666 | the special <filename>suspend.target</filename> target. | |
1667 | </para> | |
1668 | </listitem> | |
1669 | </varlistentry> | |
b619ec8f | 1670 | |
27722f96 LN |
1671 | <varlistentry> |
1672 | <term><command>hibernate</command></term> | |
1673 | ||
1674 | <listitem> | |
1675 | <para>Hibernate the system. This will trigger activation of | |
1676 | the special <filename>hibernate.target</filename> target. | |
1677 | </para> | |
1678 | </listitem> | |
1679 | </varlistentry> | |
b619ec8f | 1680 | |
27722f96 LN |
1681 | <varlistentry> |
1682 | <term><command>hybrid-sleep</command></term> | |
1683 | ||
1684 | <listitem> | |
1685 | <para>Hibernate and suspend the system. This will trigger | |
1686 | activation of the special | |
1687 | <filename>hybrid-sleep.target</filename> target.</para> | |
1688 | </listitem> | |
1689 | </varlistentry> | |
27722f96 LN |
1690 | </variablelist> |
1691 | </refsect2> | |
4a6022f0 | 1692 | |
a7c0e5d7 LP |
1693 | <refsect2> |
1694 | <title>Parameter Syntax</title> | |
1695 | ||
1e89266b | 1696 | <para>Unit commands listed above take either a single unit name |
e3e0314b ZJS |
1697 | (designated as <replaceable>NAME</replaceable>), or multiple |
1698 | unit specifications (designated as | |
1699 | <replaceable>PATTERN</replaceable>...). In the first case, the | |
1700 | unit name with or without a suffix must be given. If the suffix | |
1701 | is not specified, systemctl will append a suitable suffix, | |
1702 | <literal>.service</literal> by default, and a type-specific | |
1703 | suffix in case of commands which operate only on specific unit | |
1704 | types. For example, | |
1705 | <programlisting># systemctl start sshd</programlisting> and | |
1706 | <programlisting># systemctl start sshd.service</programlisting> | |
1707 | are equivalent, as are | |
507e28d8 | 1708 | <programlisting># systemctl isolate default</programlisting> |
e3e0314b | 1709 | and |
507e28d8 | 1710 | <programlisting># systemctl isolate default.target</programlisting> |
e3e0314b ZJS |
1711 | Note that (absolute) paths to device nodes are automatically |
1712 | converted to device unit names, and other (absolute) paths to | |
1713 | mount unit names. | |
1714 | <programlisting># systemctl status /dev/sda | |
1715 | # systemctl status /home</programlisting> | |
1716 | are equivalent to: | |
1717 | <programlisting># systemctl status dev-sda.device | |
1718 | # systemctl status home.mount</programlisting> | |
1719 | In the second case, shell-style globs will be matched against | |
73e231ab | 1720 | currently loaded units; literal unit names, with or without |
e3e0314b ZJS |
1721 | a suffix, will be treated as in the first case. This means that |
1722 | literal unit names always refer to exactly one unit, but globs | |
1723 | may match zero units and this is not considered an error.</para> | |
1724 | ||
1725 | <para>Glob patterns use | |
decde8cd | 1726 | <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>, |
e3e0314b ZJS |
1727 | so normal shell-style globbing rules are used, and |
1728 | <literal>*</literal>, <literal>?</literal>, | |
1729 | <literal>[]</literal> may be used. See | |
decde8cd | 1730 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
e3e0314b | 1731 | for more details. The patterns are matched against the names of |
66f756d4 | 1732 | currently loaded units, and patterns which do not match anything |
e3e0314b ZJS |
1733 | are silently skipped. For example: |
1734 | <programlisting># systemctl stop sshd@*.service</programlisting> | |
1735 | will stop all <filename>sshd@.service</filename> instances. | |
1736 | </para> | |
1737 | ||
1738 | <para>For unit file commands, the specified | |
1739 | <replaceable>NAME</replaceable> should be the full name of the | |
1740 | unit file, or the absolute path to the unit file: | |
1741 | <programlisting># systemctl enable foo.service</programlisting> | |
1742 | or | |
1743 | <programlisting># systemctl link /path/to/foo.service</programlisting> | |
1744 | </para> | |
a7c0e5d7 LP |
1745 | </refsect2> |
1746 | ||
4a6022f0 ZJS |
1747 | </refsect1> |
1748 | ||
1749 | <refsect1> | |
1750 | <title>Exit status</title> | |
1751 | ||
7b870f60 | 1752 | <para>On success, 0 is returned, a non-zero failure |
4a6022f0 ZJS |
1753 | code otherwise.</para> |
1754 | </refsect1> | |
1755 | ||
7d4fb3b1 RC |
1756 | <refsect1> |
1757 | <title>Environment</title> | |
1758 | ||
1759 | <variablelist class='environment-variables'> | |
1760 | <varlistentry> | |
1761 | <term><varname>$SYSTEMD_EDITOR</varname></term> | |
1762 | ||
1763 | <listitem><para>Editor to use when editing units; overrides | |
1764 | <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither | |
1765 | <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor | |
1766 | <varname>$VISUAL</varname> are present or if it is set to an empty | |
1767 | string or if their execution failed, systemctl will try to execute well | |
1768 | known editors in this order: | |
9391a1c3 | 1769 | <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
3ba3a79d ZJS |
1770 | <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
1771 | <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
1772 | <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
7d4fb3b1 RC |
1773 | </para></listitem> |
1774 | </varlistentry> | |
1775 | </variablelist> | |
1776 | <xi:include href="less-variables.xml" xpointer="pager"/> | |
1777 | <xi:include href="less-variables.xml" xpointer="less"/> | |
1778 | </refsect1> | |
4a6022f0 ZJS |
1779 | |
1780 | <refsect1> | |
1781 | <title>See Also</title> | |
1782 | <para> | |
1783 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
4a6022f0 ZJS |
1784 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
1785 | <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
a03fe1a5 | 1786 | <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
4a6022f0 | 1787 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
ee41f602 | 1788 | <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
4a6022f0 | 1789 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
5aded369 | 1790 | <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
7d4fb3b1 | 1791 | <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
432d5965 | 1792 | <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>, |
decde8cd | 1793 | <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
4a6022f0 ZJS |
1794 | </para> |
1795 | </refsect1> | |
7874bcd6 LP |
1796 | |
1797 | </refentry> |