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