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