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