]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemctl.xml
man: document that link-ed files must be on /
[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>This is the default command.</para>
696 </listitem>
697 </varlistentry>
698
699 <varlistentry>
700 <term><command>list-sockets <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
701
702 <listitem>
703 <para>List socket units currently in memory, ordered by listening address. If one or more
704 <replaceable>PATTERN</replaceable>s are specified, only socket units matching one of them are
705 shown. Produces output similar to
706 <programlisting>
707 LISTEN UNIT ACTIVATES
708 /dev/initctl systemd-initctl.socket systemd-initctl.service
709 …
710 [::]:22 sshd.socket sshd.service
711 kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
712
713 5 sockets listed.</programlisting>
714 Note: because the addresses might contains spaces, this output
715 is not suitable for programmatic consumption.
716 </para>
717
718 <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para>
719 </listitem>
720 </varlistentry>
721
722 <varlistentry>
723 <term><command>list-timers <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
724
725 <listitem>
726 <para>List timer units currently in memory, ordered by the time they elapse next. If one or more
727 <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown.
728 Produces output similar to
729 <programlisting>
730 NEXT LEFT LAST PASSED UNIT ACTIVATES
731 n/a n/a Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service
732 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
733 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
734 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
735 </programlisting>
736 </para>
737
738 <para><emphasis>NEXT</emphasis> shows the next time the timer will run.</para>
739 <para><emphasis>LEFT</emphasis> shows how long till the next time the timer runs.</para>
740 <para><emphasis>LAST</emphasis> shows the last time the timer ran.</para>
741 <para><emphasis>PASSED</emphasis> shows has long as passed since the timer laset ran.</para>
742 <para><emphasis>UNIT</emphasis> shows the name of the timer</para>
743 <para><emphasis>ACTIVATES</emphasis> shows the name the service the timer activates when it runs.</para>
744
745 <para>Also see <option>--all</option> and <option>--state=</option>.</para>
746 </listitem>
747 </varlistentry>
748
749 <varlistentry>
750 <term><command>start <replaceable>PATTERN</replaceable>…</command></term>
751
752 <listitem>
753 <para>Start (activate) one or more units specified on the
754 command line.</para>
755
756 <para>Note that glob patterns operate on the set of primary names of units currently in memory. Units which
757 are not active and are not in a failed state usually are not in memory, and will not be matched by any
758 pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until
759 the instance has been started. Therefore, using glob patterns with <command>start</command> has limited
760 usefulness. Also, secondary alias names of units are not considered.</para>
761 </listitem>
762 </varlistentry>
763 <varlistentry>
764 <term><command>stop <replaceable>PATTERN</replaceable>…</command></term>
765
766 <listitem>
767 <para>Stop (deactivate) one or more units specified on the
768 command line.</para>
769 </listitem>
770 </varlistentry>
771 <varlistentry>
772 <term><command>reload <replaceable>PATTERN</replaceable>…</command></term>
773
774 <listitem>
775 <para>Asks all units listed on the command line to reload
776 their configuration. Note that this will reload the
777 service-specific configuration, not the unit configuration
778 file of systemd. If you want systemd to reload the
779 configuration file of a unit, use the
780 <command>daemon-reload</command> command. In other words:
781 for the example case of Apache, this will reload Apache's
782 <filename>httpd.conf</filename> in the web server, not the
783 <filename>apache.service</filename> systemd unit
784 file.</para>
785
786 <para>This command should not be confused with the
787 <command>daemon-reload</command> command.</para>
788 </listitem>
789
790 </varlistentry>
791 <varlistentry>
792 <term><command>restart <replaceable>PATTERN</replaceable>…</command></term>
793
794 <listitem>
795 <para>Stop and then start one or more units specified on the command line. If the units are not running
796 yet, they will be started.</para>
797
798 <para>Note that restarting a unit with this command does not necessarily flush out all of the unit's
799 resources before it is started again. For example, the per-service file descriptor storage facility (see
800 <varname>FileDescriptoreStoreMax=</varname> in
801 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>) will
802 remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and
803 no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a
804 restart operation an explicit <command>systemctl stop</command> command followed by <command>systemctl
805 start</command> should be issued.</para>
806 </listitem>
807 </varlistentry>
808 <varlistentry>
809 <term><command>try-restart <replaceable>PATTERN</replaceable>…</command></term>
810
811 <listitem>
812 <para>Stop and then start one or more units specified on the
813 command line if the units are running. This does nothing
814 if units are not running.</para>
815 <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally
816 don't document that. -->
817 </listitem>
818 </varlistentry>
819 <varlistentry>
820 <term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
821
822 <listitem>
823 <para>Reload one or more units if they support it. If not, stop and then start them instead. If the units
824 are not running yet, they will be started.</para>
825 </listitem>
826 </varlistentry>
827 <varlistentry>
828 <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
829
830 <listitem>
831 <para>Reload one or more units if they support it. If not, stop and then start them instead. This does
832 nothing if the units are not running.</para>
833 <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
834 don't document that. -->
835 </listitem>
836 </varlistentry>
837 <varlistentry>
838 <term><command>isolate <replaceable>UNIT</replaceable></command></term>
839
840 <listitem>
841 <para>Start the unit specified on the command line and its dependencies
842 and stop all others, unless they have
843 <option>IgnoreOnIsolate=yes</option> (see
844 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
845 If a unit name with no extension is given, an extension of
846 <literal>.target</literal> will be assumed.</para>
847
848 <para>This is similar to changing the runlevel in a
849 traditional init system. The <command>isolate</command>
850 command will immediately stop processes that are not enabled
851 in the new unit, possibly including the graphical
852 environment or terminal you are currently using.</para>
853
854 <para>Note that this is allowed only on units where
855 <option>AllowIsolate=</option> is enabled. See
856 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
857 for details.</para>
858 </listitem>
859 </varlistentry>
860 <varlistentry>
861 <term><command>kill <replaceable>PATTERN</replaceable>…</command></term>
862
863 <listitem>
864 <para>Send a signal to one or more processes of the
865 unit. Use <option>--kill-who=</option> to select which
866 process to kill. Use <option>--signal=</option> to select
867 the signal to send.</para>
868 </listitem>
869 </varlistentry>
870 <varlistentry>
871 <term><command>is-active <replaceable>PATTERN</replaceable>…</command></term>
872
873 <listitem>
874 <para>Check whether any of the specified units are active
875 (i.e. running). Returns an exit code
876 <constant>0</constant> if at least one is active, or
877 non-zero otherwise. Unless <option>--quiet</option> is
878 specified, this will also print the current unit state to
879 standard output.</para>
880 </listitem>
881 </varlistentry>
882 <varlistentry>
883 <term><command>is-failed <replaceable>PATTERN</replaceable>…</command></term>
884
885 <listitem>
886 <para>Check whether any of the specified units are in a
887 "failed" state. Returns an exit code
888 <constant>0</constant> if at least one has failed,
889 non-zero otherwise. Unless <option>--quiet</option> is
890 specified, this will also print the current unit state to
891 standard output.</para>
892 </listitem>
893 </varlistentry>
894 <varlistentry>
895 <term><command>status</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…]</optional></term>
896
897 <listitem>
898 <para>Show terse runtime status information about one or
899 more units, followed by most recent log data from the
900 journal. If no units are specified, show system status. If
901 combined with <option>--all</option>, also show the status of
902 all units (subject to limitations specified with
903 <option>-t</option>). If a PID is passed, show information
904 about the unit the process belongs to.</para>
905
906 <para>This function is intended to generate human-readable
907 output. If you are looking for computer-parsable output,
908 use <command>show</command> instead. By default, this
909 function only shows 10 lines of output and ellipsizes
910 lines to fit in the terminal window. This can be changed
911 with <option>--lines</option> and <option>--full</option>,
912 see above. In addition, <command>journalctl
913 --unit=<replaceable>NAME</replaceable></command> or
914 <command>journalctl
915 --user-unit=<replaceable>NAME</replaceable></command> use
916 a similar filter for messages and might be more
917 convenient.
918 </para>
919
920 <para>systemd implicitly loads units as necessary, so just running the <command>status</command> will
921 attempt to load a file. The command is thus not useful for determining if something was already loaded or
922 not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason
923 to keep it in memory thereafter.
924 </para>
925
926 <example>
927 <title>Example output from systemctl status </title>
928
929 <programlisting>$ systemctl status bluetooth
930 â—Ź bluetooth.service - Bluetooth service
931 Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
932 Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
933 Docs: man:bluetoothd(8)
934 Main PID: 930 (bluetoothd)
935 Status: "Running"
936 Tasks: 1
937 Memory: 648.0K
938 CPU: 435ms
939 CGroup: /system.slice/bluetooth.service
940 └─930 /usr/lib/bluetooth/bluetoothd
941
942 Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service
943 Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered
944 Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5)
945 </programlisting>
946
947 <para>The dot ("â—Ź") uses color on supported terminals to summarize the unit state at a glance. White
948 indicates an <literal>inactive</literal> or <literal>deactivating</literal> state. Red indicates a
949 <literal>failed</literal> or <literal>error</literal> state and green indicates an
950 <literal>active</literal>, <literal>reloading</literal> or <literal>activating</literal> state.
951 </para>
952
953 <para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been loaded into
954 memory. Other possible values for "Loaded:" include: <literal>error</literal> if there was a problem
955 loading it, <literal>not-found</literal>, and <literal>masked</literal>. Along with showing the path to
956 the unit file, this line will also show the enablement state. Enabled commands start at boot. See the
957 full table of possible enablement states — including the definition of <literal>masked</literal> — in the
958 documentation for the <command>is-enabled</command> command.
959 </para>
960
961 <para>The "Active:" line shows active state. The value is usually <literal>active</literal> or
962 <literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the unit type.
963 The unit could also be in process of changing states, reporting a state of <literal>activating</literal> or
964 <literal>deactivating</literal>. A special <literal>failed</literal> state is entered when the service
965 failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is
966 entered the cause will be logged for later reference.</para>
967 </example>
968
969 </listitem>
970 </varlistentry>
971 <varlistentry>
972 <term><command>show</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>JOB</replaceable>…</optional></term>
973
974 <listitem>
975 <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified,
976 properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and
977 if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use
978 <option>--all</option> to show those too. To select specific properties to show, use
979 <option>--property=</option>. This command is intended to be used whenever computer-parsable output is
980 required. Use <command>status</command> if you are looking for formatted human-readable output.</para>
981
982 <para>Many properties shown by <command>systemctl show</command> map directly to configuration settings of
983 the system and service manager and its unit files. Note that the properties shown by the command are
984 generally more low-level, normalized versions of the original configuration settings and expose runtime
985 state in addition to configuration. For example, properties shown for service units include the service's
986 current main process identifier as <literal>MainPID</literal> (which is runtime state), and time settings
987 are always exposed as properties ending in the <literal>…USec</literal> suffix even if a matching
988 configuration options end in <literal>…Sec</literal>, because microseconds is the normalized time unit used
989 by the system and service manager.</para>
990 </listitem>
991 </varlistentry>
992 <varlistentry>
993 <term><command>cat <replaceable>PATTERN</replaceable>…</command></term>
994
995 <listitem>
996 <para>Show backing files of one or more units. Prints the
997 "fragment" and "drop-ins" (source files) of units. Each
998 file is preceded by a comment which includes the file
999 name. Note that this shows the contents of the backing files
1000 on disk, which may not match the system manager's
1001 understanding of these units if any unit files were
1002 updated on disk and the <command>daemon-reload</command>
1003 command wasn't issued since.</para>
1004 </listitem>
1005 </varlistentry>
1006 <varlistentry>
1007 <term><command>set-property <replaceable>UNIT</replaceable> <replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable>…</command></term>
1008
1009 <listitem>
1010 <para>Set the specified unit properties at runtime where
1011 this is supported. This allows changing configuration
1012 parameter properties such as resource control settings at
1013 runtime. Not all properties may be changed at runtime, but
1014 many resource control settings (primarily those in
1015 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
1016 may. The changes are applied immediately, and stored on disk
1017 for future boots, unless <option>--runtime</option> is
1018 passed, in which case the settings only apply until the
1019 next reboot. The syntax of the property assignment follows
1020 closely the syntax of assignments in unit files.</para>
1021
1022 <para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para>
1023
1024 <para>If the specified unit appears to be inactive, the
1025 changes will be only stored on disk as described
1026 previously hence they will be effective when the unit will
1027 be started.</para>
1028
1029 <para>Note that this command allows changing multiple
1030 properties at the same time, which is preferable over
1031 setting them individually. Like with unit file configuration
1032 settings, assigning an empty list will reset the property.
1033 </para>
1034 </listitem>
1035 </varlistentry>
1036
1037 <varlistentry>
1038 <term><command>help <replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…</command></term>
1039
1040 <listitem>
1041 <para>Show manual pages for one or more units, if
1042 available. If a PID is given, the manual pages for the unit
1043 the process belongs to are shown.</para>
1044 </listitem>
1045 </varlistentry>
1046
1047 <varlistentry>
1048 <term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term>
1049
1050 <listitem>
1051 <para>Reset the <literal>failed</literal> state of the specified units, or if no unit name is passed, reset
1052 the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code,
1053 terminating abnormally or timing out), it will automatically enter the <literal>failed</literal> state and
1054 its exit code and status is recorded for introspection by the administrator until the service is
1055 stopped/re-started or reset with this command.</para>
1056 </listitem>
1057 </varlistentry>
1058
1059 <varlistentry>
1060 <term>
1061 <command>list-dependencies</command>
1062 <optional><replaceable>UNIT</replaceable></optional>
1063 </term>
1064
1065 <listitem>
1066 <para>Shows units required and wanted by the specified
1067 unit. This recursively lists units following the
1068 <varname>Requires=</varname>,
1069 <varname>Requisite=</varname>,
1070 <varname>ConsistsOf=</varname>,
1071 <varname>Wants=</varname>, <varname>BindsTo=</varname>
1072 dependencies. If no unit is specified,
1073 <filename>default.target</filename> is implied.</para>
1074
1075 <para>By default, only target units are recursively
1076 expanded. When <option>--all</option> is passed, all other
1077 units are recursively expanded as well.</para>
1078
1079 <para>Options <option>--reverse</option>,
1080 <option>--after</option>, <option>--before</option>
1081 may be used to change what types of dependencies
1082 are shown.</para>
1083 </listitem>
1084 </varlistentry>
1085 </variablelist>
1086 </refsect2>
1087
1088 <refsect2>
1089 <title>Unit File Commands</title>
1090
1091 <variablelist>
1092 <varlistentry>
1093 <term><command>list-unit-files <optional><replaceable>PATTERN…</replaceable></optional></command></term>
1094
1095 <listitem>
1096 <para>List unit files installed on the system, in combination with their enablement state (as reported by
1097 <command>is-enabled</command>). If one or more <replaceable>PATTERN</replaceable>s are specified, only unit
1098 files whose name matches one of them are shown (patterns matching unit file system paths are not
1099 supported).</para>
1100 </listitem>
1101 </varlistentry>
1102
1103 <varlistentry>
1104 <term><command>enable <replaceable>UNIT</replaceable>…</command></term>
1105 <term><command>enable <replaceable>PATH</replaceable>…</command></term>
1106
1107 <listitem>
1108 <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the
1109 <literal>[Install]</literal> sections of the indicated unit files. After the symlinks have been created,
1110 the system manager configuration is reloaded (in a way equivalent to <command>daemon-reload</command>), in
1111 order to ensure the changes are taken into account immediately. Note that this does
1112 <emphasis>not</emphasis> have the effect of also starting any of the units being enabled. If this is
1113 desired, combine this command with the <option>--now</option> switch, or invoke <command>start</command>
1114 with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of
1115 the form <filename>foo@bar.service</filename>), symlinks named the same as instances are created in the
1116 unit configuration directory, however they point to the single template unit file they are instantiated
1117 from.</para>
1118
1119 <para>This command expects either valid unit names (in which case various unit file directories are
1120 automatically searched for unit files with appropriate names), or absolute paths to unit files (in which
1121 case these files are read directly). If a specified unit file is located outside of the usual unit file
1122 directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring
1123 it is found when requested by commands such as <command>start</command>. The file system where the linked
1124 unit files are located must be accessible when systemd is started (e.g. anything underneath
1125 <filename>/home</filename> or <filename>/var</filename> is not allowed, unless those directories are
1126 located on the root file system).</para>
1127
1128 <para>This command will print the file system operations executed. This output may be suppressed by passing
1129 <option>--quiet</option>.
1130 </para>
1131
1132 <para>Note that this operation creates only the symlinks suggested in the <literal>[Install]</literal>
1133 section of the unit files. While this command is the recommended way to manipulate the unit configuration
1134 directory, the administrator is free to make additional changes manually by placing or removing symlinks
1135 below this directory. This is particularly useful to create configurations that deviate from the suggested
1136 default installation. In this case, the administrator must make sure to invoke
1137 <command>daemon-reload</command> manually as necessary, in order to ensure the changes are taken into
1138 account.
1139 </para>
1140
1141 <para>Enabling units should not be confused with starting (activating) units, as done by the
1142 <command>start</command> command. Enabling and starting units is orthogonal: units may be enabled without
1143 being started and started without being enabled. Enabling simply hooks the unit into various suggested
1144 places (for example, so that the unit is automatically started on boot or when a particular kind of
1145 hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds
1146 the socket (in case of socket units), and so on.</para>
1147
1148 <para>Depending on whether <option>--system</option>, <option>--user</option>, <option>--runtime</option>,
1149 or <option>--global</option> is specified, this enables the unit for the system, for the calling user only,
1150 for only this boot of the system, or for all future logins of all users. Note that in the last case, no
1151 systemd daemon configuration is reloaded.</para>
1152
1153 <para>Using <command>enable</command> on masked units is not supported and results in an error.</para>
1154 </listitem>
1155 </varlistentry>
1156
1157 <varlistentry>
1158 <term><command>disable <replaceable>UNIT</replaceable>…</command></term>
1159
1160 <listitem>
1161 <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units
1162 from the unit configuration directory, and hence undoes any changes made by <command>enable</command> or
1163 <command>link</command>. Note that this removes <emphasis>all</emphasis> symlinks to matching unit files,
1164 including manually created symlinks, and not just those actually created by <command>enable</command> or
1165 <command>link</command>. Note that while <command>disable</command> undoes the effect of
1166 <command>enable</command>, the two commands are otherwise not symmetric, as <command>disable</command> may
1167 remove more symlinks than a prior <command>enable</command> invocation of the same unit created.</para>
1168
1169 <para>This command expects valid unit names only, it does not accept paths to unit files.</para>
1170
1171 <para>In addition to the units specified as arguments, all units are disabled that are listed in the
1172 <varname>Also=</varname> setting contained in the <literal>[Install]</literal> section of any of the unit
1173 files being operated on.</para>
1174
1175 <para>This command implicitly reloads the system manager configuration after completing the operation. Note
1176 that this command does not implicitly stop the units that are being disabled. If this is desired, either
1177 combine this command with the <option>--now</option> switch, or invoke the <command>stop</command> command
1178 with appropriate arguments later.</para>
1179
1180 <para>This command will print information about the file system operations (symlink removals)
1181 executed. This output may be suppressed by passing <option>--quiet</option>.
1182 </para>
1183
1184 <para>This command honors <option>--system</option>, <option>--user</option>, <option>--runtime</option>
1185 and <option>--global</option> in a similar way as <command>enable</command>.</para>
1186 </listitem>
1187 </varlistentry>
1188
1189 <varlistentry>
1190 <term><command>reenable <replaceable>UNIT</replaceable>…</command></term>
1191
1192 <listitem>
1193 <para>Reenable one or more units, as specified on the command line. This is a combination of
1194 <command>disable</command> and <command>enable</command> and is useful to reset the symlinks a unit file is
1195 enabled with to the defaults configured in its <literal>[Install]</literal> section. This command expects
1196 a unit name only, it does not accept paths to unit files.</para>
1197 </listitem>
1198 </varlistentry>
1199
1200 <varlistentry>
1201 <term><command>preset <replaceable>UNIT</replaceable>…</command></term>
1202
1203 <listitem>
1204 <para>Reset the enable/disable status one or more unit files, as specified on
1205 the command line, to the defaults configured in the preset policy files. This
1206 has the same effect as <command>disable</command> or
1207 <command>enable</command>, depending how the unit is listed in the preset
1208 files.</para>
1209
1210 <para>Use <option>--preset-mode=</option> to control whether units shall be
1211 enabled and disabled, or only enabled, or only disabled.</para>
1212
1213 <para>If the unit carries no install information, it will be silently ignored
1214 by this command. <replaceable>UNIT</replaceable> must be the real unit name,
1215 any alias names are ignored silently.</para>
1216
1217 <para>For more information on the preset policy format, see
1218 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1219 For more information on the concept of presets, please consult the
1220 <ulink url="https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink>
1221 document.</para>
1222 </listitem>
1223 </varlistentry>
1224
1225 <varlistentry>
1226 <term><command>preset-all</command></term>
1227
1228 <listitem>
1229 <para>Resets all installed unit files to the defaults
1230 configured in the preset policy file (see above).</para>
1231
1232 <para>Use <option>--preset-mode=</option> to control
1233 whether units shall be enabled and disabled, or only
1234 enabled, or only disabled.</para>
1235 </listitem>
1236 </varlistentry>
1237
1238 <varlistentry>
1239 <term><command>is-enabled <replaceable>UNIT</replaceable>…</command></term>
1240
1241 <listitem>
1242 <para>Checks whether any of the specified unit files are
1243 enabled (as with <command>enable</command>). Returns an
1244 exit code of 0 if at least one is enabled, non-zero
1245 otherwise. Prints the current enable status (see table).
1246 To suppress this output, use <option>--quiet</option>.
1247 To show installation targets, use <option>--full</option>.
1248 </para>
1249
1250 <table>
1251 <title>
1252 <command>is-enabled</command> output
1253 </title>
1254
1255 <tgroup cols='3'>
1256 <thead>
1257 <row>
1258 <entry>Name</entry>
1259 <entry>Description</entry>
1260 <entry>Exit Code</entry>
1261 </row>
1262 </thead>
1263 <tbody>
1264 <row>
1265 <entry><literal>enabled</literal></entry>
1266 <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>
1267 <entry morerows='1'>0</entry>
1268 </row>
1269 <row>
1270 <entry><literal>enabled-runtime</literal></entry>
1271 </row>
1272 <row>
1273 <entry><literal>linked</literal></entry>
1274 <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>
1275 <entry morerows='1'>&gt; 0</entry>
1276 </row>
1277 <row>
1278 <entry><literal>linked-runtime</literal></entry>
1279 </row>
1280 <row>
1281 <entry><literal>masked</literal></entry>
1282 <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>
1283 <entry morerows='1'>&gt; 0</entry>
1284 </row>
1285 <row>
1286 <entry><literal>masked-runtime</literal></entry>
1287 </row>
1288 <row>
1289 <entry><literal>static</literal></entry>
1290 <entry>The unit file is not enabled, and has no provisions for enabling in the <literal>[Install]</literal> unit file section.</entry>
1291 <entry>0</entry>
1292 </row>
1293 <row>
1294 <entry><literal>indirect</literal></entry>
1295 <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>
1296 <entry>0</entry>
1297 </row>
1298 <row>
1299 <entry><literal>disabled</literal></entry>
1300 <entry>The unit file is not enabled, but contains an <literal>[Install]</literal> section with installation instructions.</entry>
1301 <entry>&gt; 0</entry>
1302 </row>
1303 <row>
1304 <entry><literal>generated</literal></entry>
1305 <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>
1306 <entry>0</entry>
1307 </row>
1308 <row>
1309 <entry><literal>transient</literal></entry>
1310 <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry>
1311 <entry>0</entry>
1312 </row>
1313 <row>
1314 <entry><literal>bad</literal></entry>
1315 <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>
1316 <entry>&gt; 0</entry>
1317 </row>
1318 </tbody>
1319 </tgroup>
1320 </table>
1321
1322 </listitem>
1323 </varlistentry>
1324
1325 <varlistentry>
1326 <term><command>mask <replaceable>UNIT</replaceable>…</command></term>
1327
1328 <listitem>
1329 <para>Mask one or more units, as specified on the command line. This will link these unit files to
1330 <filename>/dev/null</filename>, making it impossible to start them. This is a stronger version of
1331 <command>disable</command>, since it prohibits all kinds of activation of the unit, including enablement
1332 and manual activation. Use this option with care. This honors the <option>--runtime</option> option to only
1333 mask temporarily until the next reboot of the system. The <option>--now</option> option may be used to
1334 ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit
1335 file paths.</para>
1336 </listitem>
1337 </varlistentry>
1338
1339 <varlistentry>
1340 <term><command>unmask <replaceable>UNIT</replaceable>…</command></term>
1341
1342 <listitem>
1343 <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of
1344 <command>mask</command>. This command expects valid unit names only, it does not accept unit file
1345 paths.</para>
1346 </listitem>
1347 </varlistentry>
1348
1349 <varlistentry>
1350 <term><command>link <replaceable>PATH</replaceable>…</command></term>
1351
1352 <listitem>
1353 <para>Link a unit file that is not in the unit file search paths into the unit file search path. This
1354 command expects an absolute path to a unit file. The effect of this may be undone with
1355 <command>disable</command>. The effect of this command is that a unit file is made available for commands
1356 such as <command>start</command>, even though it is not installed directly in the unit search path. The
1357 file system where the linked unit files are located must be accessible when systemd is started
1358 (e.g. anything underneath <filename>/home</filename> or <filename>/var</filename> is not allowed, unless
1359 those directories are located on the root file system).</para>
1360 </listitem>
1361 </varlistentry>
1362
1363 <varlistentry>
1364 <term><command>revert <replaceable>UNIT</replaceable>…</command></term>
1365
1366 <listitem>
1367 <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration
1368 files that modify the specified units, as well as any user-configured unit file that overrides a matching
1369 vendor supplied unit file. Specifically, for a unit <literal>foo.service</literal> the matching directories
1370 <literal>foo.service.d/</literal> with all their contained files are removed, both below the persistent and
1371 runtime configuration directories (i.e. below <filename>/etc/systemd/system</filename> and
1372 <filename>/run/systemd/system</filename>); if the unit file has a vendor-supplied version (i.e. a unit file
1373 located below <filename>/usr</filename>) any matching persistent or runtime unit file that overrides it is
1374 removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below
1375 <filename>/etc/systemd/system</filename> or <filename>/run/systemd/system</filename>, but not in a unit
1376 file stored below <filename>/usr</filename>), then it is not removed. Also, if a unit is masked, it is
1377 unmasked.</para>
1378
1379 <para>Effectively, this command may be used to undo all changes made with <command>systemctl
1380 edit</command>, <command>systemctl set-property</command> and <command>systemctl mask</command> and puts
1381 the original unit file with its settings back in effect.</para>
1382 </listitem>
1383 </varlistentry>
1384
1385 <varlistentry>
1386 <term><command>add-wants <replaceable>TARGET</replaceable>
1387 <replaceable>UNIT</replaceable>…</command></term>
1388 <term><command>add-requires <replaceable>TARGET</replaceable>
1389 <replaceable>UNIT</replaceable>…</command></term>
1390
1391 <listitem>
1392 <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal>
1393 dependencies, respectively, to the specified
1394 <replaceable>TARGET</replaceable> for one or more units. </para>
1395
1396 <para>This command honors <option>--system</option>,
1397 <option>--user</option>, <option>--runtime</option> and
1398 <option>--global</option> in a way similar to
1399 <command>enable</command>.</para>
1400
1401 </listitem>
1402 </varlistentry>
1403
1404 <varlistentry>
1405 <term><command>edit <replaceable>UNIT</replaceable>…</command></term>
1406
1407 <listitem>
1408 <para>Edit a drop-in snippet or a whole replacement file if
1409 <option>--full</option> is specified, to extend or override the
1410 specified unit.</para>
1411
1412 <para>Depending on whether <option>--system</option> (the default),
1413 <option>--user</option>, or <option>--global</option> is specified,
1414 this command creates a drop-in file for each unit either for the system,
1415 for the calling user, or for all futures logins of all users. Then,
1416 the editor (see the "Environment" section below) is invoked on
1417 temporary files which will be written to the real location if the
1418 editor exits successfully.</para>
1419
1420 <para>If <option>--full</option> is specified, this will copy the
1421 original units instead of creating drop-in files.</para>
1422
1423 <para>If <option>--force</option> is specified and any units do
1424 not already exist, new unit files will be opened for editing.</para>
1425
1426 <para>If <option>--runtime</option> is specified, the changes will
1427 be made temporarily in <filename>/run</filename> and they will be
1428 lost on the next reboot.</para>
1429
1430 <para>If the temporary file is empty upon exit, the modification of
1431 the related unit is canceled.</para>
1432
1433 <para>After the units have been edited, systemd configuration is
1434 reloaded (in a way that is equivalent to <command>daemon-reload</command>).
1435 </para>
1436
1437 <para>Note that this command cannot be used to remotely edit units
1438 and that you cannot temporarily edit units which are in
1439 <filename>/etc</filename>, since they take precedence over
1440 <filename>/run</filename>.</para>
1441 </listitem>
1442 </varlistentry>
1443
1444 <varlistentry>
1445 <term><command>get-default</command></term>
1446
1447 <listitem>
1448 <para>Return the default target to boot into. This returns
1449 the target unit name <filename>default.target</filename>
1450 is aliased (symlinked) to.</para>
1451 </listitem>
1452 </varlistentry>
1453
1454 <varlistentry>
1455 <term><command>set-default <replaceable>TARGET</replaceable></command></term>
1456
1457 <listitem>
1458 <para>Set the default target to boot into. This sets
1459 (symlinks) the <filename>default.target</filename> alias
1460 to the given target unit.</para>
1461 </listitem>
1462 </varlistentry>
1463
1464 </variablelist>
1465 </refsect2>
1466
1467 <refsect2>
1468 <title>Machine Commands</title>
1469
1470 <variablelist>
1471 <varlistentry>
1472 <term><command>list-machines <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
1473
1474 <listitem>
1475 <para>List the host and all running local containers with
1476 their state. If one or more
1477 <replaceable>PATTERN</replaceable>s are specified, only
1478 containers matching one of them are shown.
1479 </para>
1480 </listitem>
1481 </varlistentry>
1482 </variablelist>
1483 </refsect2>
1484
1485 <refsect2>
1486 <title>Job Commands</title>
1487
1488 <variablelist>
1489 <varlistentry>
1490 <term><command>list-jobs <optional><replaceable>PATTERN…</replaceable></optional></command></term>
1491
1492 <listitem>
1493 <para>List jobs that are in progress. If one or more
1494 <replaceable>PATTERN</replaceable>s are specified, only
1495 jobs for units matching one of them are shown.</para>
1496
1497 <para>When combined with <option>--after</option> or <option>--before</option> the list is augmented with
1498 information on which other job each job is waiting for, and which other jobs are waiting for it, see
1499 above.</para>
1500 </listitem>
1501 </varlistentry>
1502 <varlistentry>
1503 <term><command>cancel <replaceable>JOB</replaceable>…</command></term>
1504
1505 <listitem>
1506 <para>Cancel one or more jobs specified on the command line
1507 by their numeric job IDs. If no job ID is specified, cancel
1508 all pending jobs.</para>
1509 </listitem>
1510 </varlistentry>
1511 </variablelist>
1512 </refsect2>
1513
1514 <refsect2>
1515 <title>Environment Commands</title>
1516
1517 <variablelist>
1518 <varlistentry>
1519 <term><command>show-environment</command></term>
1520
1521 <listitem>
1522 <para>Dump the systemd manager environment block. This is the environment
1523 block that is passed to all processes the manager spawns. The environment
1524 block will be dumped in straight-forward form suitable for sourcing into
1525 most shells. If no special characters or whitespace is present in the variable
1526 values, no escaping is performed, and the assignments have the form
1527 <literal>VARIABLE=value</literal>. If whitespace or characters which have
1528 special meaning to the shell are present, dollar-single-quote escaping is
1529 used, and assignments have the form <literal>VARIABLE=$'value'</literal>.
1530 This syntax is known to be supported by
1531 <citerefentry project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1532 <citerefentry project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1533 <citerefentry project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1534 and
1535 <citerefentry project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
1536 <citerefentry project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1537 but not
1538 <citerefentry project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1539 or
1540 <citerefentry project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1541 </para>
1542 </listitem>
1543 </varlistentry>
1544 <varlistentry>
1545 <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term>
1546
1547 <listitem>
1548 <para>Set one or more systemd manager environment variables,
1549 as specified on the command line.</para>
1550 </listitem>
1551 </varlistentry>
1552 <varlistentry>
1553 <term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term>
1554
1555 <listitem>
1556 <para>Unset one or more systemd manager environment
1557 variables. If only a variable name is specified, it will be
1558 removed regardless of its value. If a variable and a value
1559 are specified, the variable is only removed if it has the
1560 specified value.</para>
1561 </listitem>
1562 </varlistentry>
1563 <varlistentry>
1564 <term>
1565 <command>import-environment</command>
1566 <optional><replaceable>VARIABLE…</replaceable></optional>
1567 </term>
1568
1569 <listitem>
1570 <para>Import all, one or more environment variables set on
1571 the client into the systemd manager environment block. If
1572 no arguments are passed, the entire environment block is
1573 imported. Otherwise, a list of one or more environment
1574 variable names should be passed, whose client-side values
1575 are then imported into the manager's environment
1576 block.</para>
1577 </listitem>
1578 </varlistentry>
1579 </variablelist>
1580 </refsect2>
1581
1582 <refsect2>
1583 <title>Manager Lifecycle Commands</title>
1584
1585 <variablelist>
1586 <varlistentry>
1587 <term><command>daemon-reload</command></term>
1588
1589 <listitem>
1590 <para>Reload the systemd manager configuration. This will
1591 rerun all generators (see
1592 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>),
1593 reload all unit files, and recreate the entire dependency
1594 tree. While the daemon is being reloaded, all sockets
1595 systemd listens on behalf of user configuration will stay
1596 accessible.</para>
1597
1598 <para>This command should not be confused with the
1599 <command>reload</command> command.</para>
1600 </listitem>
1601 </varlistentry>
1602 <varlistentry>
1603 <term><command>daemon-reexec</command></term>
1604
1605 <listitem>
1606 <para>Reexecute the systemd manager. This will serialize the
1607 manager state, reexecute the process and deserialize the
1608 state again. This command is of little use except for
1609 debugging and package upgrades. Sometimes, it might be
1610 helpful as a heavy-weight <command>daemon-reload</command>.
1611 While the daemon is being reexecuted, all sockets systemd listening
1612 on behalf of user configuration will stay accessible.
1613 </para>
1614 </listitem>
1615 </varlistentry>
1616 </variablelist>
1617 </refsect2>
1618
1619 <refsect2>
1620 <title>System Commands</title>
1621
1622 <variablelist>
1623 <varlistentry>
1624 <term><command>is-system-running</command></term>
1625
1626 <listitem>
1627 <para>Checks whether the system is operational. This
1628 returns success (exit code 0) when the system is fully up
1629 and running, specifically not in startup, shutdown or
1630 maintenance mode, and with no failed services. Failure is
1631 returned otherwise (exit code non-zero). In addition, the
1632 current state is printed in a short string to standard
1633 output, see the table below. Use <option>--quiet</option> to
1634 suppress this output.</para>
1635
1636 <table>
1637 <title><command>is-system-running</command> output</title>
1638 <tgroup cols='3'>
1639 <colspec colname='name'/>
1640 <colspec colname='description'/>
1641 <colspec colname='exit-code'/>
1642 <thead>
1643 <row>
1644 <entry>Name</entry>
1645 <entry>Description</entry>
1646 <entry>Exit Code</entry>
1647 </row>
1648 </thead>
1649 <tbody>
1650 <row>
1651 <entry><varname>initializing</varname></entry>
1652 <entry><para>Early bootup, before
1653 <filename>basic.target</filename> is reached
1654 or the <varname>maintenance</varname> state entered.
1655 </para></entry>
1656 <entry>&gt; 0</entry>
1657 </row>
1658 <row>
1659 <entry><varname>starting</varname></entry>
1660 <entry><para>Late bootup, before the job queue
1661 becomes idle for the first time, or one of the
1662 rescue targets are reached.</para></entry>
1663 <entry>&gt; 0</entry>
1664 </row>
1665 <row>
1666 <entry><varname>running</varname></entry>
1667 <entry><para>The system is fully
1668 operational.</para></entry>
1669 <entry>0</entry>
1670 </row>
1671 <row>
1672 <entry><varname>degraded</varname></entry>
1673 <entry><para>The system is operational but one or more
1674 units failed.</para></entry>
1675 <entry>&gt; 0</entry>
1676 </row>
1677 <row>
1678 <entry><varname>maintenance</varname></entry>
1679 <entry><para>The rescue or emergency target is
1680 active.</para></entry>
1681 <entry>&gt; 0</entry>
1682 </row>
1683 <row>
1684 <entry><varname>stopping</varname></entry>
1685 <entry><para>The manager is shutting
1686 down.</para></entry>
1687 <entry>&gt; 0</entry>
1688 </row>
1689 <row>
1690 <entry><varname>offline</varname></entry>
1691 <entry><para>The manager is not
1692 running. Specifically, this is the operational
1693 state if an incompatible program is running as
1694 system manager (PID 1).</para></entry>
1695 <entry>&gt; 0</entry>
1696 </row>
1697 <row>
1698 <entry><varname>unknown</varname></entry>
1699 <entry><para>The operational state could not be
1700 determined, due to lack of resources or another
1701 error cause.</para></entry>
1702 <entry>&gt; 0</entry>
1703 </row>
1704 </tbody>
1705 </tgroup>
1706 </table>
1707 </listitem>
1708 </varlistentry>
1709
1710 <varlistentry>
1711 <term><command>default</command></term>
1712
1713 <listitem>
1714 <para>Enter default mode. This is equivalent to <command>systemctl isolate default.target</command>. This
1715 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
1716 </listitem>
1717 </varlistentry>
1718
1719 <varlistentry>
1720 <term><command>rescue</command></term>
1721
1722 <listitem>
1723 <para>Enter rescue mode. This is equivalent to <command>systemctl isolate rescue.target</command>. This
1724 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
1725 </listitem>
1726 </varlistentry>
1727 <varlistentry>
1728 <term><command>emergency</command></term>
1729
1730 <listitem>
1731 <para>Enter emergency mode. This is equivalent to <command>systemctl isolate
1732 emergency.target</command>. This operation is blocking by default, use <option>--no-block</option> to
1733 request asynchronous behavior.</para>
1734 </listitem>
1735 </varlistentry>
1736 <varlistentry>
1737 <term><command>halt</command></term>
1738
1739 <listitem>
1740 <para>Shut down and halt the system. This is mostly equivalent to <command>systemctl start halt.target
1741 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This command is
1742 asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note
1743 that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered
1744 on. Use <command>systemctl poweroff</command> for powering off the system (see below).</para>
1745
1746 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1747 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1748 system halt. If <option>--force</option> is specified twice, the operation is immediately executed without
1749 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1750 <option>--force</option> is specified twice the halt operation is executed by <command>systemctl</command>
1751 itself, and the system manager is not contacted. This means the command should succeed even when the system
1752 manager has crashed.</para>
1753 </listitem>
1754 </varlistentry>
1755 <varlistentry>
1756 <term><command>poweroff</command></term>
1757
1758 <listitem>
1759 <para>Shut down and power-off the system. This is mostly equivalent to <command>systemctl start
1760 poweroff.target --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all
1761 users. This command is asynchronous; it will return after the power-off operation is enqueued, without
1762 waiting for it to complete.</para>
1763
1764 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1765 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1766 powering off. If <option>--force</option> is specified twice, the operation is immediately executed without
1767 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1768 <option>--force</option> is specified twice the power-off operation is executed by
1769 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
1770 succeed even when the system manager has crashed.</para>
1771 </listitem>
1772 </varlistentry>
1773 <varlistentry>
1774 <term><command>reboot <optional><replaceable>arg</replaceable></optional></command></term>
1775
1776 <listitem>
1777 <para>Shut down and reboot the system. This is mostly equivalent to <command>systemctl start reboot.target
1778 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This
1779 command is asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1780 complete.</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 reboot. 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 reboot operation is executed by
1787 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
1788 succeed even when the system manager has crashed.</para>
1789
1790 <para>If the optional argument <replaceable>arg</replaceable> is given, it will be passed as the optional
1791 argument to the <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1792 system call. The value is architecture and firmware specific. As an example, <literal>recovery</literal>
1793 might be used to trigger system recovery, and <literal>fota</literal> might be used to trigger a
1794 <quote>firmware over the air</quote> update.</para>
1795 </listitem>
1796 </varlistentry>
1797
1798 <varlistentry>
1799 <term><command>kexec</command></term>
1800
1801 <listitem>
1802 <para>Shut down and reboot the system via <command>kexec</command>. This is equivalent to
1803 <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block</command>. This command is
1804 asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1805 complete.</para>
1806
1807 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1808 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1809 reboot.</para>
1810 </listitem>
1811 </varlistentry>
1812
1813 <varlistentry>
1814 <term><command>exit <optional><replaceable>EXIT_CODE</replaceable></optional></command></term>
1815
1816 <listitem>
1817 <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in
1818 conjunction with the <option>--user</option> option) or in containers and is equivalent to
1819 <command>poweroff</command> otherwise. This command is asynchronous; it will return after the exit
1820 operation is enqueued, without waiting for it to complete.</para>
1821
1822 <para>The service manager will exit with the specified exit code, if
1823 <replaceable>EXIT_CODE</replaceable> is passed.</para>
1824 </listitem>
1825 </varlistentry>
1826
1827 <varlistentry>
1828 <term><command>switch-root <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></command></term>
1829
1830 <listitem>
1831 <para>Switches to a different root directory and executes a new system manager process below it. This is
1832 intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager
1833 process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host
1834 volume. This call takes two arguments: the directory that is to become the new root directory, and the path
1835 to the new system manager binary below it to execute as PID 1. If the latter is omitted or the empty
1836 string, a systemd binary will automatically be searched for and used as init. If the system manager path is
1837 omitted, equal to the empty string or identical to the path to the systemd binary, the state of the
1838 initrd's system manager process is passed to the main system manager, which allows later introspection of
1839 the state of the services involved in the initrd boot phase.</para>
1840 </listitem>
1841 </varlistentry>
1842
1843 <varlistentry>
1844 <term><command>suspend</command></term>
1845
1846 <listitem>
1847 <para>Suspend the system. This will trigger activation of the special target unit
1848 <filename>suspend.target</filename>. This command is asynchronous, and will return after the suspend
1849 operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.</para>
1850 </listitem>
1851 </varlistentry>
1852
1853 <varlistentry>
1854 <term><command>hibernate</command></term>
1855
1856 <listitem>
1857 <para>Hibernate the system. This will trigger activation of the special target unit
1858 <filename>hibernate.target</filename>. This command is asynchronous, and will return after the hibernation
1859 operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.</para>
1860 </listitem>
1861 </varlistentry>
1862
1863 <varlistentry>
1864 <term><command>hybrid-sleep</command></term>
1865
1866 <listitem>
1867 <para>Hibernate and suspend the system. This will trigger activation of the special target unit
1868 <filename>hybrid-sleep.target</filename>. This command is asynchronous, and will return after the hybrid
1869 sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.</para>
1870 </listitem>
1871 </varlistentry>
1872 </variablelist>
1873 </refsect2>
1874
1875 <refsect2>
1876 <title>Parameter Syntax</title>
1877
1878 <para>Unit commands listed above take either a single unit name (designated as <replaceable>UNIT</replaceable>),
1879 or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the
1880 unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"),
1881 systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in
1882 case of commands which operate only on specific unit types. For example,
1883 <programlisting># systemctl start sshd</programlisting> and
1884 <programlisting># systemctl start sshd.service</programlisting>
1885 are equivalent, as are
1886 <programlisting># systemctl isolate default</programlisting>
1887 and
1888 <programlisting># systemctl isolate default.target</programlisting>
1889 Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
1890 paths to mount unit names.
1891 <programlisting># systemctl status /dev/sda
1892 # systemctl status /home</programlisting>
1893 are equivalent to:
1894 <programlisting># systemctl status dev-sda.device
1895 # systemctl status home.mount</programlisting>
1896 In the second case, shell-style globs will be matched against the primary names of all units currently in memory;
1897 literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
1898 names always refer to exactly one unit, but globs may match zero units and this is not considered an
1899 error.</para>
1900
1901 <para>Glob patterns use
1902 <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1903 so normal shell-style globbing rules are used, and
1904 <literal>*</literal>, <literal>?</literal>,
1905 <literal>[]</literal> may be used. See
1906 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1907 for more details. The patterns are matched against the primary names of
1908 units currently in memory, and patterns which do not match anything
1909 are silently skipped. For example:
1910 <programlisting># systemctl stop sshd@*.service</programlisting>
1911 will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
1912 in memory are not considered for glob expansion.
1913 </para>
1914
1915 <para>For unit file commands, the specified <replaceable>UNIT</replaceable> should be the name of the unit file
1916 (possibly abbreviated, see above), or the absolute path to the unit file:
1917 <programlisting># systemctl enable foo.service</programlisting>
1918 or
1919 <programlisting># systemctl link /path/to/foo.service</programlisting>
1920 </para>
1921 </refsect2>
1922
1923 </refsect1>
1924
1925 <refsect1>
1926 <title>Exit status</title>
1927
1928 <para>On success, 0 is returned, a non-zero failure
1929 code otherwise.</para>
1930 </refsect1>
1931
1932 <refsect1>
1933 <title>Environment</title>
1934
1935 <variablelist class='environment-variables'>
1936 <varlistentry>
1937 <term><varname>$SYSTEMD_EDITOR</varname></term>
1938
1939 <listitem><para>Editor to use when editing units; overrides
1940 <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither
1941 <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor
1942 <varname>$VISUAL</varname> are present or if it is set to an empty
1943 string or if their execution failed, systemctl will try to execute well
1944 known editors in this order:
1945 <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1946 <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1947 <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1948 <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1949 </para></listitem>
1950 </varlistentry>
1951 </variablelist>
1952 <xi:include href="less-variables.xml" xpointer="pager"/>
1953 <xi:include href="less-variables.xml" xpointer="less"/>
1954 <xi:include href="less-variables.xml" xpointer="lesscharset"/>
1955 </refsect1>
1956
1957 <refsect1>
1958 <title>See Also</title>
1959 <para>
1960 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1961 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1962 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1963 <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1964 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1965 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1966 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1967 <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1968 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1969 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1970 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1971 </para>
1972 </refsect1>
1973
1974 </refentry>