]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemctl.xml
fixed ugly colorcodes on brackets
[thirdparty/systemd.git] / man / systemctl.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 SPDX-License-Identifier: LGPL-2.1+
10 -->
11
12 <refentry id="systemctl"
13 xmlns:xi="http://www.w3.org/2001/XInclude">
14
15 <refentryinfo>
16 <title>systemctl</title>
17 <productname>systemd</productname>
18 </refentryinfo>
19
20 <refmeta>
21 <refentrytitle>systemctl</refentrytitle>
22 <manvolnum>1</manvolnum>
23 </refmeta>
24
25 <refnamediv>
26 <refname>systemctl</refname>
27 <refpurpose>Control the systemd system and service manager</refpurpose>
28 </refnamediv>
29
30 <refsynopsisdiv>
31 <cmdsynopsis>
32 <command>systemctl</command>
33 <arg choice="opt" rep="repeat">OPTIONS</arg>
34 <arg choice="plain">COMMAND</arg>
35 <arg choice="opt" rep="repeat">UNIT</arg>
36 </cmdsynopsis>
37 </refsynopsisdiv>
38
39 <refsect1>
40 <title>Description</title>
41
42 <para><command>systemctl</command> may be used to introspect and
43 control the state of the <literal>systemd</literal> system and
44 service manager. Please refer to
45 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
46 for an introduction into the basic concepts and functionality this
47 tool manages.</para>
48 </refsect1>
49
50 <refsect1>
51 <title>Options</title>
52
53 <para>The following options are understood:</para>
54
55 <variablelist>
56 <varlistentry>
57 <term><option>-t</option></term>
58 <term><option>--type=</option></term>
59
60 <listitem>
61 <para>The argument should be a comma-separated list of unit
62 types such as <option>service</option> and
63 <option>socket</option>.
64 </para>
65
66 <para>If one of the arguments is a unit type, when listing
67 units, limit display to certain unit types. Otherwise, units
68 of all types will be shown.</para>
69
70 <para>As a special case, if one of the arguments is
71 <option>help</option>, a list of allowed values will be
72 printed and the program will exit.</para>
73 </listitem>
74 </varlistentry>
75
76 <varlistentry>
77 <term><option>--state=</option></term>
78
79 <listitem>
80 <para>The argument should be a comma-separated list of unit
81 LOAD, SUB, or ACTIVE states. When listing units, show only
82 those in the specified states. Use <option>--state=failed</option>
83 to show only failed units.</para>
84
85 <para>As a special case, if one of the arguments is
86 <option>help</option>, a list of allowed values will be
87 printed and the program will exit.</para>
88 </listitem>
89 </varlistentry>
90
91 <varlistentry>
92 <term><option>-p</option></term>
93 <term><option>--property=</option></term>
94
95 <listitem>
96 <para>When showing unit/job/manager properties with the
97 <command>show</command> command, limit display to properties
98 specified in the argument. The argument should be a
99 comma-separated list of property names, such as
100 <literal>MainPID</literal>. Unless specified, all known
101 properties are shown. If specified more than once, all
102 properties with the specified names are shown. Shell
103 completion is implemented for property names.</para>
104
105 <para>For the manager itself,
106 <command>systemctl show</command> will show all available
107 properties. Those properties are documented in
108 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
109 </para>
110
111 <para>Properties for units vary by unit type, so showing any
112 unit (even a non-existent one) is a way to list properties
113 pertaining to this type. Similarly, showing any job will list
114 properties pertaining to all jobs. Properties for units are
115 documented in
116 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
117 and the pages for individual unit types
118 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
119 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
120 etc.</para>
121 </listitem>
122 </varlistentry>
123
124 <varlistentry>
125 <term><option>-a</option></term>
126 <term><option>--all</option></term>
127
128 <listitem>
129 <para>When listing units with <command>list-units</command>, also show inactive units and
130 units which are following other units. When showing unit/job/manager properties, show all
131 properties regardless whether they are set or not.</para>
132
133 <para>To list all units installed in the file system, use the
134 <command>list-unit-files</command> command instead.</para>
135
136 <para>When listing units with <command>list-dependencies</command>, recursively show
137 dependencies of all dependent units (by default only dependencies of target units are
138 shown).</para>
139 </listitem>
140 </varlistentry>
141
142 <varlistentry>
143 <term><option>-r</option></term>
144 <term><option>--recursive</option></term>
145
146 <listitem>
147 <para>When listing units, also show units of local
148 containers. Units of local containers will be prefixed with
149 the container name, separated by a single colon character
150 (<literal>:</literal>).</para>
151 </listitem>
152 </varlistentry>
153
154 <varlistentry>
155 <term><option>--reverse</option></term>
156
157 <listitem>
158 <para>Show reverse dependencies between units with
159 <command>list-dependencies</command>, i.e. follow
160 dependencies of type <varname>WantedBy=</varname>,
161 <varname>RequiredBy=</varname>,
162 <varname>PartOf=</varname>, <varname>BoundBy=</varname>,
163 instead of <varname>Wants=</varname> and similar.
164 </para>
165 </listitem>
166 </varlistentry>
167
168 <varlistentry>
169 <term><option>--after</option></term>
170
171 <listitem>
172 <para>With <command>list-dependencies</command>, show the
173 units that are ordered before the specified unit. In other
174 words, recursively list units following the
175 <varname>After=</varname> dependency.</para>
176
177 <para>Note that any <varname>After=</varname> dependency is
178 automatically mirrored to create a
179 <varname>Before=</varname> dependency. Temporal dependencies
180 may be specified explicitly, but are also created implicitly
181 for units which are <varname>WantedBy=</varname> targets
182 (see
183 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
184 and as a result of other directives (for example
185 <varname>RequiresMountsFor=</varname>). Both explicitly
186 and implicitly introduced dependencies are shown with
187 <command>list-dependencies</command>.</para>
188
189 <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs are
190 waiting for it. May be combined with <option>--before</option> to show both the jobs waiting for each job as
191 well as all jobs each job is waiting for.</para>
192 </listitem>
193 </varlistentry>
194
195 <varlistentry>
196 <term><option>--before</option></term>
197
198 <listitem>
199 <para>With <command>list-dependencies</command>, show the
200 units that are ordered after the specified unit. In other
201 words, recursively list units following the
202 <varname>Before=</varname> dependency.</para>
203
204 <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs it
205 is waiting for. May be combined with <option>--after</option> to show both the jobs waiting for each job as
206 well as all jobs each job is waiting for.</para>
207 </listitem>
208 </varlistentry>
209
210 <varlistentry>
211 <term><option>-l</option></term>
212 <term><option>--full</option></term>
213
214 <listitem>
215 <para>Do not ellipsize unit names, process tree entries,
216 journal output, or truncate unit descriptions in the output
217 of <command>status</command>, <command>list-units</command>,
218 <command>list-jobs</command>, and
219 <command>list-timers</command>.</para>
220 <para>Also, show installation targets in the output of
221 <command>is-enabled</command>.</para>
222 </listitem>
223 </varlistentry>
224
225 <varlistentry>
226 <term><option>--value</option></term>
227
228 <listitem>
229 <para>When printing properties with <command>show</command>,
230 only print the value, and skip the property name and
231 <literal>=</literal>.</para>
232 </listitem>
233 </varlistentry>
234
235 <varlistentry>
236 <term><option>--show-types</option></term>
237
238 <listitem>
239 <para>When showing sockets, show the type of the socket.</para>
240 </listitem>
241 </varlistentry>
242
243 <varlistentry>
244 <term><option>--job-mode=</option></term>
245
246 <listitem>
247 <para>When queuing a new job, this option controls how to deal with
248 already queued jobs. It takes one of <literal>fail</literal>,
249 <literal>replace</literal>,
250 <literal>replace-irreversibly</literal>,
251 <literal>isolate</literal>,
252 <literal>ignore-dependencies</literal>,
253 <literal>ignore-requirements</literal> or
254 <literal>flush</literal>. Defaults to
255 <literal>replace</literal>, except when the
256 <command>isolate</command> command is used which implies the
257 <literal>isolate</literal> job mode.</para>
258
259 <para>If <literal>fail</literal> is specified and a requested
260 operation conflicts with a pending job (more specifically:
261 causes an already pending start job to be reversed into a stop
262 job or vice versa), cause the operation to fail.</para>
263
264 <para>If <literal>replace</literal> (the default) is
265 specified, any conflicting pending job will be replaced, as
266 necessary.</para>
267
268 <para>If <literal>replace-irreversibly</literal> is specified,
269 operate like <literal>replace</literal>, but also mark the new
270 jobs as irreversible. This prevents future conflicting
271 transactions from replacing these jobs (or even being enqueued
272 while the irreversible jobs are still pending). Irreversible
273 jobs can still be cancelled using the <command>cancel</command>
274 command. This job mode should be used on any transaction which
275 pulls in <filename>shutdown.target</filename>.</para>
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
294 <literal>ignore-dependencies</literal>, but only causes the
295 requirement dependencies to be ignored, the ordering
296 dependencies will still be honored.</para>
297 </listitem>
298
299 </varlistentry>
300
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
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, ignore inhibitor locks. Applications can establish
318 inhibitor locks to avoid that certain important operations (such as CD burning or suchlike) are interrupted
319 by system shutdown or a sleep state. Any user may take these locks and privileged users may override these
320 locks. If any locks are taken, shutdown and sleep state requests will normally fail (unless privileged) and a
321 list of active locks is printed. However, if <option>--ignore-inhibitors</option> is specified, the
322 established locks are ignored and not shown, and the operation attempted anyway, possibly requiring
323 additional privileges.</para>
324 </listitem>
325 </varlistentry>
326
327 <varlistentry>
328 <term><option>--dry-run</option></term>
329
330 <listitem>
331 <para>Just print what would be done. Currently supported by verbs
332 <command>halt</command>, <command>poweroff</command>, <command>reboot</command>,
333 <command>kexec</command>, <command>suspend</command>,
334 <command>hibernate</command>, <command>hybrid-sleep</command>,
335 <command>default</command>, <command>rescue</command>,
336 <command>emergency</command>, and <command>exit</command>.</para>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry>
341 <term><option>-q</option></term>
342 <term><option>--quiet</option></term>
343
344 <listitem>
345 <para>Suppress printing of the results of various commands
346 and also the hints about truncated log lines. This does not
347 suppress output of commands for which the printed output is
348 the only result (like <command>show</command>). Errors are
349 always printed.</para>
350 </listitem>
351 </varlistentry>
352
353 <varlistentry>
354 <term><option>--no-block</option></term>
355
356 <listitem>
357 <para>Do not synchronously wait for the requested operation
358 to finish. If this is not specified, the job will be
359 verified, enqueued and <command>systemctl</command> will
360 wait until the unit's start-up is completed. By passing this
361 argument, it is only verified and enqueued. This option may not be
362 combined with <option>--wait</option>.</para>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry>
367 <term><option>--wait</option></term>
368
369 <listitem>
370 <para>Synchronously wait for started units to terminate again.
371 This option may not be combined with <option>--no-block</option>.
372 Note that this will wait forever if any given unit never terminates
373 (by itself or by getting stopped explicitly); particularly services
374 which use <literal>RemainAfterExit=yes</literal>.</para>
375 </listitem>
376 </varlistentry>
377
378 <xi:include href="user-system-options.xml" xpointer="user" />
379 <xi:include href="user-system-options.xml" xpointer="system" />
380
381 <varlistentry>
382 <term><option>--failed</option></term>
383
384 <listitem>
385 <para>List units in failed state. This is equivalent to
386 <option>--state=failed</option>.</para>
387 </listitem>
388 </varlistentry>
389
390 <varlistentry>
391 <term><option>--no-wall</option></term>
392
393 <listitem>
394 <para>Do not send wall message before halt, power-off and reboot.</para>
395 </listitem>
396 </varlistentry>
397
398 <varlistentry>
399 <term><option>--global</option></term>
400
401 <listitem>
402 <para>When used with <command>enable</command> and
403 <command>disable</command>, operate on the global user
404 configuration directory, thus enabling or disabling a unit
405 file globally for all future logins of all users.</para>
406 </listitem>
407 </varlistentry>
408
409 <varlistentry>
410 <term><option>--no-reload</option></term>
411
412 <listitem>
413 <para>When used with <command>enable</command> and
414 <command>disable</command>, do not implicitly reload daemon
415 configuration after executing the changes.</para>
416 </listitem>
417 </varlistentry>
418
419 <varlistentry>
420 <term><option>--no-ask-password</option></term>
421
422 <listitem>
423 <para>When used with <command>start</command> and related
424 commands, disables asking for passwords. Background services
425 may require input of a password or passphrase string, for
426 example to unlock system hard disks or cryptographic
427 certificates. Unless this option is specified and the
428 command is invoked from a terminal,
429 <command>systemctl</command> will query the user on the
430 terminal for the necessary secrets. Use this option to
431 switch this behavior off. In this case, the password must be
432 supplied by some other means (for example graphical password
433 agents) or the service might fail. This also disables
434 querying the user for authentication for privileged
435 operations.</para>
436 </listitem>
437 </varlistentry>
438
439 <varlistentry>
440 <term><option>--kill-who=</option></term>
441
442 <listitem>
443 <para>When used with <command>kill</command>, choose which
444 processes to send a signal to. Must be one of
445 <option>main</option>, <option>control</option> or
446 <option>all</option> to select whether to kill only the main
447 process, the control process or all processes of the
448 unit. The main process of the unit is the one that defines
449 the life-time of it. A control process of a unit is one that
450 is invoked by the manager to induce state changes of it. For
451 example, all processes started due to the
452 <varname>ExecStartPre=</varname>,
453 <varname>ExecStop=</varname> or
454 <varname>ExecReload=</varname> settings of service units are
455 control processes. Note that there is only one control
456 process per unit at a time, as only one state change is
457 executed at a time. For services of type
458 <varname>Type=forking</varname>, the initial process started
459 by the manager for <varname>ExecStart=</varname> is a
460 control process, while the process ultimately forked off by
461 that one is then considered the main process of the unit (if
462 it can be determined). This is different for service units
463 of other types, where the process forked off by the manager
464 for <varname>ExecStart=</varname> is always the main process
465 itself. A service unit consists of zero or one main process,
466 zero or one control process plus any number of additional
467 processes. Not all unit types manage processes of these
468 types however. For example, for mount units, control processes
469 are defined (which are the invocations of
470 <filename>&MOUNT_PATH;</filename> and
471 <filename>&UMOUNT_PATH;</filename>), but no main process
472 is defined. If omitted, defaults to
473 <option>all</option>.</para>
474 </listitem>
475
476 </varlistentry>
477
478 <varlistentry>
479 <term><option>-s</option></term>
480 <term><option>--signal=</option></term>
481
482 <listitem>
483 <para>When used with <command>kill</command>, choose which
484 signal to send to selected processes. Must be one of the
485 well-known signal specifiers such as <constant>SIGTERM</constant>, <constant>SIGINT</constant> or
486 <constant>SIGSTOP</constant>. If omitted, defaults to
487 <option>SIGTERM</option>.</para>
488 </listitem>
489 </varlistentry>
490
491 <varlistentry>
492 <term><option>-f</option></term>
493 <term><option>--force</option></term>
494
495 <listitem>
496 <para>When used with <command>enable</command>, overwrite
497 any existing conflicting symlinks.</para>
498
499 <para>When used with <command>edit</command>, create all of the
500 specified units which do not already exist.</para>
501
502 <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command> or
503 <command>kexec</command>, execute the selected operation without shutting down all units. However, all
504 processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a
505 drastic but relatively safe option to request an immediate reboot. If <option>--force</option> is specified
506 twice for these operations (with the exception of <command>kexec</command>), they will be executed
507 immediately, without terminating any processes or unmounting any file systems. Warning: specifying
508 <option>--force</option> twice with any of these operations might result in data loss. Note that when
509 <option>--force</option> is specified twice the selected operation is executed by
510 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
511 succeed even when the system manager has crashed.</para>
512 </listitem>
513 </varlistentry>
514
515 <varlistentry>
516 <term><option>--message=</option></term>
517
518 <listitem>
519 <para>When used with <command>halt</command>, <command>poweroff</command> or <command>reboot</command>, set a
520 short message explaining the reason for the operation. The message will be logged together with the default
521 shutdown message.</para>
522 </listitem>
523 </varlistentry>
524
525 <varlistentry>
526 <term><option>--now</option></term>
527
528 <listitem>
529 <para>When used with <command>enable</command>, the units
530 will also be started. When used with <command>disable</command> or
531 <command>mask</command>, the units will also be stopped. The start
532 or stop operation is only carried out when the respective enable or
533 disable operation has been successful.</para>
534 </listitem>
535 </varlistentry>
536
537 <varlistentry>
538 <term><option>--root=</option></term>
539
540 <listitem>
541 <para>When used with
542 <command>enable</command>/<command>disable</command>/<command>is-enabled</command>
543 (and related commands), use the specified root path when looking for unit
544 files. If this option is present, <command>systemctl</command> will operate on
545 the file system directly, instead of communicating with the <command>systemd</command>
546 daemon to carry out changes.</para>
547 </listitem>
548
549 </varlistentry>
550
551 <varlistentry>
552 <term><option>--runtime</option></term>
553
554 <listitem>
555 <para>When used with <command>set-property</command>, make changes only
556 temporarily, so that they are lost on the next reboot.</para>
557
558 <para>Similarily, when used with <command>enable</command>, <command>mask</command>,
559 <command>edit</command> and related commands, make temporary changes, which are lost on
560 the next reboot. Changes are not made in subdirectories of <filename>/etc</filename>, but
561 in <filename>/run</filename>. The immediate effect is identical, however since the latter
562 is lost on reboot, the changes are lost too.</para>
563
564 <para>Note: this option cannot be used with <command>disable</command>,
565 <command>unmask</command>, <command>preset</command>, or <command>preset-all</command>,
566 because those operations sometimes need to remove symlinks under <filename>/etc</filename>
567 to have the desired effect, which would cause a persistent change.</para>
568 </listitem>
569 </varlistentry>
570
571 <varlistentry>
572 <term><option>--preset-mode=</option></term>
573
574 <listitem>
575 <para>Takes one of <literal>full</literal> (the default),
576 <literal>enable-only</literal>,
577 <literal>disable-only</literal>. When used with the
578 <command>preset</command> or <command>preset-all</command>
579 commands, controls whether units shall be disabled and
580 enabled according to the preset rules, or only enabled, or
581 only disabled.</para>
582 </listitem>
583 </varlistentry>
584
585 <varlistentry>
586 <term><option>-n</option></term>
587 <term><option>--lines=</option></term>
588
589 <listitem>
590 <para>When used with <command>status</command>, controls the
591 number of journal lines to show, counting from the most
592 recent ones. Takes a positive integer argument. Defaults to
593 10.</para>
594 </listitem>
595 </varlistentry>
596
597 <varlistentry>
598 <term><option>-o</option></term>
599 <term><option>--output=</option></term>
600
601 <listitem>
602 <para>When used with <command>status</command>, controls the
603 formatting of the journal entries that are shown. For the
604 available choices, see
605 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
606 Defaults to <literal>short</literal>.</para>
607 </listitem>
608 </varlistentry>
609
610 <varlistentry>
611 <term><option>--firmware-setup</option></term>
612
613 <listitem>
614 <para>When used with the <command>reboot</command> command,
615 indicate to the system's firmware to boot into setup
616 mode. Note that this is currently only supported on some EFI
617 systems and only if the system was booted in EFI
618 mode.</para>
619 </listitem>
620 </varlistentry>
621
622 <varlistentry>
623 <term><option>--plain</option></term>
624
625 <listitem>
626 <para>When used with <command>list-dependencies</command>,
627 <command>list-units</command> or <command>list-machines</command>,
628 the output is printed as a list instead of a tree, and the bullet
629 circles are omitted.</para>
630 </listitem>
631 </varlistentry>
632
633 <xi:include href="user-system-options.xml" xpointer="host" />
634 <xi:include href="user-system-options.xml" xpointer="machine" />
635
636 <xi:include href="standard-options.xml" xpointer="no-pager" />
637 <xi:include href="standard-options.xml" xpointer="no-legend" />
638 <xi:include href="standard-options.xml" xpointer="help" />
639 <xi:include href="standard-options.xml" xpointer="version" />
640 </variablelist>
641 </refsect1>
642
643 <refsect1>
644 <title>Commands</title>
645
646 <para>The following commands are understood:</para>
647
648 <refsect2>
649 <title>Unit Commands</title>
650
651 <variablelist>
652 <varlistentry>
653 <term><command>list-units</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
654
655 <listitem>
656 <para>List units that <command>systemd</command> currently has in memory. This includes units that are
657 either referenced directly or through a dependency, units that are pinned by applications programmatically,
658 or units that were active in the past and have failed. By default only units which are active, have pending
659 jobs, or have failed are shown; this can be changed with option <option>--all</option>. If one or more
660 <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. The units
661 that are shown are additionally filtered by <option>--type=</option> and <option>--state=</option> if those
662 options are specified.</para>
663
664 <para>Produces output similar to
665 <programlisting> UNIT LOAD ACTIVE SUB DESCRIPTION
666 sys-module-fuse.device loaded active plugged /sys/module/fuse
667 -.mount loaded active mounted Root Mount
668 boot-efi.mount loaded active mounted /boot/efi
669 systemd-journald.service loaded active running Journal Service
670 systemd-logind.service loaded active running Login Service
671 â—Ź user@1000.service loaded failed failed User Manager for UID 1000
672 …
673 systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
674
675 LOAD = Reflects whether the unit definition was properly loaded.
676 ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
677 SUB = The low-level unit activation state, values depend on unit type.
678
679 123 loaded units listed. Pass --all to see loaded but inactive units, too.
680 To show all installed unit files use 'systemctl list-unit-files'.
681 </programlisting>
682 The header and the last unit of a given type are underlined if the
683 terminal supports that. A colored dot is shown next to services which
684 were masked, not found, or otherwise failed.</para>
685
686 <para>The LOAD column shows the load state, one of <constant>loaded</constant>,
687 <constant>not-found</constant>, <constant>bad-setting</constant>, <constant>error</constant>,
688 <constant>masked</constant>. The ACTIVE columns shows the general unit state, one of
689 <constant>active</constant>, <constant>reloading</constant>, <constant>inactive</constant>,
690 <constant>failed</constant>, <constant>activating</constant>, <constant>deactivating</constant>. The SUB
691 column shows the unit-type-specific detailed state of the unit, possible values vary by unit type. The list
692 of possible LOAD, ACTIVE, and SUB states is not constant and new systemd releases may both add and remove
693 values. <programlisting>systemctl --state=help</programlisting> command maybe be used to display the
694 current set of possible values.</para>
695
696 <para>This is the default command.</para>
697 </listitem>
698 </varlistentry>
699
700 <varlistentry>
701 <term><command>list-sockets</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
702
703 <listitem>
704 <para>List socket units currently in memory, ordered by listening address. If one or more
705 <replaceable>PATTERN</replaceable>s are specified, only socket units matching one of them are
706 shown. Produces output similar to
707 <programlisting>
708 LISTEN UNIT ACTIVATES
709 /dev/initctl systemd-initctl.socket systemd-initctl.service
710 …
711 [::]:22 sshd.socket sshd.service
712 kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
713
714 5 sockets listed.</programlisting>
715 Note: because the addresses might contains spaces, this output
716 is not suitable for programmatic consumption.
717 </para>
718
719 <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para>
720 </listitem>
721 </varlistentry>
722
723 <varlistentry>
724 <term><command>list-timers</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
725
726 <listitem>
727 <para>List timer units currently in memory, ordered by the time they elapse next. If one or more
728 <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown.
729 Produces output similar to
730 <programlisting>
731 NEXT LEFT LAST PASSED UNIT ACTIVATES
732 n/a n/a Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service
733 Sun 2017-02-26 18:55:42 EST 1min 14s left Thu 2017-02-23 13:54:44 EST 3 days ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
734 Sun 2017-02-26 20:37:16 EST 1h 42min left Sun 2017-02-26 11:56:36 EST 6h ago apt-daily.timer apt-daily.service
735 Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago snapd.refresh.timer snapd.refresh.service
736 </programlisting>
737 </para>
738
739 <para><emphasis>NEXT</emphasis> shows the next time the timer will run.</para>
740 <para><emphasis>LEFT</emphasis> shows how long till the next time the timer runs.</para>
741 <para><emphasis>LAST</emphasis> shows the last time the timer ran.</para>
742 <para><emphasis>PASSED</emphasis> shows how long has passed since the timer last ran.</para>
743 <para><emphasis>UNIT</emphasis> shows the name of the timer</para>
744 <para><emphasis>ACTIVATES</emphasis> shows the name the service the timer activates when it runs.</para>
745
746 <para>Also see <option>--all</option> and <option>--state=</option>.</para>
747 </listitem>
748 </varlistentry>
749
750 <varlistentry>
751 <term><command>start <replaceable>PATTERN</replaceable>…</command></term>
752
753 <listitem>
754 <para>Start (activate) one or more units specified on the
755 command line.</para>
756
757 <para>Note that glob patterns operate on the set of primary names of units currently in memory. Units which
758 are not active and are not in a failed state usually are not in memory, and will not be matched by any
759 pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until
760 the instance has been started. Therefore, using glob patterns with <command>start</command> has limited
761 usefulness. Also, secondary alias names of units are not considered.</para>
762 </listitem>
763 </varlistentry>
764 <varlistentry>
765 <term><command>stop <replaceable>PATTERN</replaceable>…</command></term>
766
767 <listitem>
768 <para>Stop (deactivate) one or more units specified on the
769 command line.</para>
770 </listitem>
771 </varlistentry>
772 <varlistentry>
773 <term><command>reload <replaceable>PATTERN</replaceable>…</command></term>
774
775 <listitem>
776 <para>Asks all units listed on the command line to reload
777 their configuration. Note that this will reload the
778 service-specific configuration, not the unit configuration
779 file of systemd. If you want systemd to reload the
780 configuration file of a unit, use the
781 <command>daemon-reload</command> command. In other words:
782 for the example case of Apache, this will reload Apache's
783 <filename>httpd.conf</filename> in the web server, not the
784 <filename>apache.service</filename> systemd unit
785 file.</para>
786
787 <para>This command should not be confused with the
788 <command>daemon-reload</command> command.</para>
789 </listitem>
790
791 </varlistentry>
792 <varlistentry>
793 <term><command>restart <replaceable>PATTERN</replaceable>…</command></term>
794
795 <listitem>
796 <para>Stop and then start one or more units specified on the command line. If the units are not running
797 yet, they will be started.</para>
798
799 <para>Note that restarting a unit with this command does not necessarily flush out all of the unit's
800 resources before it is started again. For example, the per-service file descriptor storage facility (see
801 <varname>FileDescriptoreStoreMax=</varname> in
802 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>) will
803 remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and
804 no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a
805 restart operation an explicit <command>systemctl stop</command> command followed by <command>systemctl
806 start</command> should be issued.</para>
807 </listitem>
808 </varlistentry>
809 <varlistentry>
810 <term><command>try-restart <replaceable>PATTERN</replaceable>…</command></term>
811
812 <listitem>
813 <para>Stop and then start one or more units specified on the
814 command line if the units are running. This does nothing
815 if units are not running.</para>
816 <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally
817 don't document that. -->
818 </listitem>
819 </varlistentry>
820 <varlistentry>
821 <term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
822
823 <listitem>
824 <para>Reload one or more units if they support it. If not, stop and then start them instead. If the units
825 are not running yet, they will be started.</para>
826 </listitem>
827 </varlistentry>
828 <varlistentry>
829 <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
830
831 <listitem>
832 <para>Reload one or more units if they support it. If not, stop and then start them instead. This does
833 nothing if the units are not running.</para>
834 <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
835 don't document that. -->
836 </listitem>
837 </varlistentry>
838 <varlistentry>
839 <term><command>isolate <replaceable>UNIT</replaceable></command></term>
840
841 <listitem>
842 <para>Start the unit specified on the command line and its dependencies
843 and stop all others, unless they have
844 <option>IgnoreOnIsolate=yes</option> (see
845 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
846 If a unit name with no extension is given, an extension of
847 <literal>.target</literal> will be assumed.</para>
848
849 <para>This is similar to changing the runlevel in a
850 traditional init system. The <command>isolate</command>
851 command will immediately stop processes that are not enabled
852 in the new unit, possibly including the graphical
853 environment or terminal you are currently using.</para>
854
855 <para>Note that this is allowed only on units where
856 <option>AllowIsolate=</option> is enabled. See
857 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
858 for details.</para>
859 </listitem>
860 </varlistentry>
861 <varlistentry>
862 <term><command>kill <replaceable>PATTERN</replaceable>…</command></term>
863
864 <listitem>
865 <para>Send a signal to one or more processes of the
866 unit. Use <option>--kill-who=</option> to select which
867 process to kill. Use <option>--signal=</option> to select
868 the signal to send.</para>
869 </listitem>
870 </varlistentry>
871 <varlistentry>
872 <term><command>is-active <replaceable>PATTERN</replaceable>…</command></term>
873
874 <listitem>
875 <para>Check whether any of the specified units are active
876 (i.e. running). Returns an exit code
877 <constant>0</constant> if at least one is active, or
878 non-zero otherwise. Unless <option>--quiet</option> is
879 specified, this will also print the current unit state to
880 standard output.</para>
881 </listitem>
882 </varlistentry>
883 <varlistentry>
884 <term><command>is-failed <replaceable>PATTERN</replaceable>…</command></term>
885
886 <listitem>
887 <para>Check whether any of the specified units are in a
888 "failed" state. Returns an exit code
889 <constant>0</constant> if at least one has failed,
890 non-zero otherwise. Unless <option>--quiet</option> is
891 specified, this will also print the current unit state to
892 standard output.</para>
893 </listitem>
894 </varlistentry>
895 <varlistentry>
896 <term><command>status</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…]</optional></term>
897
898 <listitem>
899 <para>Show terse runtime status information about one or
900 more units, followed by most recent log data from the
901 journal. If no units are specified, show system status. If
902 combined with <option>--all</option>, also show the status of
903 all units (subject to limitations specified with
904 <option>-t</option>). If a PID is passed, show information
905 about the unit the process belongs to.</para>
906
907 <para>This function is intended to generate human-readable
908 output. If you are looking for computer-parsable output,
909 use <command>show</command> instead. By default, this
910 function only shows 10 lines of output and ellipsizes
911 lines to fit in the terminal window. This can be changed
912 with <option>--lines</option> and <option>--full</option>,
913 see above. In addition, <command>journalctl
914 --unit=<replaceable>NAME</replaceable></command> or
915 <command>journalctl
916 --user-unit=<replaceable>NAME</replaceable></command> use
917 a similar filter for messages and might be more
918 convenient.
919 </para>
920
921 <para>systemd implicitly loads units as necessary, so just running the <command>status</command> will
922 attempt to load a file. The command is thus not useful for determining if something was already loaded or
923 not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason
924 to keep it in memory thereafter.
925 </para>
926
927 <example>
928 <title>Example output from systemctl status </title>
929
930 <programlisting>$ systemctl status bluetooth
931 â—Ź bluetooth.service - Bluetooth service
932 Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
933 Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
934 Docs: man:bluetoothd(8)
935 Main PID: 930 (bluetoothd)
936 Status: "Running"
937 Tasks: 1
938 Memory: 648.0K
939 CPU: 435ms
940 CGroup: /system.slice/bluetooth.service
941 └─930 /usr/lib/bluetooth/bluetoothd
942
943 Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service
944 Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered
945 Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5)
946 </programlisting>
947
948 <para>The dot ("â—Ź") uses color on supported terminals to summarize the unit state at a glance. White
949 indicates an <literal>inactive</literal> or <literal>deactivating</literal> state. Red indicates a
950 <literal>failed</literal> or <literal>error</literal> state and green indicates an
951 <literal>active</literal>, <literal>reloading</literal> or <literal>activating</literal> state.
952 </para>
953
954 <para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been loaded into
955 memory. Other possible values for "Loaded:" include: <literal>error</literal> if there was a problem
956 loading it, <literal>not-found</literal> if not unit file was found for this unit,
957 <literal>bad-setting</literal> if an essential unit file setting could not be parsed and
958 <literal>masked</literal> if the unit file has been masked. Along with showing the path to the unit file,
959 this line will also show the enablement state. Enabled commands start at boot. See the full table of
960 possible enablement states — including the definition of <literal>masked</literal> — in the documentation
961 for the <command>is-enabled</command> command.
962 </para>
963
964 <para>The "Active:" line shows active state. The value is usually <literal>active</literal> or
965 <literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the unit type.
966 The unit could also be in process of changing states, reporting a state of <literal>activating</literal> or
967 <literal>deactivating</literal>. A special <literal>failed</literal> state is entered when the service
968 failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is
969 entered the cause will be logged for later reference.</para>
970 </example>
971
972 </listitem>
973 </varlistentry>
974 <varlistentry>
975 <term><command>show</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>JOB</replaceable>…</optional></term>
976
977 <listitem>
978 <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified,
979 properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and
980 if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use
981 <option>--all</option> to show those too. To select specific properties to show, use
982 <option>--property=</option>. This command is intended to be used whenever computer-parsable output is
983 required. Use <command>status</command> if you are looking for formatted human-readable output.</para>
984
985 <para>Many properties shown by <command>systemctl show</command> map directly to configuration settings of
986 the system and service manager and its unit files. Note that the properties shown by the command are
987 generally more low-level, normalized versions of the original configuration settings and expose runtime
988 state in addition to configuration. For example, properties shown for service units include the service's
989 current main process identifier as <literal>MainPID</literal> (which is runtime state), and time settings
990 are always exposed as properties ending in the <literal>…USec</literal> suffix even if a matching
991 configuration options end in <literal>…Sec</literal>, because microseconds is the normalized time unit used
992 by the system and service manager.</para>
993 </listitem>
994 </varlistentry>
995 <varlistentry>
996 <term><command>cat <replaceable>PATTERN</replaceable>…</command></term>
997
998 <listitem>
999 <para>Show backing files of one or more units. Prints the
1000 "fragment" and "drop-ins" (source files) of units. Each
1001 file is preceded by a comment which includes the file
1002 name. Note that this shows the contents of the backing files
1003 on disk, which may not match the system manager's
1004 understanding of these units if any unit files were
1005 updated on disk and the <command>daemon-reload</command>
1006 command wasn't issued since.</para>
1007 </listitem>
1008 </varlistentry>
1009 <varlistentry>
1010 <term><command>set-property <replaceable>UNIT</replaceable> <replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable>…</command></term>
1011
1012 <listitem>
1013 <para>Set the specified unit properties at runtime where
1014 this is supported. This allows changing configuration
1015 parameter properties such as resource control settings at
1016 runtime. Not all properties may be changed at runtime, but
1017 many resource control settings (primarily those in
1018 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
1019 may. The changes are applied immediately, and stored on disk
1020 for future boots, unless <option>--runtime</option> is
1021 passed, in which case the settings only apply until the
1022 next reboot. The syntax of the property assignment follows
1023 closely the syntax of assignments in unit files.</para>
1024
1025 <para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para>
1026
1027 <para>If the specified unit appears to be inactive, the
1028 changes will be only stored on disk as described
1029 previously hence they will be effective when the unit will
1030 be started.</para>
1031
1032 <para>Note that this command allows changing multiple
1033 properties at the same time, which is preferable over
1034 setting them individually. Like with unit file configuration
1035 settings, assigning an empty list will reset the property.
1036 </para>
1037 </listitem>
1038 </varlistentry>
1039
1040 <varlistentry>
1041 <term><command>help <replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…</command></term>
1042
1043 <listitem>
1044 <para>Show manual pages for one or more units, if
1045 available. If a PID is given, the manual pages for the unit
1046 the process belongs to are shown.</para>
1047 </listitem>
1048 </varlistentry>
1049
1050 <varlistentry>
1051 <term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term>
1052
1053 <listitem>
1054 <para>Reset the <literal>failed</literal> state of the specified units, or if no unit name is passed, reset
1055 the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code,
1056 terminating abnormally or timing out), it will automatically enter the <literal>failed</literal> state and
1057 its exit code and status is recorded for introspection by the administrator until the service is
1058 stopped/re-started or reset with this command.</para>
1059 </listitem>
1060 </varlistentry>
1061
1062 <varlistentry>
1063 <term>
1064 <command>list-dependencies</command>
1065 <optional><replaceable>UNIT</replaceable></optional>
1066 </term>
1067
1068 <listitem>
1069 <para>Shows units required and wanted by the specified
1070 unit. This recursively lists units following the
1071 <varname>Requires=</varname>,
1072 <varname>Requisite=</varname>,
1073 <varname>ConsistsOf=</varname>,
1074 <varname>Wants=</varname>, <varname>BindsTo=</varname>
1075 dependencies. If no unit is specified,
1076 <filename>default.target</filename> is implied.</para>
1077
1078 <para>By default, only target units are recursively
1079 expanded. When <option>--all</option> is passed, all other
1080 units are recursively expanded as well.</para>
1081
1082 <para>Options <option>--reverse</option>,
1083 <option>--after</option>, <option>--before</option>
1084 may be used to change what types of dependencies
1085 are shown.</para>
1086 </listitem>
1087 </varlistentry>
1088 </variablelist>
1089 </refsect2>
1090
1091 <refsect2>
1092 <title>Unit File Commands</title>
1093
1094 <variablelist>
1095 <varlistentry>
1096 <term><command>list-unit-files</command> <optional><replaceable>PATTERN…</replaceable></optional></term>
1097
1098 <listitem>
1099 <para>List unit files installed on the system, in combination with their enablement state (as reported by
1100 <command>is-enabled</command>). If one or more <replaceable>PATTERN</replaceable>s are specified, only unit
1101 files whose name matches one of them are shown (patterns matching unit file system paths are not
1102 supported).</para>
1103 </listitem>
1104 </varlistentry>
1105
1106 <varlistentry>
1107 <term><command>enable <replaceable>UNIT</replaceable>…</command></term>
1108 <term><command>enable <replaceable>PATH</replaceable>…</command></term>
1109
1110 <listitem>
1111 <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the
1112 <literal>[Install]</literal> sections of the indicated unit files. After the symlinks have been created,
1113 the system manager configuration is reloaded (in a way equivalent to <command>daemon-reload</command>), in
1114 order to ensure the changes are taken into account immediately. Note that this does
1115 <emphasis>not</emphasis> have the effect of also starting any of the units being enabled. If this is
1116 desired, combine this command with the <option>--now</option> switch, or invoke <command>start</command>
1117 with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of
1118 the form <filename>foo@bar.service</filename>), symlinks named the same as instances are created in the
1119 unit configuration directory, however they point to the single template unit file they are instantiated
1120 from.</para>
1121
1122 <para>This command expects either valid unit names (in which case various unit file directories are
1123 automatically searched for unit files with appropriate names), or absolute paths to unit files (in which
1124 case these files are read directly). If a specified unit file is located outside of the usual unit file
1125 directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring
1126 it is found when requested by commands such as <command>start</command>. The file system where the linked
1127 unit files are located must be accessible when systemd is started (e.g. anything underneath
1128 <filename>/home</filename> or <filename>/var</filename> is not allowed, unless those directories are
1129 located on the root file system).</para>
1130
1131 <para>This command will print the file system operations executed. This output may be suppressed by passing
1132 <option>--quiet</option>.
1133 </para>
1134
1135 <para>Note that this operation creates only the symlinks suggested in the <literal>[Install]</literal>
1136 section of the unit files. While this command is the recommended way to manipulate the unit configuration
1137 directory, the administrator is free to make additional changes manually by placing or removing symlinks
1138 below this directory. This is particularly useful to create configurations that deviate from the suggested
1139 default installation. In this case, the administrator must make sure to invoke
1140 <command>daemon-reload</command> manually as necessary, in order to ensure the changes are taken into
1141 account.
1142 </para>
1143
1144 <para>Enabling units should not be confused with starting (activating) units, as done by the
1145 <command>start</command> command. Enabling and starting units is orthogonal: units may be enabled without
1146 being started and started without being enabled. Enabling simply hooks the unit into various suggested
1147 places (for example, so that the unit is automatically started on boot or when a particular kind of
1148 hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds
1149 the socket (in case of socket units), and so on.</para>
1150
1151 <para>Depending on whether <option>--system</option>, <option>--user</option>, <option>--runtime</option>,
1152 or <option>--global</option> is specified, this enables the unit for the system, for the calling user only,
1153 for only this boot of the system, or for all future logins of all users. Note that in the last case, no
1154 systemd daemon configuration is reloaded.</para>
1155
1156 <para>Using <command>enable</command> on masked units is not supported and results in an error.</para>
1157 </listitem>
1158 </varlistentry>
1159
1160 <varlistentry>
1161 <term><command>disable <replaceable>UNIT</replaceable>…</command></term>
1162
1163 <listitem>
1164 <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units
1165 from the unit configuration directory, and hence undoes any changes made by <command>enable</command> or
1166 <command>link</command>. Note that this removes <emphasis>all</emphasis> symlinks to matching unit files,
1167 including manually created symlinks, and not just those actually created by <command>enable</command> or
1168 <command>link</command>. Note that while <command>disable</command> undoes the effect of
1169 <command>enable</command>, the two commands are otherwise not symmetric, as <command>disable</command> may
1170 remove more symlinks than a prior <command>enable</command> invocation of the same unit created.</para>
1171
1172 <para>This command expects valid unit names only, it does not accept paths to unit files.</para>
1173
1174 <para>In addition to the units specified as arguments, all units are disabled that are listed in the
1175 <varname>Also=</varname> setting contained in the <literal>[Install]</literal> section of any of the unit
1176 files being operated on.</para>
1177
1178 <para>This command implicitly reloads the system manager configuration after completing the operation. Note
1179 that this command does not implicitly stop the units that are being disabled. If this is desired, either
1180 combine this command with the <option>--now</option> switch, or invoke the <command>stop</command> command
1181 with appropriate arguments later.</para>
1182
1183 <para>This command will print information about the file system operations (symlink removals)
1184 executed. This output may be suppressed by passing <option>--quiet</option>.
1185 </para>
1186
1187 <para>This command honors <option>--system</option>, <option>--user</option>, <option>--runtime</option>
1188 and <option>--global</option> in a similar way as <command>enable</command>.</para>
1189 </listitem>
1190 </varlistentry>
1191
1192 <varlistentry>
1193 <term><command>reenable <replaceable>UNIT</replaceable>…</command></term>
1194
1195 <listitem>
1196 <para>Reenable one or more units, as specified on the command line. This is a combination of
1197 <command>disable</command> and <command>enable</command> and is useful to reset the symlinks a unit file is
1198 enabled with to the defaults configured in its <literal>[Install]</literal> section. This command expects
1199 a unit name only, it does not accept paths to unit files.</para>
1200 </listitem>
1201 </varlistentry>
1202
1203 <varlistentry>
1204 <term><command>preset <replaceable>UNIT</replaceable>…</command></term>
1205
1206 <listitem>
1207 <para>Reset the enable/disable status one or more unit files, as specified on
1208 the command line, to the defaults configured in the preset policy files. This
1209 has the same effect as <command>disable</command> or
1210 <command>enable</command>, depending how the unit is listed in the preset
1211 files.</para>
1212
1213 <para>Use <option>--preset-mode=</option> to control whether units shall be
1214 enabled and disabled, or only enabled, or only disabled.</para>
1215
1216 <para>If the unit carries no install information, it will be silently ignored
1217 by this command. <replaceable>UNIT</replaceable> must be the real unit name,
1218 any alias names are ignored silently.</para>
1219
1220 <para>For more information on the preset policy format, see
1221 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1222 For more information on the concept of presets, please consult the
1223 <ulink url="https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink>
1224 document.</para>
1225 </listitem>
1226 </varlistentry>
1227
1228 <varlistentry>
1229 <term><command>preset-all</command></term>
1230
1231 <listitem>
1232 <para>Resets all installed unit files to the defaults
1233 configured in the preset policy file (see above).</para>
1234
1235 <para>Use <option>--preset-mode=</option> to control
1236 whether units shall be enabled and disabled, or only
1237 enabled, or only disabled.</para>
1238 </listitem>
1239 </varlistentry>
1240
1241 <varlistentry>
1242 <term><command>is-enabled <replaceable>UNIT</replaceable>…</command></term>
1243
1244 <listitem>
1245 <para>Checks whether any of the specified unit files are
1246 enabled (as with <command>enable</command>). Returns an
1247 exit code of 0 if at least one is enabled, non-zero
1248 otherwise. Prints the current enable status (see table).
1249 To suppress this output, use <option>--quiet</option>.
1250 To show installation targets, use <option>--full</option>.
1251 </para>
1252
1253 <table>
1254 <title>
1255 <command>is-enabled</command> output
1256 </title>
1257
1258 <tgroup cols='3'>
1259 <thead>
1260 <row>
1261 <entry>Name</entry>
1262 <entry>Description</entry>
1263 <entry>Exit Code</entry>
1264 </row>
1265 </thead>
1266 <tbody>
1267 <row>
1268 <entry><literal>enabled</literal></entry>
1269 <entry morerows='1'>Enabled via <filename>.wants/</filename>, <filename>.requires/</filename> or <varname>Alias=</varname> symlinks (permanently in <filename>/etc/systemd/system/</filename>, or transiently in <filename>/run/systemd/system/</filename>).</entry>
1270 <entry morerows='1'>0</entry>
1271 </row>
1272 <row>
1273 <entry><literal>enabled-runtime</literal></entry>
1274 </row>
1275 <row>
1276 <entry><literal>linked</literal></entry>
1277 <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>
1278 <entry morerows='1'>&gt; 0</entry>
1279 </row>
1280 <row>
1281 <entry><literal>linked-runtime</literal></entry>
1282 </row>
1283 <row>
1284 <entry><literal>masked</literal></entry>
1285 <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>
1286 <entry morerows='1'>&gt; 0</entry>
1287 </row>
1288 <row>
1289 <entry><literal>masked-runtime</literal></entry>
1290 </row>
1291 <row>
1292 <entry><literal>static</literal></entry>
1293 <entry>The unit file is not enabled, and has no provisions for enabling in the <literal>[Install]</literal> unit file section.</entry>
1294 <entry>0</entry>
1295 </row>
1296 <row>
1297 <entry><literal>indirect</literal></entry>
1298 <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, or it has an alias under a different name through a symlink that is not specified in Also=. For template unit file, an instance different than the one specified in <varname>DefaultInstance=</varname> is enabled.</entry>
1299 <entry>0</entry>
1300 </row>
1301 <row>
1302 <entry><literal>disabled</literal></entry>
1303 <entry>The unit file is not enabled, but contains an <literal>[Install]</literal> section with installation instructions.</entry>
1304 <entry>&gt; 0</entry>
1305 </row>
1306 <row>
1307 <entry><literal>generated</literal></entry>
1308 <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>
1309 <entry>0</entry>
1310 </row>
1311 <row>
1312 <entry><literal>transient</literal></entry>
1313 <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry>
1314 <entry>0</entry>
1315 </row>
1316 <row>
1317 <entry><literal>bad</literal></entry>
1318 <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>
1319 <entry>&gt; 0</entry>
1320 </row>
1321 </tbody>
1322 </tgroup>
1323 </table>
1324
1325 </listitem>
1326 </varlistentry>
1327
1328 <varlistentry>
1329 <term><command>mask <replaceable>UNIT</replaceable>…</command></term>
1330
1331 <listitem>
1332 <para>Mask one or more units, as specified on the command line. This will link these unit files to
1333 <filename>/dev/null</filename>, making it impossible to start them. This is a stronger version of
1334 <command>disable</command>, since it prohibits all kinds of activation of the unit, including enablement
1335 and manual activation. Use this option with care. This honors the <option>--runtime</option> option to only
1336 mask temporarily until the next reboot of the system. The <option>--now</option> option may be used to
1337 ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit
1338 file paths.</para>
1339 </listitem>
1340 </varlistentry>
1341
1342 <varlistentry>
1343 <term><command>unmask <replaceable>UNIT</replaceable>…</command></term>
1344
1345 <listitem>
1346 <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of
1347 <command>mask</command>. This command expects valid unit names only, it does not accept unit file
1348 paths.</para>
1349 </listitem>
1350 </varlistentry>
1351
1352 <varlistentry>
1353 <term><command>link <replaceable>PATH</replaceable>…</command></term>
1354
1355 <listitem>
1356 <para>Link a unit file that is not in the unit file search paths into the unit file search path. This
1357 command expects an absolute path to a unit file. The effect of this may be undone with
1358 <command>disable</command>. The effect of this command is that a unit file is made available for commands
1359 such as <command>start</command>, even though it is not installed directly in the unit search path. The
1360 file system where the linked unit files are located must be accessible when systemd is started
1361 (e.g. anything underneath <filename>/home</filename> or <filename>/var</filename> is not allowed, unless
1362 those directories are located on the root file system).</para>
1363 </listitem>
1364 </varlistentry>
1365
1366 <varlistentry>
1367 <term><command>revert <replaceable>UNIT</replaceable>…</command></term>
1368
1369 <listitem>
1370 <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration
1371 files that modify the specified units, as well as any user-configured unit file that overrides a matching
1372 vendor supplied unit file. Specifically, for a unit <literal>foo.service</literal> the matching directories
1373 <literal>foo.service.d/</literal> with all their contained files are removed, both below the persistent and
1374 runtime configuration directories (i.e. below <filename>/etc/systemd/system</filename> and
1375 <filename>/run/systemd/system</filename>); if the unit file has a vendor-supplied version (i.e. a unit file
1376 located below <filename>/usr</filename>) any matching persistent or runtime unit file that overrides it is
1377 removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below
1378 <filename>/etc/systemd/system</filename> or <filename>/run/systemd/system</filename>, but not in a unit
1379 file stored below <filename>/usr</filename>), then it is not removed. Also, if a unit is masked, it is
1380 unmasked.</para>
1381
1382 <para>Effectively, this command may be used to undo all changes made with <command>systemctl
1383 edit</command>, <command>systemctl set-property</command> and <command>systemctl mask</command> and puts
1384 the original unit file with its settings back in effect.</para>
1385 </listitem>
1386 </varlistentry>
1387
1388 <varlistentry>
1389 <term><command>add-wants <replaceable>TARGET</replaceable>
1390 <replaceable>UNIT</replaceable>…</command></term>
1391 <term><command>add-requires <replaceable>TARGET</replaceable>
1392 <replaceable>UNIT</replaceable>…</command></term>
1393
1394 <listitem>
1395 <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal>
1396 dependencies, respectively, to the specified
1397 <replaceable>TARGET</replaceable> for one or more units. </para>
1398
1399 <para>This command honors <option>--system</option>,
1400 <option>--user</option>, <option>--runtime</option> and
1401 <option>--global</option> in a way similar to
1402 <command>enable</command>.</para>
1403
1404 </listitem>
1405 </varlistentry>
1406
1407 <varlistentry>
1408 <term><command>edit <replaceable>UNIT</replaceable>…</command></term>
1409
1410 <listitem>
1411 <para>Edit a drop-in snippet or a whole replacement file if
1412 <option>--full</option> is specified, to extend or override the
1413 specified unit.</para>
1414
1415 <para>Depending on whether <option>--system</option> (the default),
1416 <option>--user</option>, or <option>--global</option> is specified,
1417 this command creates a drop-in file for each unit either for the system,
1418 for the calling user, or for all futures logins of all users. Then,
1419 the editor (see the "Environment" section below) is invoked on
1420 temporary files which will be written to the real location if the
1421 editor exits successfully.</para>
1422
1423 <para>If <option>--full</option> is specified, this will copy the
1424 original units instead of creating drop-in files.</para>
1425
1426 <para>If <option>--force</option> is specified and any units do
1427 not already exist, new unit files will be opened for editing.</para>
1428
1429 <para>If <option>--runtime</option> is specified, the changes will
1430 be made temporarily in <filename>/run</filename> and they will be
1431 lost on the next reboot.</para>
1432
1433 <para>If the temporary file is empty upon exit, the modification of
1434 the related unit is canceled.</para>
1435
1436 <para>After the units have been edited, systemd configuration is
1437 reloaded (in a way that is equivalent to <command>daemon-reload</command>).
1438 </para>
1439
1440 <para>Note that this command cannot be used to remotely edit units
1441 and that you cannot temporarily edit units which are in
1442 <filename>/etc</filename>, since they take precedence over
1443 <filename>/run</filename>.</para>
1444 </listitem>
1445 </varlistentry>
1446
1447 <varlistentry>
1448 <term><command>get-default</command></term>
1449
1450 <listitem>
1451 <para>Return the default target to boot into. This returns
1452 the target unit name <filename>default.target</filename>
1453 is aliased (symlinked) to.</para>
1454 </listitem>
1455 </varlistentry>
1456
1457 <varlistentry>
1458 <term><command>set-default <replaceable>TARGET</replaceable></command></term>
1459
1460 <listitem>
1461 <para>Set the default target to boot into. This sets
1462 (symlinks) the <filename>default.target</filename> alias
1463 to the given target unit.</para>
1464 </listitem>
1465 </varlistentry>
1466
1467 </variablelist>
1468 </refsect2>
1469
1470 <refsect2>
1471 <title>Machine Commands</title>
1472
1473 <variablelist>
1474 <varlistentry>
1475 <term><command>list-machines</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
1476
1477 <listitem>
1478 <para>List the host and all running local containers with
1479 their state. If one or more
1480 <replaceable>PATTERN</replaceable>s are specified, only
1481 containers matching one of them are shown.
1482 </para>
1483 </listitem>
1484 </varlistentry>
1485 </variablelist>
1486 </refsect2>
1487
1488 <refsect2>
1489 <title>Job Commands</title>
1490
1491 <variablelist>
1492 <varlistentry>
1493 <term><command>list-jobs <optional><replaceable>PATTERN…</replaceable></optional></command></term>
1494
1495 <listitem>
1496 <para>List jobs that are in progress. If one or more
1497 <replaceable>PATTERN</replaceable>s are specified, only
1498 jobs for units matching one of them are shown.</para>
1499
1500 <para>When combined with <option>--after</option> or <option>--before</option> the list is augmented with
1501 information on which other job each job is waiting for, and which other jobs are waiting for it, see
1502 above.</para>
1503 </listitem>
1504 </varlistentry>
1505 <varlistentry>
1506 <term><command>cancel <replaceable>JOB</replaceable>…</command></term>
1507
1508 <listitem>
1509 <para>Cancel one or more jobs specified on the command line
1510 by their numeric job IDs. If no job ID is specified, cancel
1511 all pending jobs.</para>
1512 </listitem>
1513 </varlistentry>
1514 </variablelist>
1515 </refsect2>
1516
1517 <refsect2>
1518 <title>Environment Commands</title>
1519
1520 <variablelist>
1521 <varlistentry>
1522 <term><command>show-environment</command></term>
1523
1524 <listitem>
1525 <para>Dump the systemd manager environment block. This is the environment
1526 block that is passed to all processes the manager spawns. The environment
1527 block will be dumped in straight-forward form suitable for sourcing into
1528 most shells. If no special characters or whitespace is present in the variable
1529 values, no escaping is performed, and the assignments have the form
1530 <literal>VARIABLE=value</literal>. If whitespace or characters which have
1531 special meaning to the shell are present, dollar-single-quote escaping is
1532 used, and assignments have the form <literal>VARIABLE=$'value'</literal>.
1533 This syntax is known to be supported by
1534 <citerefentry project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1535 <citerefentry project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1536 <citerefentry project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1537 and
1538 <citerefentry project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
1539 <citerefentry project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1540 but not
1541 <citerefentry project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1542 or
1543 <citerefentry project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1544 </para>
1545 </listitem>
1546 </varlistentry>
1547 <varlistentry>
1548 <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term>
1549
1550 <listitem>
1551 <para>Set one or more systemd manager environment variables,
1552 as specified on the command line.</para>
1553 </listitem>
1554 </varlistentry>
1555 <varlistentry>
1556 <term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term>
1557
1558 <listitem>
1559 <para>Unset one or more systemd manager environment
1560 variables. If only a variable name is specified, it will be
1561 removed regardless of its value. If a variable and a value
1562 are specified, the variable is only removed if it has the
1563 specified value.</para>
1564 </listitem>
1565 </varlistentry>
1566 <varlistentry>
1567 <term>
1568 <command>import-environment</command>
1569 <optional><replaceable>VARIABLE…</replaceable></optional>
1570 </term>
1571
1572 <listitem>
1573 <para>Import all, one or more environment variables set on
1574 the client into the systemd manager environment block. If
1575 no arguments are passed, the entire environment block is
1576 imported. Otherwise, a list of one or more environment
1577 variable names should be passed, whose client-side values
1578 are then imported into the manager's environment
1579 block.</para>
1580 </listitem>
1581 </varlistentry>
1582 </variablelist>
1583 </refsect2>
1584
1585 <refsect2>
1586 <title>Manager Lifecycle Commands</title>
1587
1588 <variablelist>
1589 <varlistentry>
1590 <term><command>daemon-reload</command></term>
1591
1592 <listitem>
1593 <para>Reload the systemd manager configuration. This will
1594 rerun all generators (see
1595 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>),
1596 reload all unit files, and recreate the entire dependency
1597 tree. While the daemon is being reloaded, all sockets
1598 systemd listens on behalf of user configuration will stay
1599 accessible.</para>
1600
1601 <para>This command should not be confused with the
1602 <command>reload</command> command.</para>
1603 </listitem>
1604 </varlistentry>
1605 <varlistentry>
1606 <term><command>daemon-reexec</command></term>
1607
1608 <listitem>
1609 <para>Reexecute the systemd manager. This will serialize the
1610 manager state, reexecute the process and deserialize the
1611 state again. This command is of little use except for
1612 debugging and package upgrades. Sometimes, it might be
1613 helpful as a heavy-weight <command>daemon-reload</command>.
1614 While the daemon is being reexecuted, all sockets systemd listening
1615 on behalf of user configuration will stay accessible.
1616 </para>
1617 </listitem>
1618 </varlistentry>
1619 </variablelist>
1620 </refsect2>
1621
1622 <refsect2>
1623 <title>System Commands</title>
1624
1625 <variablelist>
1626 <varlistentry>
1627 <term><command>is-system-running</command></term>
1628
1629 <listitem>
1630 <para>Checks whether the system is operational. This
1631 returns success (exit code 0) when the system is fully up
1632 and running, specifically not in startup, shutdown or
1633 maintenance mode, and with no failed services. Failure is
1634 returned otherwise (exit code non-zero). In addition, the
1635 current state is printed in a short string to standard
1636 output, see the table below. Use <option>--quiet</option> to
1637 suppress this output.</para>
1638
1639 <table>
1640 <title><command>is-system-running</command> output</title>
1641 <tgroup cols='3'>
1642 <colspec colname='name'/>
1643 <colspec colname='description'/>
1644 <colspec colname='exit-code'/>
1645 <thead>
1646 <row>
1647 <entry>Name</entry>
1648 <entry>Description</entry>
1649 <entry>Exit Code</entry>
1650 </row>
1651 </thead>
1652 <tbody>
1653 <row>
1654 <entry><varname>initializing</varname></entry>
1655 <entry><para>Early bootup, before
1656 <filename>basic.target</filename> is reached
1657 or the <varname>maintenance</varname> state entered.
1658 </para></entry>
1659 <entry>&gt; 0</entry>
1660 </row>
1661 <row>
1662 <entry><varname>starting</varname></entry>
1663 <entry><para>Late bootup, before the job queue
1664 becomes idle for the first time, or one of the
1665 rescue targets are reached.</para></entry>
1666 <entry>&gt; 0</entry>
1667 </row>
1668 <row>
1669 <entry><varname>running</varname></entry>
1670 <entry><para>The system is fully
1671 operational.</para></entry>
1672 <entry>0</entry>
1673 </row>
1674 <row>
1675 <entry><varname>degraded</varname></entry>
1676 <entry><para>The system is operational but one or more
1677 units failed.</para></entry>
1678 <entry>&gt; 0</entry>
1679 </row>
1680 <row>
1681 <entry><varname>maintenance</varname></entry>
1682 <entry><para>The rescue or emergency target is
1683 active.</para></entry>
1684 <entry>&gt; 0</entry>
1685 </row>
1686 <row>
1687 <entry><varname>stopping</varname></entry>
1688 <entry><para>The manager is shutting
1689 down.</para></entry>
1690 <entry>&gt; 0</entry>
1691 </row>
1692 <row>
1693 <entry><varname>offline</varname></entry>
1694 <entry><para>The manager is not
1695 running. Specifically, this is the operational
1696 state if an incompatible program is running as
1697 system manager (PID 1).</para></entry>
1698 <entry>&gt; 0</entry>
1699 </row>
1700 <row>
1701 <entry><varname>unknown</varname></entry>
1702 <entry><para>The operational state could not be
1703 determined, due to lack of resources or another
1704 error cause.</para></entry>
1705 <entry>&gt; 0</entry>
1706 </row>
1707 </tbody>
1708 </tgroup>
1709 </table>
1710 </listitem>
1711 </varlistentry>
1712
1713 <varlistentry>
1714 <term><command>default</command></term>
1715
1716 <listitem>
1717 <para>Enter default mode. This is equivalent to <command>systemctl isolate default.target</command>. This
1718 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
1719 </listitem>
1720 </varlistentry>
1721
1722 <varlistentry>
1723 <term><command>rescue</command></term>
1724
1725 <listitem>
1726 <para>Enter rescue mode. This is equivalent to <command>systemctl isolate rescue.target</command>. This
1727 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
1728 </listitem>
1729 </varlistentry>
1730 <varlistentry>
1731 <term><command>emergency</command></term>
1732
1733 <listitem>
1734 <para>Enter emergency mode. This is equivalent to <command>systemctl isolate
1735 emergency.target</command>. This operation is blocking by default, use <option>--no-block</option> to
1736 request asynchronous behavior.</para>
1737 </listitem>
1738 </varlistentry>
1739 <varlistentry>
1740 <term><command>halt</command></term>
1741
1742 <listitem>
1743 <para>Shut down and halt the system. This is mostly equivalent to <command>systemctl start halt.target
1744 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This command is
1745 asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note
1746 that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered
1747 on. Use <command>systemctl poweroff</command> for powering off the system (see below).</para>
1748
1749 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1750 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1751 system halt. If <option>--force</option> is specified twice, the operation is immediately executed without
1752 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1753 <option>--force</option> is specified twice the halt operation is executed by <command>systemctl</command>
1754 itself, and the system manager is not contacted. This means the command should succeed even when the system
1755 manager has crashed.</para>
1756 </listitem>
1757 </varlistentry>
1758 <varlistentry>
1759 <term><command>poweroff</command></term>
1760
1761 <listitem>
1762 <para>Shut down and power-off the system. This is mostly equivalent to <command>systemctl start
1763 poweroff.target --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all
1764 users. This command is asynchronous; it will return after the power-off operation is enqueued, without
1765 waiting for it to complete.</para>
1766
1767 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1768 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1769 powering off. If <option>--force</option> is specified twice, the operation is immediately executed without
1770 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1771 <option>--force</option> is specified twice the power-off operation is executed by
1772 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
1773 succeed even when the system manager has crashed.</para>
1774 </listitem>
1775 </varlistentry>
1776 <varlistentry>
1777 <term><command>reboot</command> <optional><replaceable>arg</replaceable></optional></term>
1778
1779 <listitem>
1780 <para>Shut down and reboot the system. This is mostly equivalent to <command>systemctl start reboot.target
1781 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This
1782 command is asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1783 complete.</para>
1784
1785 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1786 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1787 reboot. If <option>--force</option> is specified twice, the operation is immediately executed without
1788 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1789 <option>--force</option> is specified twice the reboot operation is executed by
1790 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
1791 succeed even when the system manager has crashed.</para>
1792
1793 <para>If the optional argument <replaceable>arg</replaceable> is given, it will be passed as the optional
1794 argument to the <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1795 system call. The value is architecture and firmware specific. As an example, <literal>recovery</literal>
1796 might be used to trigger system recovery, and <literal>fota</literal> might be used to trigger a
1797 <quote>firmware over the air</quote> update.</para>
1798 </listitem>
1799 </varlistentry>
1800
1801 <varlistentry>
1802 <term><command>kexec</command></term>
1803
1804 <listitem>
1805 <para>Shut down and reboot the system via <command>kexec</command>. This is equivalent to
1806 <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block</command>. This command is
1807 asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1808 complete.</para>
1809
1810 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1811 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1812 reboot.</para>
1813 </listitem>
1814 </varlistentry>
1815
1816 <varlistentry>
1817 <term><command>exit</command> <optional><replaceable>EXIT_CODE</replaceable></optional></term>
1818
1819 <listitem>
1820 <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in
1821 conjunction with the <option>--user</option> option) or in containers and is equivalent to
1822 <command>poweroff</command> otherwise. This command is asynchronous; it will return after the exit
1823 operation is enqueued, without waiting for it to complete.</para>
1824
1825 <para>The service manager will exit with the specified exit code, if
1826 <replaceable>EXIT_CODE</replaceable> is passed.</para>
1827 </listitem>
1828 </varlistentry>
1829
1830 <varlistentry>
1831 <term><command>switch-root</command> <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></term>
1832
1833 <listitem>
1834 <para>Switches to a different root directory and executes a new system manager process below it. This is
1835 intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager
1836 process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host
1837 volume. This call takes two arguments: the directory that is to become the new root directory, and the path
1838 to the new system manager binary below it to execute as PID 1. If the latter is omitted or the empty
1839 string, a systemd binary will automatically be searched for and used as init. If the system manager path is
1840 omitted, equal to the empty string or identical to the path to the systemd binary, the state of the
1841 initrd's system manager process is passed to the main system manager, which allows later introspection of
1842 the state of the services involved in the initrd boot phase.</para>
1843 </listitem>
1844 </varlistentry>
1845
1846 <varlistentry>
1847 <term><command>suspend</command></term>
1848
1849 <listitem>
1850 <para>Suspend the system. This will trigger activation of the special target unit
1851 <filename>suspend.target</filename>. This command is asynchronous, and will return after the suspend
1852 operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.</para>
1853 </listitem>
1854 </varlistentry>
1855
1856 <varlistentry>
1857 <term><command>hibernate</command></term>
1858
1859 <listitem>
1860 <para>Hibernate the system. This will trigger activation of the special target unit
1861 <filename>hibernate.target</filename>. This command is asynchronous, and will return after the hibernation
1862 operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.</para>
1863 </listitem>
1864 </varlistentry>
1865
1866 <varlistentry>
1867 <term><command>hybrid-sleep</command></term>
1868
1869 <listitem>
1870 <para>Hibernate and suspend the system. This will trigger activation of the special target unit
1871 <filename>hybrid-sleep.target</filename>. This command is asynchronous, and will return after the hybrid
1872 sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.</para>
1873 </listitem>
1874 </varlistentry>
1875 </variablelist>
1876 </refsect2>
1877
1878 <refsect2>
1879 <title>Parameter Syntax</title>
1880
1881 <para>Unit commands listed above take either a single unit name (designated as <replaceable>UNIT</replaceable>),
1882 or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the
1883 unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"),
1884 systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in
1885 case of commands which operate only on specific unit types. For example,
1886 <programlisting># systemctl start sshd</programlisting> and
1887 <programlisting># systemctl start sshd.service</programlisting>
1888 are equivalent, as are
1889 <programlisting># systemctl isolate default</programlisting>
1890 and
1891 <programlisting># systemctl isolate default.target</programlisting>
1892 Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
1893 paths to mount unit names.
1894 <programlisting># systemctl status /dev/sda
1895 # systemctl status /home</programlisting>
1896 are equivalent to:
1897 <programlisting># systemctl status dev-sda.device
1898 # systemctl status home.mount</programlisting>
1899 In the second case, shell-style globs will be matched against the primary names of all units currently in memory;
1900 literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
1901 names always refer to exactly one unit, but globs may match zero units and this is not considered an
1902 error.</para>
1903
1904 <para>Glob patterns use
1905 <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1906 so normal shell-style globbing rules are used, and
1907 <literal>*</literal>, <literal>?</literal>,
1908 <literal>[]</literal> may be used. See
1909 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1910 for more details. The patterns are matched against the primary names of
1911 units currently in memory, and patterns which do not match anything
1912 are silently skipped. For example:
1913 <programlisting># systemctl stop sshd@*.service</programlisting>
1914 will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
1915 in memory are not considered for glob expansion.
1916 </para>
1917
1918 <para>For unit file commands, the specified <replaceable>UNIT</replaceable> should be the name of the unit file
1919 (possibly abbreviated, see above), or the absolute path to the unit file:
1920 <programlisting># systemctl enable foo.service</programlisting>
1921 or
1922 <programlisting># systemctl link /path/to/foo.service</programlisting>
1923 </para>
1924 </refsect2>
1925
1926 </refsect1>
1927
1928 <refsect1>
1929 <title>Exit status</title>
1930
1931 <para>On success, 0 is returned, a non-zero failure
1932 code otherwise.</para>
1933 </refsect1>
1934
1935 <refsect1>
1936 <title>Environment</title>
1937
1938 <variablelist class='environment-variables'>
1939 <varlistentry>
1940 <term><varname>$SYSTEMD_EDITOR</varname></term>
1941
1942 <listitem><para>Editor to use when editing units; overrides
1943 <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither
1944 <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor
1945 <varname>$VISUAL</varname> are present or if it is set to an empty
1946 string or if their execution failed, systemctl will try to execute well
1947 known editors in this order:
1948 <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1949 <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1950 <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1951 <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1952 </para></listitem>
1953 </varlistentry>
1954 </variablelist>
1955 <xi:include href="less-variables.xml" xpointer="pager"/>
1956 <xi:include href="less-variables.xml" xpointer="less"/>
1957 <xi:include href="less-variables.xml" xpointer="lesscharset"/>
1958 </refsect1>
1959
1960 <refsect1>
1961 <title>See Also</title>
1962 <para>
1963 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1964 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1965 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1966 <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1967 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1968 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1969 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1970 <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1971 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1972 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1973 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1974 </para>
1975 </refsect1>
1976
1977 </refentry>