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