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