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