]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemctl.xml
man: mention that systemctl is-active or is-failed do not load units
[thirdparty/systemd.git] / man / systemctl.xml
CommitLineData
3802a3d3 1<?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
7874bcd6 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
681eb9cf
FB
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
7874bcd6
LP
7
8<!--
572eb058
ZJS
9 SPDX-License-Identifier: LGPL-2.1+
10
b975b0d5 11 This file is part of systemd.
7874bcd6 12
b975b0d5 13 Copyright 2010 Lennart Poettering
7874bcd6 14
b975b0d5
ZJS
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.
7874bcd6 19
b975b0d5
ZJS
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.
7874bcd6 24
b975b0d5
ZJS
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/>.
7874bcd6
LP
27-->
28
21ac6ff1
ZJS
29<refentry id="systemctl"
30 xmlns:xi="http://www.w3.org/2001/XInclude">
7874bcd6 31
4a6022f0
ZJS
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">NAME</arg>
62 </cmdsynopsis>
63 </refsynopsisdiv>
64
65 <refsect1>
66 <title>Description</title>
67
a4390b6b
LP
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
4a6022f0 71 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
a4390b6b
LP
72 for an introduction into the basic concepts and functionality this
73 tool manages.</para>
4a6022f0
ZJS
74 </refsect1>
75
76 <refsect1>
77 <title>Options</title>
78
79 <para>The following options are understood:</para>
80
81 <variablelist>
4a6022f0
ZJS
82 <varlistentry>
83 <term><option>-t</option></term>
84 <term><option>--type=</option></term>
85
86 <listitem>
e9dd9f95 87 <para>The argument should be a comma-separated list of unit
20b3f379 88 types such as <option>service</option> and
9b9b3d36
MW
89 <option>socket</option>.
90 </para>
20b3f379
ZJS
91
92 <para>If one of the arguments is a unit type, when listing
7b870f60 93 units, limit display to certain unit types. Otherwise, units
4a6022f0
ZJS
94 of all types will be shown.</para>
95
20b3f379 96 <para>As a special case, if one of the arguments is
4a6022f0
ZJS
97 <option>help</option>, a list of allowed values will be
98 printed and the program will exit.</para>
99 </listitem>
100 </varlistentry>
101
9b9b3d36
MW
102 <varlistentry>
103 <term><option>--state=</option></term>
104
105 <listitem>
e16972e6
ZJS
106 <para>The argument should be a comma-separated list of unit
107 LOAD, SUB, or ACTIVE states. When listing units, show only
a8eaaee7 108 those in the specified states. Use <option>--state=failed</option>
e16972e6
ZJS
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>
9b9b3d36
MW
114 </listitem>
115 </varlistentry>
116
4a6022f0
ZJS
117 <varlistentry>
118 <term><option>-p</option></term>
119 <term><option>--property=</option></term>
120
121 <listitem>
54c31a79 122 <para>When showing unit/job/manager properties with the
ea539eb6
ZJS
123 <command>show</command> command, limit display to properties
124 specified in the argument. The argument should be a
d2bbca68 125 comma-separated list of property names, such as
ea539eb6
ZJS
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
b938cb90 139 pertaining to this type. Similarly, showing any job will list
ea539eb6
ZJS
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>
4a6022f0
ZJS
147 </listitem>
148 </varlistentry>
149
150 <varlistentry>
151 <term><option>-a</option></term>
152 <term><option>--all</option></term>
153
154 <listitem>
21b587cf
ZJS
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
a5e4972c 160 <command>list-unit-files</command> command instead.</para>
e9fbae3f
ZJS
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>
4a6022f0
ZJS
165 </listitem>
166 </varlistentry>
167
1238ee09
LP
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
afba4199
ZJS
180 <varlistentry>
181 <term><option>--reverse</option></term>
182
183 <listitem>
184 <para>Show reverse dependencies between units with
f6375e83
ZJS
185 <command>list-dependencies</command>, i.e. follow
186 dependencies of type <varname>WantedBy=</varname>,
187 <varname>RequiredBy=</varname>,
f6375e83
ZJS
188 <varname>PartOf=</varname>, <varname>BoundBy=</varname>,
189 instead of <varname>Wants=</varname> and similar.
afba4199
ZJS
190 </para>
191 </listitem>
192 </varlistentry>
193
194 <varlistentry>
195 <term><option>--after</option></term>
9029f642
JSJ
196
197 <listitem>
198 <para>With <command>list-dependencies</command>, show the
199 units that are ordered before the specified unit. In other
f6375e83
ZJS
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
922d948b 206 may be specified explicitly, but are also created implicitly
f6375e83
ZJS
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>
82948f6c
LP
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>
9029f642
JSJ
218 </listitem>
219 </varlistentry>
220
221 <varlistentry>
afba4199
ZJS
222 <term><option>--before</option></term>
223
224 <listitem>
9029f642
JSJ
225 <para>With <command>list-dependencies</command>, show the
226 units that are ordered after the specified unit. In other
f6375e83
ZJS
227 words, recursively list units following the
228 <varname>Before=</varname> dependency.</para>
82948f6c
LP
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>
afba4199
ZJS
233 </listitem>
234 </varlistentry>
235
4a6022f0 236 <varlistentry>
98a6e132 237 <term><option>-l</option></term>
4a6022f0
ZJS
238 <term><option>--full</option></term>
239
240 <listitem>
69d918b0
ZJS
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>
3b3557c4
JS
246 <para>Also, show installation targets in the output of
247 <command>is-enabled</command>.</para>
4a6022f0
ZJS
248 </listitem>
249 </varlistentry>
250
4f9a9105
ZJS
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
991f2a39
ZJS
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
23ade460 269 <varlistentry>
4dc5b821 270 <term><option>--job-mode=</option></term>
23ade460
MS
271
272 <listitem>
e0e009c0
JE
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>,
4dc5b821
LP
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
9a92e77e
DS
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>
d60cb656
AJ
300 command. This job mode should be used on any transaction which
301 pulls in <filename>shutdown.target</filename>.</para>
4dc5b821
LP
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
b040723e 320 <literal>ignore-dependencies</literal>, but only causes the
4dc5b821 321 requirement dependencies to be ignored, the ordering
2dd67817 322 dependencies will still be honored.</para>
23ade460 323 </listitem>
4a6022f0 324
4a6022f0
ZJS
325 </varlistentry>
326
ac5e3a50
JS
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
4a6022f0
ZJS
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
494a6682 350 (regardless of whether privileged or not) and a list of active locks
7b870f60
JE
351 is printed. However, if <option>--ignore-inhibitors</option>
352 is specified, the locks are ignored and not printed, and the
4a6022f0
ZJS
353 operation attempted anyway, possibly requiring additional
354 privileges.</para>
355 </listitem>
356 </varlistentry>
357
1ae17672
ZJS
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
4a6022f0
ZJS
371 <varlistentry>
372 <term><option>-q</option></term>
373 <term><option>--quiet</option></term>
374
375 <listitem>
bbd46aad
ZJS
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>
4a6022f0
ZJS
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
7b870f60 389 to finish. If this is not specified, the job will be
4a6022f0 390 verified, enqueued and <command>systemctl</command> will
3d161f99 391 wait until the unit's start-up is completed. By passing this
93a08841
MP
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>
4a6022f0
ZJS
406 </listitem>
407 </varlistentry>
408
88ae7333
ZJS
409 <xi:include href="user-system-options.xml" xpointer="user" />
410 <xi:include href="user-system-options.xml" xpointer="system" />
4a6022f0 411
bef19548
ZJS
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>
599b6322 420
4a6022f0
ZJS
421 <varlistentry>
422 <term><option>--no-wall</option></term>
423
424 <listitem>
6324a8a7 425 <para>Do not send wall message before halt, power-off and reboot.</para>
4a6022f0
ZJS
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
7b870f60 459 command is invoked from a terminal,
4a6022f0
ZJS
460 <command>systemctl</command> will query the user on the
461 terminal for the necessary secrets. Use this option to
7b870f60 462 switch this behavior off. In this case, the password must be
4a6022f0
ZJS
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>
4a6022f0
ZJS
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
af7424af
LP
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
b8bde116 489 <varname>Type=forking</varname>, the initial process started
af7424af
LP
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
b8bde116
JE
496 itself. A service unit consists of zero or one main process,
497 zero or one control process plus any number of additional
af7424af 498 processes. Not all unit types manage processes of these
b8bde116 499 types however. For example, for mount units, control processes
af7424af 500 are defined (which are the invocations of
d31dd62b
FB
501 <filename>&MOUNT_PATH;</filename> and
502 <filename>&UMOUNT_PATH;</filename>), but no main process
af7424af
LP
503 is defined. If omitted, defaults to
504 <option>all</option>.</para>
4a6022f0
ZJS
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
b938cb90 516 well-known signal specifiers such as <constant>SIGTERM</constant>, <constant>SIGINT</constant> or
7b870f60 517 <constant>SIGSTOP</constant>. If omitted, defaults to
4a6022f0
ZJS
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
39c38ce1
DC
530 <para>When used with <command>edit</command>, create all of the
531 specified units which do not already exist.</para>
532
924e44b4
LP
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
6324a8a7 542 succeed even when the system manager has crashed.</para>
4a6022f0
ZJS
543 </listitem>
544 </varlistentry>
545
9ef15026
JS
546 <varlistentry>
547 <term><option>--message=</option></term>
548
549 <listitem>
6324a8a7
LP
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>
9ef15026
JS
553 </listitem>
554 </varlistentry>
555
57ab2eab
JS
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
4a6022f0
ZJS
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>
9b914a9d
ZJS
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>
4a6022f0
ZJS
578 </listitem>
579
580 </varlistentry>
581
582 <varlistentry>
583 <term><option>--runtime</option></term>
584
585 <listitem>
a330b376 586 <para>When used with <command>enable</command>,
7d4fb3b1 587 <command>disable</command>, <command>edit</command>,
4a6022f0 588 (and related commands), make changes only temporarily, so
a330b376 589 that they are lost on the next reboot. This will have the
4a6022f0
ZJS
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>
a330b376 594
494a6682 595 <para>Similarly, when used with
fbce1139 596 <command>set-property</command>, make changes only
a330b376
LP
597 temporarily, so that they are lost on the next
598 reboot.</para>
4a6022f0
ZJS
599 </listitem>
600 </varlistentry>
601
d309c1c3
LP
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>,
8d0e0ddd 608 <literal>disable-only</literal>. When used with the
d309c1c3 609 <command>preset</command> or <command>preset-all</command>
8d0e0ddd 610 commands, controls whether units shall be disabled and
d309c1c3
LP
611 enabled according to the preset rules, or only enabled, or
612 only disabled.</para>
613 </listitem>
614 </varlistentry>
615
4a6022f0
ZJS
616 <varlistentry>
617 <term><option>-n</option></term>
618 <term><option>--lines=</option></term>
619
620 <listitem>
7b870f60 621 <para>When used with <command>status</command>, controls the
4a6022f0
ZJS
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>
7b870f60 633 <para>When used with <command>status</command>, controls the
4a6022f0 634 formatting of the journal entries that are shown. For the
7b870f60 635 available choices, see
4a6022f0
ZJS
636 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
637 Defaults to <literal>short</literal>.</para>
638 </listitem>
639 </varlistentry>
640
5bdf2243
JJ
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
5d0c05e5
LN
653 <varlistentry>
654 <term><option>--plain</option></term>
655
656 <listitem>
7b870f60 657 <para>When used with <command>list-dependencies</command>,
831d3dc8 658 <command>list-units</command> or <command>list-machines</command>,
a20e43c0
MT
659 the output is printed as a list instead of a tree, and the bullet
660 circles are omitted.</para>
5d0c05e5
LN
661 </listitem>
662 </varlistentry>
663
4f50d2ef
ZJS
664 <xi:include href="user-system-options.xml" xpointer="host" />
665 <xi:include href="user-system-options.xml" xpointer="machine" />
666
12f15e59
ZJS
667 <xi:include href="standard-options.xml" xpointer="no-pager" />
668 <xi:include href="standard-options.xml" xpointer="no-legend" />
dfdebb1b
ZJS
669 <xi:include href="standard-options.xml" xpointer="help" />
670 <xi:include href="standard-options.xml" xpointer="version" />
4a6022f0
ZJS
671 </variablelist>
672 </refsect1>
673
674 <refsect1>
675 <title>Commands</title>
676
677 <para>The following commands are understood:</para>
678
27722f96
LN
679 <refsect2>
680 <title>Unit Commands</title>
4a6022f0 681
27722f96
LN
682 <variablelist>
683 <varlistentry>
1eecafb8 684 <term><command>list-units <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
4a6022f0 685
27722f96 686 <listitem>
2cdbbc9a
LP
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
05a98afd
LP
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>
991f2a39 694
27722f96
LN
695 <para>This is the default command.</para>
696 </listitem>
697 </varlistentry>
991f2a39 698
27722f96 699 <varlistentry>
1eecafb8 700 <term><command>list-sockets <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
27722f96
LN
701
702 <listitem>
2cdbbc9a
LP
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
d8fba7c6 705 shown. Produces output similar to
27722f96 706 <programlisting>
991f2a39
ZJS
707LISTEN UNIT ACTIVATES
708/dev/initctl systemd-initctl.socket systemd-initctl.service
1eecafb8 709
991f2a39
ZJS
710[::]:22 sshd.socket sshd.service
711kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
712
9fccdb0f 7135 sockets listed.</programlisting>
27722f96
LN
714 Note: because the addresses might contains spaces, this output
715 is not suitable for programmatic consumption.
716 </para>
717
2cdbbc9a 718 <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para>
27722f96
LN
719 </listitem>
720 </varlistentry>
721
cbb76c29 722 <varlistentry>
1eecafb8 723 <term><command>list-timers <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
cbb76c29
LP
724
725 <listitem>
2cdbbc9a
LP
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.
3c3fff44 728 Produces output similar to
ccdda955
MS
729 <programlisting>
730NEXT LEFT LAST PASSED UNIT ACTIVATES
731n/a n/a Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service
732Sun 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
733Sun 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
734Sun 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>
d8fba7c6 736 </para>
cbb76c29 737
ccdda955
MS
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>
785889e5 743 <para><emphasis>ACTIVATES</emphasis> shows the name the service the timer activates when it runs.</para>
ccdda955 744
2cdbbc9a 745 <para>Also see <option>--all</option> and <option>--state=</option>.</para>
cbb76c29
LP
746 </listitem>
747 </varlistentry>
748
27722f96 749 <varlistentry>
1eecafb8 750 <term><command>start <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
751
752 <listitem>
753 <para>Start (activate) one or more units specified on the
754 command line.</para>
e3e0314b 755
2cdbbc9a
LP
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
1f00eded
LP
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>
27722f96
LN
761 </listitem>
762 </varlistentry>
763 <varlistentry>
1eecafb8 764 <term><command>stop <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
765
766 <listitem>
767 <para>Stop (deactivate) one or more units specified on the
768 command line.</para>
769 </listitem>
770 </varlistentry>
771 <varlistentry>
1eecafb8 772 <term><command>reload <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
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
79640424 779 configuration file of a unit, use the
27722f96
LN
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
d0a3fb75 787 <command>daemon-reload</command> command.</para>
27722f96
LN
788 </listitem>
789
790 </varlistentry>
791 <varlistentry>
1eecafb8 792 <term><command>restart <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
793
794 <listitem>
c4f2aaa4
LP
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>
27722f96
LN
806 </listitem>
807 </varlistentry>
808 <varlistentry>
1eecafb8 809 <term><command>try-restart <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
810
811 <listitem>
6539dd7c 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>
2fcee0a5
LP
815 <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally
816 don't document that. -->
27722f96
LN
817 </listitem>
818 </varlistentry>
819 <varlistentry>
1eecafb8 820 <term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
821
822 <listitem>
ff946d82
LP
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>
27722f96
LN
825 </listitem>
826 </varlistentry>
827 <varlistentry>
1eecafb8 828 <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
829
830 <listitem>
ff946d82
LP
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>
2fcee0a5
LP
833 <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
834 don't document that. -->
27722f96
LN
835 </listitem>
836 </varlistentry>
837 <varlistentry>
838 <term><command>isolate <replaceable>NAME</replaceable></command></term>
839
840 <listitem>
26adf774
ZJS
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
507e28d8 846 <literal>.target</literal> will be assumed.</para>
27722f96
LN
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>
1eecafb8 861 <term><command>kill <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
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
0088d631
LP
866 process to kill. Use <option>--signal=</option> to select
867 the signal to send.</para>
27722f96
LN
868 </listitem>
869 </varlistentry>
870 <varlistentry>
1eecafb8 871 <term><command>is-active <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
872
873 <listitem>
874 <para>Check whether any of the specified units are active
6db27428
ZJS
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>
c7612b20
YW
880
881 <para>Unlike <command>status</command> or <command>show</command> commands, this does not
882 load units. So, when a specified unit is an alias of another unit and is not loaded,
883 then this outputs "inactive", even if the aliased unit is active.</para>
27722f96
LN
884 </listitem>
885 </varlistentry>
886 <varlistentry>
1eecafb8 887 <term><command>is-failed <replaceable>PATTERN</replaceable>…</command></term>
27722f96
LN
888
889 <listitem>
6db27428
ZJS
890 <para>Check whether any of the specified units are in a
891 "failed" state. Returns an exit code
892 <constant>0</constant> if at least one has failed,
893 non-zero otherwise. Unless <option>--quiet</option> is
894 specified, this will also print the current unit state to
895 standard output.</para>
c7612b20
YW
896
897 <para>Unlike <command>status</command> or <command>show</command> commands, this does not
898 load units. So, when a specified unit is an alias of another unit and is not loaded,
899 then this outputs "inactive", even if the aliased unit is failed.</para>
27722f96
LN
900 </listitem>
901 </varlistentry>
902 <varlistentry>
1eecafb8 903 <term><command>status</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…]</optional></term>
27722f96
LN
904
905 <listitem>
906 <para>Show terse runtime status information about one or
907 more units, followed by most recent log data from the
8fcf784d 908 journal. If no units are specified, show system status. If
b8bde116 909 combined with <option>--all</option>, also show the status of
8fcf784d
LP
910 all units (subject to limitations specified with
911 <option>-t</option>). If a PID is passed, show information
912 about the unit the process belongs to.</para>
27722f96
LN
913
914 <para>This function is intended to generate human-readable
e213d1a3 915 output. If you are looking for computer-parsable output,
b938cb90 916 use <command>show</command> instead. By default, this
e213d1a3 917 function only shows 10 lines of output and ellipsizes
4559a721 918 lines to fit in the terminal window. This can be changed
e213d1a3
ZJS
919 with <option>--lines</option> and <option>--full</option>,
920 see above. In addition, <command>journalctl
921 --unit=<replaceable>NAME</replaceable></command> or
922 <command>journalctl
923 --user-unit=<replaceable>NAME</replaceable></command> use
924 a similar filter for messages and might be more
925 convenient.
926 </para>
ab8864eb 927
f95b0be7 928 <para>systemd implicitly loads units as necessary, so just running the <command>status</command> will
ab8864eb
MS
929 attempt to load a file. The command is thus not useful for determining if something was already loaded or
930 not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason
931 to keep it in memory thereafter.
932 </para>
933
934 <example>
935 <title>Example output from systemctl status </title>
936
937 <programlisting>$ systemctl status bluetooth
938● bluetooth.service - Bluetooth service
83ddf5d3 939 Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
ab8864eb
MS
940 Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
941 Docs: man:bluetoothd(8)
942 Main PID: 930 (bluetoothd)
943 Status: "Running"
944 Tasks: 1
945 Memory: 648.0K
946 CPU: 435ms
947 CGroup: /system.slice/bluetooth.service
948 └─930 /usr/lib/bluetooth/bluetoothd
949
950Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service
542ca7c9
DR
951Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered
952Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5)
ab8864eb
MS
953</programlisting>
954
955 <para>The dot ("●") uses color on supported terminals to summarize the unit state at a glance. White
956 indicates an <literal>inactive</literal> or <literal>deactivating</literal> state. Red indicates a
957 <literal>failed</literal> or <literal>error</literal> state and green indicates an
958 <literal>active</literal>, <literal>reloading</literal> or <literal>activating</literal> state.
959 </para>
960
961 <para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been loaded into
962 memory. Other possible values for "Loaded:" include: <literal>error</literal> if there was a problem
963 loading it, <literal>not-found</literal>, and <literal>masked</literal>. Along with showing the path to
964 the unit file, this line will also show the enablement state. Enabled commands start at boot. See the
965 full table of possible enablement states — including the definition of <literal>masked</literal> — in the
966 documentation for the <command>is-enabled</command> command.
967 </para>
968
969 <para>The "Active:" line shows active state. The value is usually <literal>active</literal> or
970 <literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the unit type.
971 The unit could also be in process of changing states, reporting a state of <literal>activating</literal> or
972 <literal>deactivating</literal>. A special <literal>failed</literal> state is entered when the service
973 failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is
974 entered the cause will be logged for later reference.</para>
975 </example>
976
27722f96
LN
977 </listitem>
978 </varlistentry>
979 <varlistentry>
1eecafb8 980 <term><command>show</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>JOB</replaceable>…</optional></term>
27722f96
LN
981
982 <listitem>
33d2308c
LP
983 <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified,
984 properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and
985 if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use
986 <option>--all</option> to show those too. To select specific properties to show, use
987 <option>--property=</option>. This command is intended to be used whenever computer-parsable output is
988 required. Use <command>status</command> if you are looking for formatted human-readable output.</para>
989
990 <para>Many properties shown by <command>systemctl show</command> map directly to configuration settings of
991 the system and service manager and its unit files. Note that the properties shown by the command are
992 generally more low-level, normalized versions of the original configuration settings and expose runtime
993 state in addition to configuration. For example, properties shown for service units include the service's
994 current main process identifier as <literal>MainPID</literal> (which is runtime state), and time settings
995 are always exposed as properties ending in the <literal>…USec</literal> suffix even if a matching
996 configuration options end in <literal>…Sec</literal>, because microseconds is the normalized time unit used
997 by the system and service manager.</para>
c7612b20
YW
998
999 <para>As similar to <command>status</command> command, systemd implicitly loads units as necessary.
1000 See also <command>status</command> command for the detail.</para>
27722f96
LN
1001 </listitem>
1002 </varlistentry>
e93c33d4 1003 <varlistentry>
1eecafb8 1004 <term><command>cat <replaceable>PATTERN</replaceable>…</command></term>
27722f96 1005
e93c33d4 1006 <listitem>
e4c0fbe5
ZJS
1007 <para>Show backing files of one or more units. Prints the
1008 "fragment" and "drop-ins" (source files) of units. Each
1009 file is preceded by a comment which includes the file
d4a48671
LW
1010 name. Note that this shows the contents of the backing files
1011 on disk, which may not match the system manager's
1012 understanding of these units if any unit files were
1013 updated on disk and the <command>daemon-reload</command>
1014 command wasn't issued since.</para>
e93c33d4
SL
1015 </listitem>
1016 </varlistentry>
27722f96 1017 <varlistentry>
1eecafb8 1018 <term><command>set-property <replaceable>NAME</replaceable> <replaceable>ASSIGNMENT</replaceable>…</command></term>
27722f96
LN
1019
1020 <listitem>
1021 <para>Set the specified unit properties at runtime where
1022 this is supported. This allows changing configuration
3fde5f30 1023 parameter properties such as resource control settings at
27722f96 1024 runtime. Not all properties may be changed at runtime, but
3fde5f30
LP
1025 many resource control settings (primarily those in
1026 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
27722f96
LN
1027 may. The changes are applied instantly, and stored on disk
1028 for future boots, unless <option>--runtime</option> is
3fde5f30
LP
1029 passed, in which case the settings only apply until the
1030 next reboot. The syntax of the property assignment follows
27722f96
LN
1031 closely the syntax of assignments in unit files.</para>
1032
1033 <para>Example: <command>systemctl set-property foobar.service CPUShares=777</command></para>
1034
e9fd88f2
FB
1035 <para>If the specified unit appears to be inactive, the
1036 changes will be only stored on disk as described
1037 previously hence they will be effective when the unit will
1038 be started.</para>
1039
27722f96
LN
1040 <para>Note that this command allows changing multiple
1041 properties at the same time, which is preferable over
1042 setting them individually. Like unit file configuration
1043 settings, assigning the empty list to list parameters will
1044 reset the list.</para>
1045 </listitem>
1046 </varlistentry>
1047
1048 <varlistentry>
1eecafb8 1049 <term><command>help <replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…</command></term>
27722f96
LN
1050
1051 <listitem>
1052 <para>Show manual pages for one or more units, if
1053 available. If a PID is given, the manual pages for the unit
1054 the process belongs to are shown.</para>
1055 </listitem>
1056 </varlistentry>
1057
1058 <varlistentry>
1eecafb8 1059 <term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term>
27722f96
LN
1060
1061 <listitem>
ff946d82
LP
1062 <para>Reset the <literal>failed</literal> state of the specified units, or if no unit name is passed, reset
1063 the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code,
1064 terminating abnormally or timing out), it will automatically enter the <literal>failed</literal> state and
1065 its exit code and status is recorded for introspection by the administrator until the service is
1066 stopped/re-started or reset with this command.</para>
27722f96
LN
1067 </listitem>
1068 </varlistentry>
1069
1070 <varlistentry>
f6375e83
ZJS
1071 <term>
1072 <command>list-dependencies</command>
1073 <optional><replaceable>NAME</replaceable></optional>
1074 </term>
27722f96
LN
1075
1076 <listitem>
f6375e83
ZJS
1077 <para>Shows units required and wanted by the specified
1078 unit. This recursively lists units following the
1079 <varname>Requires=</varname>,
f6375e83 1080 <varname>Requisite=</varname>,
fb30c438 1081 <varname>ConsistsOf=</varname>,
f6375e83
ZJS
1082 <varname>Wants=</varname>, <varname>BindsTo=</varname>
1083 dependencies. If no unit is specified,
1084 <filename>default.target</filename> is implied.</para>
1085
1086 <para>By default, only target units are recursively
1087 expanded. When <option>--all</option> is passed, all other
1088 units are recursively expanded as well.</para>
1089
1090 <para>Options <option>--reverse</option>,
1091 <option>--after</option>, <option>--before</option>
1092 may be used to change what types of dependencies
1093 are shown.</para>
27722f96
LN
1094 </listitem>
1095 </varlistentry>
1096 </variablelist>
1097 </refsect2>
1098
1099 <refsect2>
1100 <title>Unit File Commands</title>
1101
1102 <variablelist>
1103 <varlistentry>
1eecafb8 1104 <term><command>list-unit-files <optional><replaceable>PATTERN…</replaceable></optional></command></term>
27722f96
LN
1105
1106 <listitem>
3990961d
LP
1107 <para>List unit files installed on the system, in combination with their enablement state (as reported by
1108 <command>is-enabled</command>). If one or more <replaceable>PATTERN</replaceable>s are specified, only unit
1109 files whose name matches one of them are shown (patterns matching unit file system paths are not
1110 supported).</para>
27722f96
LN
1111 </listitem>
1112 </varlistentry>
1113
1114 <varlistentry>
1eecafb8
ZJS
1115 <term><command>enable <replaceable>NAME</replaceable>…</command></term>
1116 <term><command>enable <replaceable>PATH</replaceable>…</command></term>
27722f96
LN
1117
1118 <listitem>
3990961d
LP
1119 <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the
1120 <literal>[Install]</literal> sections of the indicated unit files. After the symlinks have been created,
1121 the system manager configuration is reloaded (in a way equivalent to <command>daemon-reload</command>), in
1122 order to ensure the changes are taken into account immediately. Note that this does
1123 <emphasis>not</emphasis> have the effect of also starting any of the units being enabled. If this is
1124 desired, combine this command with the <option>--now</option> switch, or invoke <command>start</command>
1125 with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of
1126 the form <filename>foo@bar.service</filename>), symlinks named the same as instances are created in the
2dd67817 1127 unit configuration directory, however they point to the single template unit file they are instantiated
3990961d
LP
1128 from.</para>
1129
93f07c87
ZJS
1130 <para>This command expects either valid unit names (in which case various unit file directories are
1131 automatically searched for unit files with appropriate names), or absolute paths to unit files (in which
1132 case these files are read directly). If a specified unit file is located outside of the usual unit file
1133 directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring
1134 it is found when requested by commands such as <command>start</command>.</para>
3990961d
LP
1135
1136 <para>This command will print the file system operations executed. This output may be suppressed by passing
1137 <option>--quiet</option>.
27722f96
LN
1138 </para>
1139
3990961d
LP
1140 <para>Note that this operation creates only the symlinks suggested in the <literal>[Install]</literal>
1141 section of the unit files. While this command is the recommended way to manipulate the unit configuration
1142 directory, the administrator is free to make additional changes manually by placing or removing symlinks
1143 below this directory. This is particularly useful to create configurations that deviate from the suggested
1144 default installation. In this case, the administrator must make sure to invoke
1145 <command>daemon-reload</command> manually as necessary, in order to ensure the changes are taken into
1146 account.
27722f96
LN
1147 </para>
1148
3990961d
LP
1149 <para>Enabling units should not be confused with starting (activating) units, as done by the
1150 <command>start</command> command. Enabling and starting units is orthogonal: units may be enabled without
1151 being started and started without being enabled. Enabling simply hooks the unit into various suggested
1152 places (for example, so that the unit is automatically started on boot or when a particular kind of
1153 hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds
1154 the socket (in case of socket units), and so on.</para>
1155
1156 <para>Depending on whether <option>--system</option>, <option>--user</option>, <option>--runtime</option>,
1157 or <option>--global</option> is specified, this enables the unit for the system, for the calling user only,
1d82e6b3
AJ
1158 for only this boot of the system, or for all future logins of all users. Note that in the last case, no
1159 systemd daemon configuration is reloaded.</para>
3990961d
LP
1160
1161 <para>Using <command>enable</command> on masked units is not supported and results in an error.</para>
27722f96
LN
1162 </listitem>
1163 </varlistentry>
1164
1165 <varlistentry>
1eecafb8 1166 <term><command>disable <replaceable>NAME</replaceable>…</command></term>
27722f96
LN
1167
1168 <listitem>
3990961d
LP
1169 <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units
1170 from the unit configuration directory, and hence undoes any changes made by <command>enable</command> or
1171 <command>link</command>. Note that this removes <emphasis>all</emphasis> symlinks to matching unit files,
1172 including manually created symlinks, and not just those actually created by <command>enable</command> or
1173 <command>link</command>. Note that while <command>disable</command> undoes the effect of
1174 <command>enable</command>, the two commands are otherwise not symmetric, as <command>disable</command> may
1175 remove more symlinks than a prior <command>enable</command> invocation of the same unit created.</para>
1176
1177 <para>This command expects valid unit names only, it does not accept paths to unit files.</para>
1178
1179 <para>In addition to the units specified as arguments, all units are disabled that are listed in the
1180 <varname>Also=</varname> setting contained in the <literal>[Install]</literal> section of any of the unit
1181 files being operated on.</para>
1182
1183 <para>This command implicitly reloads the system manager configuration after completing the operation. Note
1184 that this command does not implicitly stop the units that are being disabled. If this is desired, either
1185 combine this command with the <option>--now</option> switch, or invoke the <command>stop</command> command
1186 with appropriate arguments later.</para>
1187
1188 <para>This command will print information about the file system operations (symlink removals)
1189 executed. This output may be suppressed by passing <option>--quiet</option>.
27722f96
LN
1190 </para>
1191
3990961d
LP
1192 <para>This command honors <option>--system</option>, <option>--user</option>, <option>--runtime</option>
1193 and <option>--global</option> in a similar way as <command>enable</command>.</para>
27722f96
LN
1194 </listitem>
1195 </varlistentry>
1196
b619ec8f 1197 <varlistentry>
1eecafb8 1198 <term><command>reenable <replaceable>NAME</replaceable>…</command></term>
b619ec8f
LP
1199
1200 <listitem>
3990961d
LP
1201 <para>Reenable one or more units, as specified on the command line. This is a combination of
1202 <command>disable</command> and <command>enable</command> and is useful to reset the symlinks a unit file is
d903a892 1203 enabled with to the defaults configured in its <literal>[Install]</literal> section. This command expects
1204 a unit name only, it does not accept paths to unit files.</para>
b619ec8f
LP
1205 </listitem>
1206 </varlistentry>
1207
1208 <varlistentry>
1eecafb8 1209 <term><command>preset <replaceable>NAME</replaceable>…</command></term>
b619ec8f
LP
1210
1211 <listitem>
39207373
ZJS
1212 <para>Reset the enable/disable status one or more unit files, as specified on
1213 the command line, to the defaults configured in the preset policy files. This
1214 has the same effect as <command>disable</command> or
1215 <command>enable</command>, depending how the unit is listed in the preset
1216 files.</para>
b619ec8f 1217
39207373
ZJS
1218 <para>Use <option>--preset-mode=</option> to control whether units shall be
1219 enabled and disabled, or only enabled, or only disabled.</para>
1220
1221 <para>If the unit carries no install information, it will be silently ignored
d923e42e
ZJS
1222 by this command. <replaceable>NAME</replaceable> must be the real unit name,
1223 any alias names are ignored silently.</para>
b619ec8f 1224
39207373 1225 <para>For more information on the preset policy format, see
b619ec8f 1226 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
39207373 1227 For more information on the concept of presets, please consult the
28a0ad81 1228 <ulink url="https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset</ulink>
b619ec8f
LP
1229 document.</para>
1230 </listitem>
1231 </varlistentry>
1232
1233 <varlistentry>
1234 <term><command>preset-all</command></term>
1235
1236 <listitem>
1237 <para>Resets all installed unit files to the defaults
1238 configured in the preset policy file (see above).</para>
1239
1240 <para>Use <option>--preset-mode=</option> to control
1241 whether units shall be enabled and disabled, or only
1242 enabled, or only disabled.</para>
1243 </listitem>
1244 </varlistentry>
1245
27722f96 1246 <varlistentry>
1eecafb8 1247 <term><command>is-enabled <replaceable>NAME</replaceable>…</command></term>
27722f96
LN
1248
1249 <listitem>
1250 <para>Checks whether any of the specified unit files are
171754aa
ZJS
1251 enabled (as with <command>enable</command>). Returns an
1252 exit code of 0 if at least one is enabled, non-zero
1253 otherwise. Prints the current enable status (see table).
1254 To suppress this output, use <option>--quiet</option>.
3b3557c4 1255 To show installation targets, use <option>--full</option>.
171754aa
ZJS
1256 </para>
1257
1258 <table>
1259 <title>
1260 <command>is-enabled</command> output
1261 </title>
1262
1263 <tgroup cols='3'>
1264 <thead>
1265 <row>
94f099d8
LP
1266 <entry>Name</entry>
1267 <entry>Description</entry>
1268 <entry>Exit Code</entry>
171754aa
ZJS
1269 </row>
1270 </thead>
1271 <tbody>
1272 <row>
1273 <entry><literal>enabled</literal></entry>
5cd8ae31 1274 <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>
171754aa
ZJS
1275 <entry morerows='1'>0</entry>
1276 </row>
1277 <row>
1278 <entry><literal>enabled-runtime</literal></entry>
1279 </row>
1280 <row>
1281 <entry><literal>linked</literal></entry>
48563081 1282 <entry morerows='1'>Made available through one or more symlinks to the unit file (permanently in <filename>/etc/systemd/system/</filename> or transiently in <filename>/run/systemd/system/</filename>), even though the unit file might reside outside of the unit file search path.</entry>
94f099d8 1283 <entry morerows='1'>&gt; 0</entry>
171754aa
ZJS
1284 </row>
1285 <row>
1286 <entry><literal>linked-runtime</literal></entry>
1287 </row>
1288 <row>
1289 <entry><literal>masked</literal></entry>
48563081 1290 <entry morerows='1'>Completely disabled, so that any start operation on it fails (permanently in <filename>/etc/systemd/system/</filename> or transiently in <filename>/run/systemd/systemd/</filename>).</entry>
94f099d8 1291 <entry morerows='1'>&gt; 0</entry>
171754aa
ZJS
1292 </row>
1293 <row>
1294 <entry><literal>masked-runtime</literal></entry>
1295 </row>
1296 <row>
1297 <entry><literal>static</literal></entry>
f4139308 1298 <entry>The unit file is not enabled, and has no provisions for enabling in the <literal>[Install]</literal> unit file section.</entry>
91f0ac7d 1299 <entry>0</entry>
171754aa 1300 </row>
aedd4012
JS
1301 <row>
1302 <entry><literal>indirect</literal></entry>
d9b4b48f 1303 <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>
aedd4012
JS
1304 <entry>0</entry>
1305 </row>
171754aa
ZJS
1306 <row>
1307 <entry><literal>disabled</literal></entry>
f4139308 1308 <entry>The unit file is not enabled, but contains an <literal>[Install]</literal> section with installation instructions.</entry>
94f099d8 1309 <entry>&gt; 0</entry>
171754aa 1310 </row>
f4139308
LP
1311 <row>
1312 <entry><literal>generated</literal></entry>
1313 <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>
1314 <entry>0</entry>
1315 </row>
e4fca67f
LP
1316 <row>
1317 <entry><literal>transient</literal></entry>
1318 <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry>
1319 <entry>0</entry>
1320 </row>
0ec0deaa
LP
1321 <row>
1322 <entry><literal>bad</literal></entry>
f4139308 1323 <entry>The unit file is invalid or another error occurred. Note that <command>is-enabled</command> will not actually return this state, but print an error message instead. However the unit file listing printed by <command>list-unit-files</command> might show it.</entry>
0ec0deaa
LP
1324 <entry>&gt; 0</entry>
1325 </row>
171754aa
ZJS
1326 </tbody>
1327 </tgroup>
1328 </table>
1329
27722f96
LN
1330 </listitem>
1331 </varlistentry>
1332
27722f96 1333 <varlistentry>
1eecafb8 1334 <term><command>mask <replaceable>NAME</replaceable>…</command></term>
27722f96
LN
1335
1336 <listitem>
3990961d
LP
1337 <para>Mask one or more units, as specified on the command line. This will link these unit files to
1338 <filename>/dev/null</filename>, making it impossible to start them. This is a stronger version of
1339 <command>disable</command>, since it prohibits all kinds of activation of the unit, including enablement
1340 and manual activation. Use this option with care. This honors the <option>--runtime</option> option to only
1341 mask temporarily until the next reboot of the system. The <option>--now</option> option may be used to
1342 ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit
1343 file paths.</para>
27722f96
LN
1344 </listitem>
1345 </varlistentry>
1346
1347 <varlistentry>
1eecafb8 1348 <term><command>unmask <replaceable>NAME</replaceable>…</command></term>
27722f96
LN
1349
1350 <listitem>
3990961d
LP
1351 <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of
1352 <command>mask</command>. This command expects valid unit names only, it does not accept unit file
1353 paths.</para>
27722f96
LN
1354 </listitem>
1355 </varlistentry>
1356
1357 <varlistentry>
1eecafb8 1358 <term><command>link <replaceable>PATH</replaceable>…</command></term>
27722f96
LN
1359
1360 <listitem>
3990961d
LP
1361 <para>Link a unit file that is not in the unit file search paths into the unit file search path. This
1362 command expects an absolute path to a unit file. The effect of this may be undone with
1363 <command>disable</command>. The effect of this command is that a unit file is made available for commands
1364 such as <command>start</command>, even though it is not installed directly in the unit search path.</para>
27722f96
LN
1365 </listitem>
1366 </varlistentry>
1367
344ca755 1368 <varlistentry>
1eecafb8 1369 <term><command>revert <replaceable>NAME</replaceable>…</command></term>
344ca755
LP
1370
1371 <listitem>
1372 <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration
1373 files that modify the specified units, as well as any user-configured unit file that overrides a matching
1374 vendor supplied unit file. Specifically, for a unit <literal>foo.service</literal> the matching directories
1375 <literal>foo.service.d/</literal> with all their contained files are removed, both below the persistent and
1376 runtime configuration directories (i.e. below <filename>/etc/systemd/system</filename> and
1377 <filename>/run/systemd/system</filename>); if the unit file has a vendor-supplied version (i.e. a unit file
b17649ee 1378 located below <filename>/usr</filename>) any matching persistent or runtime unit file that overrides it is
344ca755
LP
1379 removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below
1380 <filename>/etc/systemd/system</filename> or <filename>/run/systemd/system</filename>, but not in a unit
1381 file stored below <filename>/usr</filename>), then it is not removed. Also, if a unit is masked, it is
1382 unmasked.</para>
1383
1384 <para>Effectively, this command may be used to undo all changes made with <command>systemctl
1385 edit</command>, <command>systemctl set-property</command> and <command>systemctl mask</command> and puts
1386 the original unit file with its settings back in effect.</para>
1387 </listitem>
1388 </varlistentry>
1389
27722f96 1390 <varlistentry>
b619ec8f 1391 <term><command>add-wants <replaceable>TARGET</replaceable>
1eecafb8 1392 <replaceable>NAME</replaceable>…</command></term>
b619ec8f 1393 <term><command>add-requires <replaceable>TARGET</replaceable>
1eecafb8 1394 <replaceable>NAME</replaceable>…</command></term>
27722f96
LN
1395
1396 <listitem>
853382da 1397 <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal>
a8eaaee7 1398 dependencies, respectively, to the specified
853382da 1399 <replaceable>TARGET</replaceable> for one or more units. </para>
27722f96 1400
b619ec8f
LP
1401 <para>This command honors <option>--system</option>,
1402 <option>--user</option>, <option>--runtime</option> and
a8eaaee7 1403 <option>--global</option> in a way similar to
b619ec8f 1404 <command>enable</command>.</para>
27722f96 1405
27722f96
LN
1406 </listitem>
1407 </varlistentry>
7d4fb3b1
RC
1408
1409 <varlistentry>
1eecafb8 1410 <term><command>edit <replaceable>NAME</replaceable>…</command></term>
7d4fb3b1
RC
1411
1412 <listitem>
1413 <para>Edit a drop-in snippet or a whole replacement file if
1414 <option>--full</option> is specified, to extend or override the
1415 specified unit.</para>
1416
1417 <para>Depending on whether <option>--system</option> (the default),
1418 <option>--user</option>, or <option>--global</option> is specified,
a8eaaee7 1419 this command creates a drop-in file for each unit either for the system,
b938cb90 1420 for the calling user, or for all futures logins of all users. Then,
7d4fb3b1
RC
1421 the editor (see the "Environment" section below) is invoked on
1422 temporary files which will be written to the real location if the
1423 editor exits successfully.</para>
1424
1425 <para>If <option>--full</option> is specified, this will copy the
1426 original units instead of creating drop-in files.</para>
1427
39c38ce1
DC
1428 <para>If <option>--force</option> is specified and any units do
1429 not already exist, new unit files will be opened for editing.</para>
1430
7d4fb3b1
RC
1431 <para>If <option>--runtime</option> is specified, the changes will
1432 be made temporarily in <filename>/run</filename> and they will be
1433 lost on the next reboot.</para>
1434
b938cb90
JE
1435 <para>If the temporary file is empty upon exit, the modification of
1436 the related unit is canceled.</para>
7d4fb3b1
RC
1437
1438 <para>After the units have been edited, systemd configuration is
1439 reloaded (in a way that is equivalent to <command>daemon-reload</command>).
1440 </para>
1441
1442 <para>Note that this command cannot be used to remotely edit units
1443 and that you cannot temporarily edit units which are in
b938cb90 1444 <filename>/etc</filename>, since they take precedence over
7d4fb3b1
RC
1445 <filename>/run</filename>.</para>
1446 </listitem>
1447 </varlistentry>
b619ec8f
LP
1448
1449 <varlistentry>
1450 <term><command>get-default</command></term>
1451
1452 <listitem>
1453 <para>Return the default target to boot into. This returns
1454 the target unit name <filename>default.target</filename>
1455 is aliased (symlinked) to.</para>
1456 </listitem>
1457 </varlistentry>
1458
1459 <varlistentry>
1460 <term><command>set-default <replaceable>NAME</replaceable></command></term>
1461
1462 <listitem>
1463 <para>Set the default target to boot into. This sets
1464 (symlinks) the <filename>default.target</filename> alias
1465 to the given target unit.</para>
1466 </listitem>
1467 </varlistentry>
1468
27722f96
LN
1469 </variablelist>
1470 </refsect2>
1471
0d292f5e
LP
1472 <refsect2>
1473 <title>Machine Commands</title>
1474
1475 <variablelist>
1476 <varlistentry>
1eecafb8 1477 <term><command>list-machines <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
0d292f5e
LP
1478
1479 <listitem>
1480 <para>List the host and all running local containers with
1481 their state. If one or more
1482 <replaceable>PATTERN</replaceable>s are specified, only
1483 containers matching one of them are shown.
1484 </para>
1485 </listitem>
1486 </varlistentry>
1487 </variablelist>
1488 </refsect2>
1489
27722f96
LN
1490 <refsect2>
1491 <title>Job Commands</title>
1492
1493 <variablelist>
1494 <varlistentry>
1eecafb8 1495 <term><command>list-jobs <optional><replaceable>PATTERN…</replaceable></optional></command></term>
27722f96
LN
1496
1497 <listitem>
d8fba7c6
ZJS
1498 <para>List jobs that are in progress. If one or more
1499 <replaceable>PATTERN</replaceable>s are specified, only
1500 jobs for units matching one of them are shown.</para>
82948f6c
LP
1501
1502 <para>When combined with <option>--after</option> or <option>--before</option> the list is augmented with
1503 information on which other job each job is waiting for, and which other jobs are waiting for it, see
1504 above.</para>
27722f96
LN
1505 </listitem>
1506 </varlistentry>
1507 <varlistentry>
1eecafb8 1508 <term><command>cancel <replaceable>JOB</replaceable>…</command></term>
27722f96
LN
1509
1510 <listitem>
1511 <para>Cancel one or more jobs specified on the command line
1512 by their numeric job IDs. If no job ID is specified, cancel
1513 all pending jobs.</para>
1514 </listitem>
1515 </varlistentry>
1516 </variablelist>
27722f96
LN
1517 </refsect2>
1518
1519 <refsect2>
1520 <title>Environment Commands</title>
1521
1522 <variablelist>
1523 <varlistentry>
1524 <term><command>show-environment</command></term>
1525
1526 <listitem>
804ee07c
ZJS
1527 <para>Dump the systemd manager environment block. This is the environment
1528 block that is passed to all processes the manager spawns. The environment
1529 block will be dumped in straight-forward form suitable for sourcing into
1530 most shells. If no special characters or whitespace is present in the variable
1531 values, no escaping is performed, and the assignments have the form
1532 <literal>VARIABLE=value</literal>. If whitespace or characters which have
1533 special meaning to the shell are present, dollar-single-quote escaping is
1534 used, and assignments have the form <literal>VARIABLE=$'value'</literal>.
1535 This syntax is known to be supported by
1536 <citerefentry project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1537 <citerefentry project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1538 <citerefentry project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1539 and
1540 <citerefentry project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
1541 <citerefentry project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1542 but not
1543 <citerefentry project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1544 or
1545 <citerefentry project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1546 </para>
27722f96
LN
1547 </listitem>
1548 </varlistentry>
1549 <varlistentry>
1eecafb8 1550 <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term>
27722f96
LN
1551
1552 <listitem>
1553 <para>Set one or more systemd manager environment variables,
1554 as specified on the command line.</para>
1555 </listitem>
1556 </varlistentry>
1557 <varlistentry>
1eecafb8 1558 <term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term>
27722f96
LN
1559
1560 <listitem>
1561 <para>Unset one or more systemd manager environment
1562 variables. If only a variable name is specified, it will be
1563 removed regardless of its value. If a variable and a value
1564 are specified, the variable is only removed if it has the
1565 specified value.</para>
1566 </listitem>
ac3efa8a
LP
1567 </varlistentry>
1568 <varlistentry>
3fb90db2 1569 <term>
b975b0d5 1570 <command>import-environment</command>
1eecafb8 1571 <optional><replaceable>VARIABLE…</replaceable></optional>
b975b0d5 1572 </term>
ac3efa8a
LP
1573
1574 <listitem>
1575 <para>Import all, one or more environment variables set on
1576 the client into the systemd manager environment block. If
73e231ab
JE
1577 no arguments are passed, the entire environment block is
1578 imported. Otherwise, a list of one or more environment
1579 variable names should be passed, whose client-side values
ac3efa8a
LP
1580 are then imported into the manager's environment
1581 block.</para>
1582 </listitem>
27722f96
LN
1583 </varlistentry>
1584 </variablelist>
1585 </refsect2>
1586
1587 <refsect2>
1588 <title>Manager Lifecycle Commands</title>
1589
1590 <variablelist>
1591 <varlistentry>
1592 <term><command>daemon-reload</command></term>
1593
1594 <listitem>
a8eaaee7 1595 <para>Reload the systemd manager configuration. This will
432d5965
ZJS
1596 rerun all generators (see
1597 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>),
1598 reload all unit files, and recreate the entire dependency
1599 tree. While the daemon is being reloaded, all sockets
1600 systemd listens on behalf of user configuration will stay
1601 accessible.</para>
1602
1603 <para>This command should not be confused with the
1604 <command>reload</command> command.</para>
27722f96
LN
1605 </listitem>
1606 </varlistentry>
1607 <varlistentry>
1608 <term><command>daemon-reexec</command></term>
1609
1610 <listitem>
1611 <para>Reexecute the systemd manager. This will serialize the
1612 manager state, reexecute the process and deserialize the
1613 state again. This command is of little use except for
79640424 1614 debugging and package upgrades. Sometimes, it might be
27722f96 1615 helpful as a heavy-weight <command>daemon-reload</command>.
79640424 1616 While the daemon is being reexecuted, all sockets systemd listening
27722f96
LN
1617 on behalf of user configuration will stay accessible.
1618 </para>
1619 </listitem>
1620 </varlistentry>
1621 </variablelist>
1622 </refsect2>
1623
1624 <refsect2>
1625 <title>System Commands</title>
1626
1627 <variablelist>
99813a19
LP
1628 <varlistentry>
1629 <term><command>is-system-running</command></term>
1630
1631 <listitem>
2de51fdc 1632 <para>Checks whether the system is operational. This
94f099d8
LP
1633 returns success (exit code 0) when the system is fully up
1634 and running, specifically not in startup, shutdown or
1635 maintenance mode, and with no failed services. Failure is
1636 returned otherwise (exit code non-zero). In addition, the
2de51fdc 1637 current state is printed in a short string to standard
a8eaaee7 1638 output, see the table below. Use <option>--quiet</option> to
2de51fdc
ZJS
1639 suppress this output.</para>
1640
1641 <table>
94f099d8
LP
1642 <title><command>is-system-running</command> output</title>
1643 <tgroup cols='3'>
1644 <colspec colname='name'/>
1645 <colspec colname='description'/>
1646 <colspec colname='exit-code'/>
2de51fdc
ZJS
1647 <thead>
1648 <row>
1649 <entry>Name</entry>
1650 <entry>Description</entry>
94f099d8 1651 <entry>Exit Code</entry>
2de51fdc
ZJS
1652 </row>
1653 </thead>
1654 <tbody>
1655 <row>
1656 <entry><varname>initializing</varname></entry>
1657 <entry><para>Early bootup, before
1fdfa094
LP
1658 <filename>basic.target</filename> is reached
1659 or the <varname>maintenance</varname> state entered.
2de51fdc 1660 </para></entry>
94f099d8 1661 <entry>&gt; 0</entry>
2de51fdc
ZJS
1662 </row>
1663 <row>
1664 <entry><varname>starting</varname></entry>
1fdfa094
LP
1665 <entry><para>Late bootup, before the job queue
1666 becomes idle for the first time, or one of the
1667 rescue targets are reached.</para></entry>
94f099d8 1668 <entry>&gt; 0</entry>
2de51fdc
ZJS
1669 </row>
1670 <row>
1671 <entry><varname>running</varname></entry>
1672 <entry><para>The system is fully
1673 operational.</para></entry>
94f099d8 1674 <entry>0</entry>
2de51fdc
ZJS
1675 </row>
1676 <row>
1677 <entry><varname>degraded</varname></entry>
1678 <entry><para>The system is operational but one or more
1679 units failed.</para></entry>
94f099d8 1680 <entry>&gt; 0</entry>
2de51fdc
ZJS
1681 </row>
1682 <row>
1683 <entry><varname>maintenance</varname></entry>
1fdfa094 1684 <entry><para>The rescue or emergency target is
2de51fdc 1685 active.</para></entry>
94f099d8 1686 <entry>&gt; 0</entry>
2de51fdc
ZJS
1687 </row>
1688 <row>
1689 <entry><varname>stopping</varname></entry>
1690 <entry><para>The manager is shutting
1691 down.</para></entry>
94f099d8
LP
1692 <entry>&gt; 0</entry>
1693 </row>
1694 <row>
1695 <entry><varname>offline</varname></entry>
1696 <entry><para>The manager is not
1697 running. Specifically, this is the operational
1698 state if an incompatible program is running as
1699 system manager (PID 1).</para></entry>
1700 <entry>&gt; 0</entry>
1701 </row>
1702 <row>
1703 <entry><varname>unknown</varname></entry>
1704 <entry><para>The operational state could not be
1705 determined, due to lack of resources or another
1706 error cause.</para></entry>
1707 <entry>&gt; 0</entry>
2de51fdc
ZJS
1708 </row>
1709 </tbody>
1710 </tgroup>
1711 </table>
99813a19
LP
1712 </listitem>
1713 </varlistentry>
1714
27722f96
LN
1715 <varlistentry>
1716 <term><command>default</command></term>
1717
1718 <listitem>
6324a8a7
LP
1719 <para>Enter default mode. This is equivalent to <command>systemctl isolate default.target</command>. This
1720 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
27722f96
LN
1721 </listitem>
1722 </varlistentry>
99813a19 1723
27722f96
LN
1724 <varlistentry>
1725 <term><command>rescue</command></term>
1726
1727 <listitem>
6324a8a7
LP
1728 <para>Enter rescue mode. This is equivalent to <command>systemctl isolate rescue.target</command>. This
1729 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
27722f96
LN
1730 </listitem>
1731 </varlistentry>
1732 <varlistentry>
1733 <term><command>emergency</command></term>
1734
1735 <listitem>
6324a8a7
LP
1736 <para>Enter emergency mode. This is equivalent to <command>systemctl isolate
1737 emergency.target</command>. This operation is blocking by default, use <option>--no-block</option> to
1738 request asynchronous behavior.</para>
27722f96
LN
1739 </listitem>
1740 </varlistentry>
1741 <varlistentry>
1742 <term><command>halt</command></term>
1743
1744 <listitem>
6324a8a7
LP
1745 <para>Shut down and halt the system. This is mostly equivalent to <command>systemctl start halt.target
1746 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This command is
1747 asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note
1748 that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered
1749 on. Use <command>systemctl poweroff</command> for powering off the system (see below).</para>
1750
1751 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1752 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1753 system halt. If <option>--force</option> is specified twice, the operation is immediately executed without
1754 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1755 <option>--force</option> is specified twice the halt operation is executed by <command>systemctl</command>
1756 itself, and the system manager is not contacted. This means the command should succeed even when the system
1757 manager has crashed.</para>
27722f96
LN
1758 </listitem>
1759 </varlistentry>
1760 <varlistentry>
1761 <term><command>poweroff</command></term>
1762
1763 <listitem>
6324a8a7
LP
1764 <para>Shut down and power-off the system. This is mostly equivalent to <command>systemctl start
1765 poweroff.target --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all
1766 users. This command is asynchronous; it will return after the power-off operation is enqueued, without
1767 waiting for it to complete.</para>
1768
1769 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1770 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1771 powering off. If <option>--force</option> is specified twice, the operation is immediately executed without
1772 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
924e44b4
LP
1773 <option>--force</option> is specified twice the power-off operation is executed by
1774 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
6324a8a7 1775 succeed even when the system manager has crashed.</para>
27722f96
LN
1776 </listitem>
1777 </varlistentry>
1778 <varlistentry>
37185ec8 1779 <term><command>reboot <optional><replaceable>arg</replaceable></optional></command></term>
27722f96
LN
1780
1781 <listitem>
6324a8a7
LP
1782 <para>Shut down and reboot the system. This is mostly equivalent to <command>systemctl start reboot.target
1783 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This
1784 command is asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1785 complete.</para>
1786
1787 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1788 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1789 reboot. If <option>--force</option> is specified twice, the operation is immediately executed without
1790 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
924e44b4
LP
1791 <option>--force</option> is specified twice the reboot operation is executed by
1792 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
6324a8a7
LP
1793 succeed even when the system manager has crashed.</para>
1794
1795 <para>If the optional argument <replaceable>arg</replaceable> is given, it will be passed as the optional
1796 argument to the <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1797 system call. The value is architecture and firmware specific. As an example, <literal>recovery</literal>
1798 might be used to trigger system recovery, and <literal>fota</literal> might be used to trigger a
37185ec8 1799 <quote>firmware over the air</quote> update.</para>
27722f96
LN
1800 </listitem>
1801 </varlistentry>
b619ec8f 1802
27722f96
LN
1803 <varlistentry>
1804 <term><command>kexec</command></term>
1805
1806 <listitem>
6324a8a7
LP
1807 <para>Shut down and reboot the system via <command>kexec</command>. This is equivalent to
1808 <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block</command>. This command is
1809 asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1810 complete.</para>
1811
1812 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1813 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1814 reboot.</para>
27722f96
LN
1815 </listitem>
1816 </varlistentry>
b619ec8f 1817
27722f96 1818 <varlistentry>
287419c1 1819 <term><command>exit <optional><replaceable>EXIT_CODE</replaceable></optional></command></term>
27722f96
LN
1820
1821 <listitem>
6324a8a7
LP
1822 <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in
1823 conjunction with the <option>--user</option> option) or in containers and is equivalent to
1824 <command>poweroff</command> otherwise. This command is asynchronous; it will return after the exit
1825 operation is enqueued, without waiting for it to complete.</para>
1826
dcfaecc7 1827 <para>The service manager will exit with the specified exit code, if
6324a8a7 1828 <replaceable>EXIT_CODE</replaceable> is passed.</para>
27722f96 1829 </listitem>
b619ec8f 1830 </varlistentry>
27722f96 1831
b619ec8f
LP
1832 <varlistentry>
1833 <term><command>switch-root <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></command></term>
1834
1835 <listitem>
fb1bad9d
LP
1836 <para>Switches to a different root directory and executes a new system manager process below it. This is
1837 intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager
1838 process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host
1839 volume. This call takes two arguments: the directory that is to become the new root directory, and the path
1840 to the new system manager binary below it to execute as PID 1. If the latter is omitted or the empty
1841 string, a systemd binary will automatically be searched for and used as init. If the system manager path is
1842 omitted, equal to the empty string or identical to the path to the systemd binary, the state of the
1843 initrd's system manager process is passed to the main system manager, which allows later introspection of
1844 the state of the services involved in the initrd boot phase.</para>
b619ec8f 1845 </listitem>
27722f96 1846 </varlistentry>
b619ec8f 1847
27722f96
LN
1848 <varlistentry>
1849 <term><command>suspend</command></term>
1850
1851 <listitem>
6324a8a7
LP
1852 <para>Suspend the system. This will trigger activation of the special target unit
1853 <filename>suspend.target</filename>. This command is asynchronous, and will return after the suspend
1854 operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.</para>
27722f96
LN
1855 </listitem>
1856 </varlistentry>
b619ec8f 1857
27722f96
LN
1858 <varlistentry>
1859 <term><command>hibernate</command></term>
1860
1861 <listitem>
6324a8a7
LP
1862 <para>Hibernate the system. This will trigger activation of the special target unit
1863 <filename>hibernate.target</filename>. This command is asynchronous, and will return after the hibernation
1864 operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.</para>
27722f96
LN
1865 </listitem>
1866 </varlistentry>
b619ec8f 1867
27722f96
LN
1868 <varlistentry>
1869 <term><command>hybrid-sleep</command></term>
1870
1871 <listitem>
6324a8a7
LP
1872 <para>Hibernate and suspend the system. This will trigger activation of the special target unit
1873 <filename>hybrid-sleep.target</filename>. This command is asynchronous, and will return after the hybrid
1874 sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.</para>
27722f96
LN
1875 </listitem>
1876 </varlistentry>
27722f96
LN
1877 </variablelist>
1878 </refsect2>
4a6022f0 1879
a7c0e5d7
LP
1880 <refsect2>
1881 <title>Parameter Syntax</title>
1882
da25e029 1883 <para>Unit commands listed above take either a single unit name (designated as <replaceable>NAME</replaceable>),
1eecafb8 1884 or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the
da25e029
ZJS
1885 unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"),
1886 systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in
1887 case of commands which operate only on specific unit types. For example,
e3e0314b
ZJS
1888 <programlisting># systemctl start sshd</programlisting> and
1889 <programlisting># systemctl start sshd.service</programlisting>
1890 are equivalent, as are
507e28d8 1891 <programlisting># systemctl isolate default</programlisting>
e3e0314b 1892 and
507e28d8 1893 <programlisting># systemctl isolate default.target</programlisting>
da25e029
ZJS
1894 Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
1895 paths to mount unit names.
e3e0314b
ZJS
1896 <programlisting># systemctl status /dev/sda
1897# systemctl status /home</programlisting>
1898 are equivalent to:
1899 <programlisting># systemctl status dev-sda.device
1900# systemctl status home.mount</programlisting>
2cdbbc9a 1901 In the second case, shell-style globs will be matched against the primary names of all units currently in memory;
1f00eded
LP
1902 literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
1903 names always refer to exactly one unit, but globs may match zero units and this is not considered an
1904 error.</para>
e3e0314b
ZJS
1905
1906 <para>Glob patterns use
decde8cd 1907 <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
e3e0314b
ZJS
1908 so normal shell-style globbing rules are used, and
1909 <literal>*</literal>, <literal>?</literal>,
1910 <literal>[]</literal> may be used. See
decde8cd 1911 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1f00eded 1912 for more details. The patterns are matched against the primary names of
2cdbbc9a 1913 units currently in memory, and patterns which do not match anything
e3e0314b
ZJS
1914 are silently skipped. For example:
1915 <programlisting># systemctl stop sshd@*.service</programlisting>
1f00eded 1916 will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
2cdbbc9a 1917 in memory are not considered for glob expansion.
e3e0314b
ZJS
1918 </para>
1919
1534e170
LP
1920 <para>For unit file commands, the specified <replaceable>NAME</replaceable> should be the name of the unit file
1921 (possibly abbreviated, see above), or the absolute path to the unit file:
e3e0314b
ZJS
1922 <programlisting># systemctl enable foo.service</programlisting>
1923 or
1924 <programlisting># systemctl link /path/to/foo.service</programlisting>
1925 </para>
a7c0e5d7
LP
1926 </refsect2>
1927
4a6022f0
ZJS
1928 </refsect1>
1929
1930 <refsect1>
1931 <title>Exit status</title>
1932
7b870f60 1933 <para>On success, 0 is returned, a non-zero failure
4a6022f0
ZJS
1934 code otherwise.</para>
1935 </refsect1>
1936
7d4fb3b1
RC
1937 <refsect1>
1938 <title>Environment</title>
1939
1940 <variablelist class='environment-variables'>
1941 <varlistentry>
1942 <term><varname>$SYSTEMD_EDITOR</varname></term>
1943
1944 <listitem><para>Editor to use when editing units; overrides
1945 <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither
1946 <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor
1947 <varname>$VISUAL</varname> are present or if it is set to an empty
1948 string or if their execution failed, systemctl will try to execute well
1949 known editors in this order:
9391a1c3 1950 <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
3ba3a79d
ZJS
1951 <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1952 <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1953 <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
7d4fb3b1
RC
1954 </para></listitem>
1955 </varlistentry>
1956 </variablelist>
1957 <xi:include href="less-variables.xml" xpointer="pager"/>
1958 <xi:include href="less-variables.xml" xpointer="less"/>
6e16066e 1959 <xi:include href="less-variables.xml" xpointer="lesscharset"/>
7d4fb3b1 1960 </refsect1>
4a6022f0
ZJS
1961
1962 <refsect1>
1963 <title>See Also</title>
1964 <para>
1965 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
4a6022f0
ZJS
1966 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1967 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
a03fe1a5 1968 <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
4a6022f0 1969 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
ee41f602 1970 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
4a6022f0 1971 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
5aded369 1972 <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
7d4fb3b1 1973 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
432d5965 1974 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
decde8cd 1975 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
4a6022f0
ZJS
1976 </para>
1977 </refsect1>
7874bcd6
LP
1978
1979</refentry>