]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemctl.xml
systemctl: Implement --wait for kill command
[thirdparty/systemd.git] / man / systemctl.xml
CommitLineData
514094f9 1<?xml version='1.0'?>
3a54a157 2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
eea10b26 3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
681eb9cf
FB
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
db9ecf05 7<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
7874bcd6 8
21ac6ff1
ZJS
9<refentry id="systemctl"
10 xmlns:xi="http://www.w3.org/2001/XInclude">
7874bcd6 11
4a6022f0
ZJS
12 <refentryinfo>
13 <title>systemctl</title>
14 <productname>systemd</productname>
4a6022f0
ZJS
15 </refentryinfo>
16
17 <refmeta>
18 <refentrytitle>systemctl</refentrytitle>
19 <manvolnum>1</manvolnum>
20 </refmeta>
21
22 <refnamediv>
23 <refname>systemctl</refname>
24 <refpurpose>Control the systemd system and service manager</refpurpose>
25 </refnamediv>
26
27 <refsynopsisdiv>
28 <cmdsynopsis>
29 <command>systemctl</command>
30 <arg choice="opt" rep="repeat">OPTIONS</arg>
31 <arg choice="plain">COMMAND</arg>
da5e955f 32 <arg choice="opt" rep="repeat">UNIT</arg>
4a6022f0
ZJS
33 </cmdsynopsis>
34 </refsynopsisdiv>
35
36 <refsect1>
37 <title>Description</title>
38
a4390b6b
LP
39 <para><command>systemctl</command> may be used to introspect and
40 control the state of the <literal>systemd</literal> system and
41 service manager. Please refer to
4a6022f0 42 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
a4390b6b
LP
43 for an introduction into the basic concepts and functionality this
44 tool manages.</para>
4a6022f0
ZJS
45 </refsect1>
46
47 <refsect1>
e1fac8a6 48 <title>Commands</title>
4a6022f0 49
e1fac8a6 50 <para>The following commands are understood:</para>
4a6022f0 51
e1fac8a6 52 <refsect2>
172338d5 53 <title>Unit Commands (Introspection and Modification)</title>
20b3f379 54
e1fac8a6
ZJS
55 <variablelist>
56 <varlistentry>
57 <term><command>list-units</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
4a6022f0 58
e1fac8a6
ZJS
59 <listitem>
60 <para>List units that <command>systemd</command> currently has in memory. This includes units that are
61 either referenced directly or through a dependency, units that are pinned by applications programmatically,
62 or units that were active in the past and have failed. By default only units which are active, have pending
63 jobs, or have failed are shown; this can be changed with option <option>--all</option>. If one or more
64 <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown. The units
65 that are shown are additionally filtered by <option>--type=</option> and <option>--state=</option> if those
66 options are specified.</para>
4a6022f0 67
7ea5e82f
LP
68 <para>Note that this command does not show unit templates, but only instances of unit
69 templates. Units templates that aren't instantiated are not runnable, and will thus never show up
70 in the output of this command. Specifically this means that <filename>foo@.service</filename>
71 will never be shown in this list — unless instantiated, e.g. as
72 <filename>foo@bar.service</filename>. Use <command>list-unit-files</command> (see below) for
73 listing installed unit template files.</para>
74
e1fac8a6
ZJS
75 <para>Produces output similar to
76 <programlisting> UNIT LOAD ACTIVE SUB DESCRIPTION
77 sys-module-fuse.device loaded active plugged /sys/module/fuse
78 -.mount loaded active mounted Root Mount
79 boot-efi.mount loaded active mounted /boot/efi
80 systemd-journald.service loaded active running Journal Service
81 systemd-logind.service loaded active running Login Service
82● user@1000.service loaded failed failed User Manager for UID 1000
83
84 systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
9b9b3d36 85
e1fac8a6
ZJS
86LOAD = Reflects whether the unit definition was properly loaded.
87ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
88SUB = The low-level unit activation state, values depend on unit type.
e16972e6 89
e1fac8a6 90123 loaded units listed. Pass --all to see loaded but inactive units, too.
7ea5e82f
LP
91To show all installed unit files use 'systemctl list-unit-files'.</programlisting></para>
92
93 <para>The header and the last unit of a given type are underlined if the terminal supports
94 that. A colored dot is shown next to services which were masked, not found, or otherwise
95 failed.</para>
9b9b3d36 96
e1fac8a6
ZJS
97 <para>The LOAD column shows the load state, one of <constant>loaded</constant>,
98 <constant>not-found</constant>, <constant>bad-setting</constant>, <constant>error</constant>,
99 <constant>masked</constant>. The ACTIVE columns shows the general unit state, one of
100 <constant>active</constant>, <constant>reloading</constant>, <constant>inactive</constant>,
101 <constant>failed</constant>, <constant>activating</constant>, <constant>deactivating</constant>. The SUB
102 column shows the unit-type-specific detailed state of the unit, possible values vary by unit type. The list
103 of possible LOAD, ACTIVE, and SUB states is not constant and new systemd releases may both add and remove
6870daff 104 values. <programlisting>systemctl --state=help</programlisting> command may be used to display the
e1fac8a6 105 current set of possible values.</para>
4a6022f0 106
e1fac8a6
ZJS
107 <para>This is the default command.</para>
108 </listitem>
109 </varlistentry>
ea539eb6 110
2d5cdc62
DT
111 <varlistentry>
112 <term><command>list-automounts</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
113
114 <listitem>
115 <para>List automount units currently in memory, ordered by mount path. If one or more
116 <replaceable>PATTERN</replaceable>s are specified, only automount units matching one of them are shown.
117 Produces output similar to
118 <programlisting>
119WHAT WHERE MOUNTED IDLE TIMEOUT UNIT
120/dev/sdb1 /mnt/test no 120s mnt-test.automount
121binfmt_misc /proc/sys/fs/binfmt_misc yes 0 proc-sys-fs-binfmt_misc.automount
122
1232 automounts listed.</programlisting>
124 </para>
125
126 <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para>
ec07c3c8
AK
127
128 <xi:include href="version-info.xml" xpointer="v252"/>
2d5cdc62
DT
129 </listitem>
130 </varlistentry>
131
160b8e98
DT
132 <varlistentry>
133 <term><command>list-paths</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
134
135 <listitem>
136 <para>List path units currently in memory, ordered by path. If one or more
137 <replaceable>PATTERN</replaceable>s are specified, only path units matching one of them are shown.
138 Produces output similar to
139 <programlisting>
140PATH CONDITION UNIT ACTIVATES
141/run/systemd/ask-password DirectoryNotEmpty systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service
142/run/systemd/ask-password DirectoryNotEmpty systemd-ask-password-wall.path systemd-ask-password-wall.service
143/var/cache/cups/org.cups.cupsd PathExists cups.path cups.service
144
1453 paths listed.</programlisting>
146 </para>
147
148 <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para>
ec07c3c8
AK
149
150 <xi:include href="version-info.xml" xpointer="v254"/>
160b8e98
DT
151 </listitem>
152 </varlistentry>
153
e1fac8a6
ZJS
154 <varlistentry>
155 <term><command>list-sockets</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
ea539eb6 156
e1fac8a6
ZJS
157 <listitem>
158 <para>List socket units currently in memory, ordered by listening address. If one or more
159 <replaceable>PATTERN</replaceable>s are specified, only socket units matching one of them are
160 shown. Produces output similar to
161 <programlisting>
162LISTEN UNIT ACTIVATES
163/dev/initctl systemd-initctl.socket systemd-initctl.service
164
165[::]:22 sshd.socket sshd.service
166kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
4a6022f0 167
e1fac8a6
ZJS
1685 sockets listed.</programlisting>
169 Note: because the addresses might contains spaces, this output
170 is not suitable for programmatic consumption.
171 </para>
4a6022f0 172
e1fac8a6 173 <para>Also see <option>--show-types</option>, <option>--all</option>, and <option>--state=</option>.</para>
aefdc112
AK
174
175 <xi:include href="version-info.xml" xpointer="v202"/>
e1fac8a6
ZJS
176 </listitem>
177 </varlistentry>
21b587cf 178
e1fac8a6
ZJS
179 <varlistentry>
180 <term><command>list-timers</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
e9fbae3f 181
e1fac8a6
ZJS
182 <listitem>
183 <para>List timer units currently in memory, ordered by the time they elapse next. If one or more
184 <replaceable>PATTERN</replaceable>s are specified, only units matching one of them are shown.
185 Produces output similar to
186 <programlisting>
187NEXT LEFT LAST PASSED UNIT ACTIVATES
8a965108 188- - Thu 2017-02-23 13:40:29 EST 3 days ago ureadahead-stop.timer ureadahead-stop.service
e1fac8a6
ZJS
189Sun 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
190Sun 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
191Sun 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
192 </programlisting>
193 </para>
4fa226ff 194
e1fac8a6
ZJS
195 <para><emphasis>NEXT</emphasis> shows the next time the timer will run.</para>
196 <para><emphasis>LEFT</emphasis> shows how long till the next time the timer runs.</para>
197 <para><emphasis>LAST</emphasis> shows the last time the timer ran.</para>
198 <para><emphasis>PASSED</emphasis> shows how long has passed since the timer last ran.</para>
199 <para><emphasis>UNIT</emphasis> shows the name of the timer</para>
200 <para><emphasis>ACTIVATES</emphasis> shows the name the service the timer activates when it runs.</para>
4a6022f0 201
e1fac8a6 202 <para>Also see <option>--all</option> and <option>--state=</option>.</para>
aefdc112
AK
203
204 <xi:include href="version-info.xml" xpointer="v209"/>
e1fac8a6
ZJS
205 </listitem>
206 </varlistentry>
1238ee09 207
172338d5
ZJS
208 <varlistentry>
209 <term><command>is-active <replaceable>PATTERN</replaceable>…</command></term>
210
211 <listitem>
212 <para>Check whether any of the specified units are active
213 (i.e. running). Returns an exit code
214 <constant>0</constant> if at least one is active, or
215 non-zero otherwise. Unless <option>--quiet</option> is
216 specified, this will also print the current unit state to
217 standard output.</para>
218 </listitem>
219 </varlistentry>
220
221 <varlistentry>
2ee34616 222 <term><command>is-failed <optional><replaceable>PATTERN</replaceable>…</optional></command></term>
172338d5
ZJS
223
224 <listitem>
2ee34616
MY
225 <para>Check whether any of the specified units is in the "failed" state. If no unit is specified,
226 check whether there are any failed units, which corresponds to the <literal>degraded</literal> state
227 returned by <command>is-system-running</command>. Returns an exit code <constant>0</constant>
228 if at least one has failed, non-zero otherwise. Unless <option>--quiet</option> is specified, this
229 will also print the current unit or system state to standard output.</para>
aefdc112
AK
230
231 <xi:include href="version-info.xml" xpointer="v197"/>
172338d5
ZJS
232 </listitem>
233 </varlistentry>
234
235 <varlistentry>
236 <term><command>status</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…]</optional></term>
237
238 <listitem>
a6e33464
ZJS
239 <para>Show runtime status information about the whole system or about one or more units followed
240 by most recent log data from the journal. If no positional arguments are specified, and no unit
241 filter is given with <option>--type=</option>, <option>--state=</option>, or
242 <option>--failed</option>, shows the status of the whole system. If combined with
243 <option>--all</option>, follows that with the status of all units. If positional arguments are
244 specified, each positional argument is treated as either a unit name to show, or a glob pattern
245 to show units whose names match that pattern, or a PID to show the unit containing that PID. When
246 <option>--type=</option>, <option>--state=</option>, or <option>--failed</option> are used, units
247 are additionally filtered by the TYPE and ACTIVE state.</para>
172338d5 248
157cb433
LP
249 <para>This function is intended to generate human-readable output. If you are looking for
250 computer-parsable output, use <command>show</command> instead. By default, this function only
251 shows 10 lines of output and ellipsizes lines to fit in the terminal window. This can be changed
252 with <option>--lines</option> and <option>--full</option>, see above. In addition,
253 <command>journalctl --unit=<replaceable>NAME</replaceable></command> or <command>journalctl
254 --user-unit=<replaceable>NAME</replaceable></command> use a similar filter for messages and might
255 be more convenient.</para>
256
1374f5a0 257 <para>Note that this operation only displays <emphasis>runtime</emphasis> status, i.e. information about
157cb433
LP
258 the current invocation of the unit (if it is running) or the most recent invocation (if it is not
259 running anymore, and has not been released from memory). Information about earlier invocations,
260 invocations from previous system boots, or prior invocations that have already been released from
261 memory may be retrieved via <command>journalctl --unit=</command>.</para>
262
263 <para>systemd implicitly loads units as necessary, so just running the <command>status</command>
264 will attempt to load a file. The command is thus not useful for determining if something was
265 already loaded or not. The units may possibly also be quickly unloaded after the operation is
266 completed if there's no reason to keep it in memory thereafter.</para>
172338d5
ZJS
267
268 <example>
269 <title>Example output from systemctl status </title>
270
271 <programlisting>$ systemctl status bluetooth
272● bluetooth.service - Bluetooth service
c1e0dc9c 273 Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; preset: enabled)
172338d5
ZJS
274 Active: active (running) since Wed 2017-01-04 13:54:04 EST; 1 weeks 0 days ago
275 Docs: man:bluetoothd(8)
276 Main PID: 930 (bluetoothd)
277 Status: "Running"
278 Tasks: 1
279 Memory: 648.0K
280 CPU: 435ms
281 CGroup: /system.slice/bluetooth.service
282 └─930 /usr/lib/bluetooth/bluetoothd
283
284Jan 12 10:46:45 example.com bluetoothd[8900]: Not enough free handles to register service
285Jan 12 10:46:45 example.com bluetoothd[8900]: Current Time Service could not be registered
286Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output error (5)
287</programlisting>
288
0c772b1c
LP
289 <para>The dot ("●") uses color on supported terminals to summarize the unit state at a
290 glance. Along with its color, its shape varies according to its state:
291 <literal>inactive</literal> or <literal>maintenance</literal> is a white circle ("○"),
292 <literal>active</literal> is a green dot ("●"), <literal>deactivating</literal> is a white dot,
293 <literal>failed</literal> or <literal>error</literal> is a red cross ("×"), and
294 <literal>reloading</literal> is a green clockwise circle arrow ("↻").</para>
295
296 <para>The "Loaded:" line in the output will show <literal>loaded</literal> if the unit has been
297 loaded into memory. Other possible values for "Loaded:" include: <literal>error</literal> if
298 there was a problem loading it, <literal>not-found</literal> if no unit file was found for this
299 unit, <literal>bad-setting</literal> if an essential unit file setting could not be parsed and
300 <literal>masked</literal> if the unit file has been masked. Along with showing the path to the
301 unit file, this line will also show the enablement state. Enabled units are included in the
302 dependency network between units, and thus are started at boot or via some other form of
303 activation. See the full table of possible enablement states — including the definition of
304 <literal>masked</literal> — in the documentation for the <command>is-enabled</command> command.
172338d5
ZJS
305 </para>
306
307 <para>The "Active:" line shows active state. The value is usually <literal>active</literal> or
0c772b1c
LP
308 <literal>inactive</literal>. Active could mean started, bound, plugged in, etc depending on the
309 unit type. The unit could also be in process of changing states, reporting a state of
310 <literal>activating</literal> or <literal>deactivating</literal>. A special
311 <literal>failed</literal> state is entered when the service failed in some way, such as a crash,
312 exiting with an error code or timing out. If the failed state is entered the cause will be logged
313 for later reference.</para>
172338d5
ZJS
314 </example>
315
316 </listitem>
317 </varlistentry>
318
319 <varlistentry>
320 <term><command>show</command> <optional><replaceable>PATTERN</replaceable>…|<replaceable>JOB</replaceable>…</optional></term>
321
322 <listitem>
323 <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified,
324 properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and
325 if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use
326 <option>--all</option> to show those too. To select specific properties to show, use
327 <option>--property=</option>. This command is intended to be used whenever computer-parsable output is
328 required. Use <command>status</command> if you are looking for formatted human-readable output.</para>
329
330 <para>Many properties shown by <command>systemctl show</command> map directly to configuration settings of
331 the system and service manager and its unit files. Note that the properties shown by the command are
332 generally more low-level, normalized versions of the original configuration settings and expose runtime
333 state in addition to configuration. For example, properties shown for service units include the service's
334 current main process identifier as <literal>MainPID</literal> (which is runtime state), and time settings
335 are always exposed as properties ending in the <literal>…USec</literal> suffix even if a matching
336 configuration options end in <literal>…Sec</literal>, because microseconds is the normalized time unit used
337 internally by the system and service manager.</para>
338
339 <para>For details about many of these properties, see the documentation of the D-Bus interface
340 backing these properties, see
341 <citerefentry><refentrytitle>org.freedesktop.systemd1</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
342 </listitem>
343 </varlistentry>
344
345 <varlistentry>
346 <term><command>cat <replaceable>PATTERN</replaceable>…</command></term>
347
348 <listitem>
349 <para>Show backing files of one or more units. Prints the
350 "fragment" and "drop-ins" (source files) of units. Each
351 file is preceded by a comment which includes the file
352 name. Note that this shows the contents of the backing files
353 on disk, which may not match the system manager's
354 understanding of these units if any unit files were
355 updated on disk and the <command>daemon-reload</command>
356 command wasn't issued since.</para>
aefdc112
AK
357
358 <xi:include href="version-info.xml" xpointer="v209"/>
172338d5
ZJS
359 </listitem>
360 </varlistentry>
361
362 <varlistentry>
363 <term><command>help <replaceable>PATTERN</replaceable>…|<replaceable>PID</replaceable>…</command></term>
364
365 <listitem>
366 <para>Show manual pages for one or more units, if
367 available. If a PID is given, the manual pages for the unit
368 the process belongs to are shown.</para>
aefdc112
AK
369
370 <xi:include href="version-info.xml" xpointer="v185"/>
172338d5
ZJS
371 </listitem>
372 </varlistentry>
373
374 <varlistentry>
375 <term>
376 <command>list-dependencies</command>
377 <optional><replaceable>UNIT</replaceable>...</optional>
378 </term>
379
380 <listitem>
381 <para>Shows units required and wanted by the specified
382 units. This recursively lists units following the
38f90179
MY
383 <varname>Requires=</varname>, <varname>Requisite=</varname>,
384 <varname>Wants=</varname>, <varname>ConsistsOf=</varname>,
385 <varname>BindsTo=</varname>, and <varname>Upholds=</varname>
172338d5
ZJS
386 dependencies. If no units are specified,
387 <filename>default.target</filename> is implied.</para>
388
37299769
MY
389 <para>The units that are shown are additionally filtered by <option>--type=</option> and
390 <option>--state=</option> if those options are specified. Note that we won't be able to
391 use a tree structure in this case, so <option>--plain</option> is implied.</para>
392
172338d5
ZJS
393 <para>By default, only target units are recursively
394 expanded. When <option>--all</option> is passed, all other
395 units are recursively expanded as well.</para>
396
397 <para>Options <option>--reverse</option>,
398 <option>--after</option>, <option>--before</option>
399 may be used to change what types of dependencies
400 are shown.</para>
401
402 <para>Note that this command only lists units currently loaded into memory by the service manager. In
403 particular, this command is not suitable to get a comprehensive list at all reverse dependencies on a
404 specific unit, as it won't list the dependencies declared by units currently not loaded.</para>
aefdc112
AK
405
406 <xi:include href="version-info.xml" xpointer="v198"/>
172338d5
ZJS
407 </listitem>
408 </varlistentry>
409
410 <!-- Commands that modify unit state start here -->
411
e1fac8a6
ZJS
412 <varlistentry>
413 <term><command>start <replaceable>PATTERN</replaceable>…</command></term>
1238ee09 414
e1fac8a6 415 <listitem>
1d56bc09
ZJS
416 <para>Start (activate) one or more units specified on the command line.</para>
417
418 <para>Note that unit glob patterns expand to names of units currently in memory. Units which are
419 not active and are not in a failed state usually are not in memory, and will not be matched by
420 any pattern. In addition, in case of instantiated units, systemd is often unaware of the instance
421 name until the instance has been started. Therefore, using glob patterns with
422 <command>start</command> has limited usefulness. Also, secondary alias names of units are not
423 considered.</para>
424
425 <para>Option <option>--all</option> may be used to also operate on inactive units which are
426 referenced by other loaded units. Note that this is not the same as operating on "all" possible
427 units, because as the previous paragraph describes, such a list is ill-defined. Nevertheless,
428 <command>systemctl start --all <replaceable>GLOB</replaceable></command> may be useful if all the
429 units that should match the pattern are pulled in by some target which is known to be loaded.
430 </para>
e1fac8a6
ZJS
431 </listitem>
432 </varlistentry>
433 <varlistentry>
434 <term><command>stop <replaceable>PATTERN</replaceable>…</command></term>
afba4199 435
e1fac8a6
ZJS
436 <listitem>
437 <para>Stop (deactivate) one or more units specified on the command line.</para>
9029f642 438
e1fac8a6
ZJS
439 <para>This command will fail if the unit does not exist or if stopping of the unit is prohibited (see
440 <varname>RefuseManualStop=</varname> in
441 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
442 It will <emphasis>not</emphasis> fail if any of the commands configured to stop the unit
443 (<varname>ExecStop=</varname>, etc.) fail, because the manager will still forcibly terminate the
444 unit.</para>
0b675f97
MY
445
446 <para>If a unit that gets stopped can still be triggered by other units, a warning containing
447 the names of the triggering units is shown. <option>--no-warn</option> can be used to suppress
448 the warning.</para>
e1fac8a6
ZJS
449 </listitem>
450 </varlistentry>
451 <varlistentry>
452 <term><command>reload <replaceable>PATTERN</replaceable>…</command></term>
f6375e83 453
e1fac8a6
ZJS
454 <listitem>
455 <para>Asks all units listed on the command line to reload
456 their configuration. Note that this will reload the
457 service-specific configuration, not the unit configuration
458 file of systemd. If you want systemd to reload the
459 configuration file of a unit, use the
460 <command>daemon-reload</command> command. In other words:
461 for the example case of Apache, this will reload Apache's
462 <filename>httpd.conf</filename> in the web server, not the
463 <filename>apache.service</filename> systemd unit
464 file.</para>
82948f6c 465
e1fac8a6
ZJS
466 <para>This command should not be confused with the
467 <command>daemon-reload</command> command.</para>
468 </listitem>
9029f642 469
e1fac8a6
ZJS
470 </varlistentry>
471 <varlistentry>
472 <term><command>restart <replaceable>PATTERN</replaceable>…</command></term>
afba4199 473
e1fac8a6
ZJS
474 <listitem>
475 <para>Stop and then start one or more units specified on the command line. If the units are not running
476 yet, they will be started.</para>
afba4199 477
e1fac8a6
ZJS
478 <para>Note that restarting a unit with this command does not necessarily flush out all of the unit's
479 resources before it is started again. For example, the per-service file descriptor storage facility (see
480 <varname>FileDescriptorStoreMax=</varname> in
481 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>) will
482 remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and
483 no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a
484 restart operation an explicit <command>systemctl stop</command> command followed by <command>systemctl
485 start</command> should be issued.</para>
486 </listitem>
487 </varlistentry>
488 <varlistentry>
489 <term><command>try-restart <replaceable>PATTERN</replaceable>…</command></term>
4a6022f0 490
e1fac8a6
ZJS
491 <listitem>
492 <para>Stop and then start one or more units specified on the
493 command line if the units are running. This does nothing
494 if units are not running.</para>
495 <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally
496 don't document that. -->
497 </listitem>
498 </varlistentry>
499 <varlistentry>
500 <term><command>reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
4a6022f0 501
e1fac8a6
ZJS
502 <listitem>
503 <para>Reload one or more units if they support it. If not, stop and then start them instead. If the units
504 are not running yet, they will be started.</para>
505 </listitem>
506 </varlistentry>
507 <varlistentry>
508 <term><command>try-reload-or-restart <replaceable>PATTERN</replaceable>…</command></term>
4f9a9105 509
e1fac8a6
ZJS
510 <listitem>
511 <para>Reload one or more units if they support it. If not, stop and then start them instead. This does
512 nothing if the units are not running.</para>
513 <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
514 don't document that. -->
aefdc112 515
465a9d2a 516 <xi:include href="version-info.xml" xpointer="v229"/>
e1fac8a6
ZJS
517 </listitem>
518 </varlistentry>
519 <varlistentry>
520 <term><command>isolate <replaceable>UNIT</replaceable></command></term>
4f9a9105 521
e1fac8a6
ZJS
522 <listitem>
523 <para>Start the unit specified on the command line and its dependencies
524 and stop all others, unless they have
525 <option>IgnoreOnIsolate=yes</option> (see
526 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
527 If a unit name with no extension is given, an extension of
528 <literal>.target</literal> will be assumed.</para>
991f2a39 529
5cf821ac
ZJS
530 <para>This command is dangerous, since it will immediately stop processes that are not enabled in
531 the new target, possibly including the graphical environment or terminal you are currently using.
532 </para>
991f2a39 533
483bf564 534 <para>Note that this operation is allowed only on units where
e1fac8a6
ZJS
535 <option>AllowIsolate=</option> is enabled. See
536 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
537 for details.</para>
538 </listitem>
539 </varlistentry>
540 <varlistentry>
541 <term><command>kill <replaceable>PATTERN</replaceable>…</command></term>
23ade460 542
e1fac8a6 543 <listitem>
f4ff3e71
LP
544 <para>Send a UNIX process signal to one or more processes of the unit. Use
545 <option>--kill-whom=</option> to select which process to send the signal to. Use
546 <option>--signal=</option> to select the signal to send. Combine with
547 <option>--kill-value=</option> to enqueue a POSIX Realtime Signal with an associated
548 value.</para>
e1fac8a6
ZJS
549 </listitem>
550 </varlistentry>
551 <varlistentry>
552 <term><command>clean <replaceable>PATTERN</replaceable>…</command></term>
4dc5b821 553
e1fac8a6
ZJS
554 <listitem>
555 <para>Remove the configuration, state, cache, logs or runtime data of the specified units. Use
556 <option>--what=</option> to select which kind of resource to remove. For service units this may
557 be used to remove the directories configured with <varname>ConfigurationDirectory=</varname>,
558 <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>,
559 <varname>LogsDirectory=</varname> and <varname>RuntimeDirectory=</varname>, see
560 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
94d82b59 561 for details. It may also be used to clear the file descriptor store as enabled via
4fb8f1e8
LP
562 <varname>FileDescriptorStoreMax=</varname>, see
563 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
564 for details. For timer units this may be used to clear out the persistent timestamp data if
e1fac8a6
ZJS
565 <varname>Persistent=</varname> is used and <option>--what=state</option> is selected, see
566 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>. This
567 command only applies to units that use either of these settings. If <option>--what=</option> is
4fb8f1e8
LP
568 not specified, the cache and runtime data as well as the file descriptor store are removed (as
569 these three types of resources are generally redundant and reproducible on the next invocation of
570 the unit). Note that the specified units must be stopped to invoke this operation.</para>
aefdc112 571
ef5f7f94
LB
572 <table>
573 <title>
574 Possible values for <option>--what=</option>
575 </title>
576
577 <tgroup cols='2'>
578 <thead>
579 <row>
580 <entry>Value</entry>
581 <entry>Unit Setting</entry>
582 </row>
583 </thead>
584 <tbody>
585 <row>
586 <entry><literal>runtime</literal></entry>
587 <entry><varname>RuntimeDirectory=</varname></entry>
588 </row>
589 <row>
590 <entry><literal>state</literal></entry>
591 <entry><varname>StateDirectory=</varname></entry>
592 </row>
593 <row>
594 <entry><literal>cache</literal></entry>
595 <entry><varname>CacheDirectory=</varname></entry>
596 </row>
597 <row>
598 <entry><literal>logs</literal></entry>
599 <entry><varname>LogsDirectory=</varname></entry>
600 </row>
601 <row>
602 <entry><literal>configuration</literal></entry>
603 <entry><varname>ConfigurationDirectory=</varname></entry>
604 </row>
605 <row>
606 <entry><literal>fdstore</literal></entry>
607 <entry><varname>FileDescriptorStorePreserve=</varname></entry>
608 </row>
609 <row>
610 <entry><literal>all</literal></entry>
611 <entry>All of the above</entry>
612 </row>
613 </tbody>
614 </tgroup>
615 </table>
616
aefdc112 617 <xi:include href="version-info.xml" xpointer="v243"/>
e1fac8a6
ZJS
618 </listitem>
619 </varlistentry>
d9e45bc3
MS
620 <varlistentry>
621 <term><command>freeze <replaceable>PATTERN</replaceable>…</command></term>
622
623 <listitem>
624 <para>Freeze one or more units specified on the
625 command line using cgroup freezer</para>
626
627 <para>Freezing the unit will cause all processes contained within the cgroup corresponding to the unit
628 to be suspended. Being suspended means that unit's processes won't be scheduled to run on CPU until thawed.
629 Note that this command is supported only on systems that use unified cgroup hierarchy. Unit is automatically
630 thawed just before we execute a job against the unit, e.g. before the unit is stopped.</para>
aefdc112
AK
631
632 <xi:include href="version-info.xml" xpointer="v246"/>
d9e45bc3
MS
633 </listitem>
634 </varlistentry>
635 <varlistentry>
636 <term><command>thaw <replaceable>PATTERN</replaceable>…</command></term>
637
638 <listitem>
639 <para>Thaw (unfreeze) one or more units specified on the
640 command line.</para>
641
642 <para>This is the inverse operation to the <command>freeze</command> command and resumes the execution of
643 processes in the unit's cgroup.</para>
aefdc112
AK
644
645 <xi:include href="version-info.xml" xpointer="v246"/>
d9e45bc3
MS
646 </listitem>
647 </varlistentry>
e1fac8a6
ZJS
648 <varlistentry>
649 <term><command>set-property <replaceable>UNIT</replaceable> <replaceable>PROPERTY</replaceable>=<replaceable>VALUE</replaceable>…</command></term>
1ae17672 650
e1fac8a6
ZJS
651 <listitem>
652 <para>Set the specified unit properties at runtime where
653 this is supported. This allows changing configuration
654 parameter properties such as resource control settings at
655 runtime. Not all properties may be changed at runtime, but
656 many resource control settings (primarily those in
657 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
658 may. The changes are applied immediately, and stored on disk
659 for future boots, unless <option>--runtime</option> is
660 passed, in which case the settings only apply until the
661 next reboot. The syntax of the property assignment follows
662 closely the syntax of assignments in unit files.</para>
4a6022f0 663
e1fac8a6 664 <para>Example: <command>systemctl set-property foobar.service CPUWeight=200</command></para>
4a6022f0 665
e1fac8a6
ZJS
666 <para>If the specified unit appears to be inactive, the
667 changes will be only stored on disk as described
668 previously hence they will be effective when the unit will
669 be started.</para>
4a6022f0 670
e1fac8a6
ZJS
671 <para>Note that this command allows changing multiple properties at the same time, which is
672 preferable over setting them individually.</para>
93a08841 673
e1fac8a6 674 <para>Example: <command>systemctl set-property foobar.service CPUWeight=200 MemoryMax=2G IPAccounting=yes</command></para>
93a08841 675
e1fac8a6
ZJS
676 <para>Like with unit file configuration settings, assigning an empty setting usually resets a
677 property to its defaults.</para>
adb6cd9b 678
e1fac8a6 679 <para>Example: <command>systemctl set-property avahi-daemon.service IPAddressDeny=</command></para>
aefdc112
AK
680
681 <xi:include href="version-info.xml" xpointer="v206"/>
e1fac8a6
ZJS
682 </listitem>
683 </varlistentry>
4a6022f0 684
5e8deb94 685 <varlistentry>
e04eae5e
ZJS
686 <term>
687 <command>bind</command>
688 <replaceable>UNIT</replaceable>
689 <replaceable>PATH</replaceable>
690 [<replaceable>PATH</replaceable>]
691 </term>
692
693 <listitem><para>Bind-mounts a file or directory from the host into the specified unit's mount
694 namespace. The first path argument is the source file or directory on the host, the second path
695 argument is the destination file or directory in the unit's mount namespace. When the latter is
696 omitted, the destination path in the unit's mount namespace is the same as the source path on the
697 host. When combined with the <option>--read-only</option> switch, a ready-only bind mount is
698 created. When combined with the <option>--mkdir</option> switch, the destination path is first
699 created before the mount is applied.</para>
700
701 <para>Note that this option is currently only supported for units that run within a mount namespace
702 (e.g.: with <option>RootImage=</option>, <option>PrivateMounts=</option>, etc.). This command
703 supports bind-mounting directories, regular files, device nodes, <constant>AF_UNIX</constant>
704 socket nodes, as well as FIFOs. The bind mount is ephemeral, and it is undone as soon as the
705 current unit process exists. Note that the namespace mentioned here, where the bind mount will be
706 added to, is the one where the main service process runs. Other processes (those exececuted by
707 <option>ExecReload=</option>, <option>ExecStartPre=</option>, etc.) run in distinct namespaces.
ec07c3c8
AK
708 </para>
709
7c83d42e
LB
710 <para>If supported by the kernel, any prior mount on the selected target will be replaced by the
711 new mount. If not supported, any prior mount will be over-mounted, but remain pinned and
712 inaccessible.</para>
713
ec07c3c8 714 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
e04eae5e
ZJS
715 </varlistentry>
716
717 <varlistentry>
718 <term>
719 <command>mount-image</command>
720 <replaceable>UNIT</replaceable>
721 <replaceable>IMAGE</replaceable>
722 [<replaceable>PATH</replaceable>
723 [<replaceable>PARTITION_NAME</replaceable>:<replaceable>MOUNT_OPTIONS</replaceable>]]
724 </term>
725
726 <listitem><para>Mounts an image from the host into the specified unit's mount namespace. The first
727 path argument is the source image on the host, the second path argument is the destination
728 directory in the unit's mount namespace (i.e. inside
729 <option>RootImage=</option>/<option>RootDirectory=</option>). The following argument, if any, is
730 interpreted as a colon-separated tuple of partition name and comma-separated list of mount options
731 for that partition. The format is the same as the service <option>MountImages=</option>
732 setting. When combined with the <option>--read-only</option> switch, a ready-only mount is
733 created. When combined with the <option>--mkdir</option> switch, the destination path is first
734 created before the mount is applied.</para>
735
736 <para>Note that this option is currently only supported for units that run within a mount namespace
737 (i.e. with <option>RootImage=</option>, <option>PrivateMounts=</option>, etc.). Note that the
738 namespace mentioned here where the image mount will be added to, is the one where the main service
739 process runs. Note that the namespace mentioned here, where the bind mount will be
740 added to, is the one where the main service process runs. Other processes (those exececuted by
741 <option>ExecReload=</option>, <option>ExecStartPre=</option>, etc.) run in distinct namespaces.
742 </para>
743
7c83d42e
LB
744 <para>If supported by the kernel, any prior mount on the selected target will be replaced by the
745 new mount. If not supported, any prior mount will be over-mounted, but remain pinned and
746 inaccessible.</para>
747
e04eae5e 748 <para>Example:
6faecbd3 749 <programlisting>systemctl mount-image foo.service /tmp/img.raw /var/lib/image root:ro,nosuid</programlisting>
e04eae5e 750 <programlisting>systemctl mount-image --mkdir bar.service /tmp/img.raw /var/lib/baz/img</programlisting>
ec07c3c8
AK
751 </para>
752
753 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
6faecbd3
LB
754 </varlistentry>
755
6824c132
ZJS
756 <varlistentry>
757 <term><command>service-log-level</command> <replaceable>SERVICE</replaceable> [<replaceable>LEVEL</replaceable>]</term>
758
759 <listitem><para>If the <replaceable>LEVEL</replaceable> argument is not given, print the current
760 log level as reported by service <replaceable>SERVICE</replaceable>.</para>
761
762 <para>If the optional argument <replaceable>LEVEL</replaceable> is provided, then change the
763 current log level of the service to <replaceable>LEVEL</replaceable>. The log level should be a
764 typical syslog log level, i.e. a value in the range 0…7 or one of the strings
765 <constant>emerg</constant>, <constant>alert</constant>, <constant>crit</constant>,
766 <constant>err</constant>, <constant>warning</constant>, <constant>notice</constant>,
767 <constant>info</constant>, <constant>debug</constant>; see <citerefentry
768 project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
769 for details.</para>
770
771 <para>The service must have the appropriate
772 <varname>BusName=<replaceable>destination</replaceable></varname> property and also implement the
773 generic
774 <citerefentry><refentrytitle>org.freedesktop.LogControl1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
775 interface. (<filename>systemctl</filename> will use the generic D-Bus protocol to access the
776 <interfacename>org.freedesktop.LogControl1.LogLevel</interfacename> interface for the D-Bus name
ec07c3c8
AK
777 <replaceable>destination</replaceable>.)</para>
778
779 <xi:include href="version-info.xml" xpointer="v247"/></listitem>
6824c132
ZJS
780 </varlistentry>
781
782 <varlistentry>
783 <term><command>service-log-target</command> <replaceable>SERVICE</replaceable> [<replaceable>TARGET</replaceable>]</term>
784
785 <listitem><para>If the <replaceable>TARGET</replaceable> argument is not given, print the current
786 log target as reported by service <replaceable>SERVICE</replaceable>.</para>
787
788 <para>If the optional argument <replaceable>TARGET</replaceable> is provided, then change the
789 current log target of the service to <replaceable>TARGET</replaceable>. The log target should be
790 one of the strings <constant>console</constant> (for log output to the service's standard error
791 stream), <constant>kmsg</constant> (for log output to the kernel log buffer),
792 <constant>journal</constant> (for log output to
793 <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
794 using the native journal protocol), <constant>syslog</constant> (for log output to the classic
795 syslog socket <filename>/dev/log</filename>), <constant>null</constant> (for no log output
796 whatsoever) or <constant>auto</constant> (for an automatically determined choice, typically
797 equivalent to <constant>console</constant> if the service is invoked interactively, and
798 <constant>journal</constant> or <constant>syslog</constant> otherwise).</para>
799
800 <para>For most services, only a small subset of log targets make sense. In particular, most
801 "normal" services should only implement <constant>console</constant>, <constant>journal</constant>,
802 and <constant>null</constant>. Anything else is only appropriate for low-level services that
803 are active in very early boot before proper logging is established.</para>
804
805 <para>The service must have the appropriate
806 <varname>BusName=<replaceable>destination</replaceable></varname> property and also implement the
807 generic
808 <citerefentry><refentrytitle>org.freedesktop.LogControl1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
809 interface. (<filename>systemctl</filename> will use the generic D-Bus protocol to access the
810 <interfacename>org.freedesktop.LogControl1.LogLevel</interfacename> interface for the D-Bus name
ec07c3c8
AK
811 <replaceable>destination</replaceable>.)</para>
812
813 <xi:include href="version-info.xml" xpointer="v247"/></listitem>
6824c132
ZJS
814 </varlistentry>
815
e1fac8a6
ZJS
816 <varlistentry>
817 <term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term>
599b6322 818
e1fac8a6
ZJS
819 <listitem>
820 <para>Reset the <literal>failed</literal> state of the specified units, or if no unit name is passed, reset
821 the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code,
822 terminating abnormally or timing out), it will automatically enter the <literal>failed</literal> state and
823 its exit code and status is recorded for introspection by the administrator until the service is
824 stopped/re-started or reset with this command.</para>
4a6022f0 825
e1fac8a6
ZJS
826 <para>In addition to resetting the <literal>failed</literal> state of a unit it also resets various other
827 per-unit properties: the start rate limit counter of all unit types is reset to zero, as is the restart
828 counter of service units. Thus, if a unit's start limit (as configured with
829 <varname>StartLimitIntervalSec=</varname>/<varname>StartLimitBurst=</varname>) is hit and the unit refuses
830 to be started again, use this command to make it startable again.</para>
831 </listitem>
832 </varlistentry>
c86a9508
LP
833
834 <varlistentry>
835 <term><command>whoami [<replaceable>PID</replaceable>…]</command></term>
836
837 <listitem><para>Returns the units the processes referenced by the given PIDs belong to (one per
838 line). If no PID is specified returns the unit the <command>systemctl</command> command is invoked
ec07c3c8
AK
839 in.</para>
840
841 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
c86a9508
LP
842 </varlistentry>
843
e1fac8a6
ZJS
844 </variablelist>
845 </refsect2>
4a6022f0 846
e1fac8a6
ZJS
847 <refsect2>
848 <title>Unit File Commands</title>
4a6022f0 849
e1fac8a6
ZJS
850 <variablelist>
851 <varlistentry>
852 <term><command>list-unit-files</command> <optional><replaceable>PATTERN…</replaceable></optional></term>
4a6022f0 853
e1fac8a6 854 <listitem>
7ea5e82f
LP
855 <para>List unit files installed on the system, in combination with their enablement state (as
856 reported by <command>is-enabled</command>). If one or more <replaceable>PATTERN</replaceable>s
857 are specified, only unit files whose name matches one of them are shown (patterns matching unit
858 file system paths are not supported).</para>
859
860 <para>Unlike <command>list-units</command> this command will list template units in addition to
861 explicitly instantiated units.</para>
ec07c3c8
AK
862
863 <xi:include href="version-info.xml" xpointer="v233"/>
e1fac8a6
ZJS
864 </listitem>
865 </varlistentry>
4a6022f0 866
e1fac8a6
ZJS
867 <varlistentry>
868 <term><command>enable <replaceable>UNIT</replaceable>…</command></term>
869 <term><command>enable <replaceable>PATH</replaceable>…</command></term>
4a6022f0 870
e1fac8a6
ZJS
871 <listitem>
872 <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the
bdac5608 873 [Install] sections of the indicated unit files. After the symlinks have been created,
e1fac8a6
ZJS
874 the system manager configuration is reloaded (in a way equivalent to <command>daemon-reload</command>), in
875 order to ensure the changes are taken into account immediately. Note that this does
876 <emphasis>not</emphasis> have the effect of also starting any of the units being enabled. If this is
877 desired, combine this command with the <option>--now</option> switch, or invoke <command>start</command>
878 with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of
879 the form <filename>foo@bar.service</filename>), symlinks named the same as instances are created in the
880 unit configuration directory, however they point to the single template unit file they are instantiated
881 from.</para>
4a6022f0 882
e1fac8a6
ZJS
883 <para>This command expects either valid unit names (in which case various unit file directories are
884 automatically searched for unit files with appropriate names), or absolute paths to unit files (in which
885 case these files are read directly). If a specified unit file is located outside of the usual unit file
886 directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring
887 it is found when requested by commands such as <command>start</command>. The file system where the linked
888 unit files are located must be accessible when systemd is started (e.g. anything underneath
3b121157 889 <filename>/home/</filename> or <filename>/var/</filename> is not allowed, unless those directories are
e1fac8a6 890 located on the root file system).</para>
4a6022f0 891
e1fac8a6
ZJS
892 <para>This command will print the file system operations executed. This output may be suppressed by passing
893 <option>--quiet</option>.
894 </para>
8c8208cb 895
bdac5608 896 <para>Note that this operation creates only the symlinks suggested in the [Install]
e1fac8a6
ZJS
897 section of the unit files. While this command is the recommended way to manipulate the unit configuration
898 directory, the administrator is free to make additional changes manually by placing or removing symlinks
899 below this directory. This is particularly useful to create configurations that deviate from the suggested
900 default installation. In this case, the administrator must make sure to invoke
901 <command>daemon-reload</command> manually as necessary, in order to ensure the changes are taken into
902 account.
903 </para>
8c8208cb 904
108d35ac
MY
905 <para>When using this operation on units without install information, a warning about it is shown.
906 <option>--no-warn</option> can be used to suppress the warning.</para>
907
e1fac8a6
ZJS
908 <para>Enabling units should not be confused with starting (activating) units, as done by the
909 <command>start</command> command. Enabling and starting units is orthogonal: units may be enabled without
910 being started and started without being enabled. Enabling simply hooks the unit into various suggested
911 places (for example, so that the unit is automatically started on boot or when a particular kind of
912 hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds
913 the socket (in case of socket units), and so on.</para>
4a6022f0 914
e1fac8a6
ZJS
915 <para>Depending on whether <option>--system</option>, <option>--user</option>, <option>--runtime</option>,
916 or <option>--global</option> is specified, this enables the unit for the system, for the calling user only,
917 for only this boot of the system, or for all future logins of all users. Note that in the last case, no
918 systemd daemon configuration is reloaded.</para>
4a6022f0 919
e1fac8a6
ZJS
920 <para>Using <command>enable</command> on masked units is not supported and results in an error.</para>
921 </listitem>
922 </varlistentry>
39c38ce1 923
e1fac8a6
ZJS
924 <varlistentry>
925 <term><command>disable <replaceable>UNIT</replaceable>…</command></term>
4a6022f0 926
e1fac8a6
ZJS
927 <listitem>
928 <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units
929 from the unit configuration directory, and hence undoes any changes made by <command>enable</command> or
930 <command>link</command>. Note that this removes <emphasis>all</emphasis> symlinks to matching unit files,
931 including manually created symlinks, and not just those actually created by <command>enable</command> or
932 <command>link</command>. Note that while <command>disable</command> undoes the effect of
933 <command>enable</command>, the two commands are otherwise not symmetric, as <command>disable</command> may
934 remove more symlinks than a prior <command>enable</command> invocation of the same unit created.</para>
9ef15026 935
e1fac8a6 936 <para>This command expects valid unit names only, it does not accept paths to unit files.</para>
9ef15026 937
e1fac8a6 938 <para>In addition to the units specified as arguments, all units are disabled that are listed in the
bdac5608 939 <varname>Also=</varname> setting contained in the [Install] section of any of the unit
e1fac8a6 940 files being operated on.</para>
57ab2eab 941
e1fac8a6
ZJS
942 <para>This command implicitly reloads the system manager configuration after completing the operation. Note
943 that this command does not implicitly stop the units that are being disabled. If this is desired, either
944 combine this command with the <option>--now</option> switch, or invoke the <command>stop</command> command
945 with appropriate arguments later.</para>
57ab2eab 946
e1fac8a6
ZJS
947 <para>This command will print information about the file system operations (symlink removals)
948 executed. This output may be suppressed by passing <option>--quiet</option>.
949 </para>
4a6022f0 950
d708bb7c
MY
951 <para>If a unit gets disabled but its triggering units are still active, a warning containing
952 the names of the triggering units is shown. <option>--no-warn</option> can be used to suppress
953 the warning.</para>
954
e774d3c9
MY
955 <para>When this command is used with <option>--user</option>, the units being operated on might
956 still be enabled in global scope, and thus get started automatically even after a successful
957 disablement in user scope. In this case, a warning about it is shown, which can be suppressed
958 using <option>--no-warn</option>.</para>
959
108d35ac
MY
960 <para>This command honors <option>--system</option>, <option>--user</option>, <option>--runtime</option>,
961 <option>--global</option> and <option>--no-warn</option> in a similar way as <command>enable</command>.</para>
ec07c3c8
AK
962
963 <xi:include href="version-info.xml" xpointer="v238"/>
e1fac8a6
ZJS
964 </listitem>
965 </varlistentry>
4a6022f0 966
e1fac8a6
ZJS
967 <varlistentry>
968 <term><command>reenable <replaceable>UNIT</replaceable>…</command></term>
4a6022f0 969
e1fac8a6
ZJS
970 <listitem>
971 <para>Reenable one or more units, as specified on the command line. This is a combination of
972 <command>disable</command> and <command>enable</command> and is useful to reset the symlinks a unit file is
bdac5608 973 enabled with to the defaults configured in its [Install] section. This command expects
e1fac8a6 974 a unit name only, it does not accept paths to unit files.</para>
ec07c3c8
AK
975
976 <xi:include href="version-info.xml" xpointer="v238"/>
e1fac8a6
ZJS
977 </listitem>
978 </varlistentry>
4a6022f0 979
e1fac8a6
ZJS
980 <varlistentry>
981 <term><command>preset <replaceable>UNIT</replaceable>…</command></term>
a330b376 982
e1fac8a6
ZJS
983 <listitem>
984 <para>Reset the enable/disable status one or more unit files, as specified on
985 the command line, to the defaults configured in the preset policy files. This
986 has the same effect as <command>disable</command> or
987 <command>enable</command>, depending how the unit is listed in the preset
988 files.</para>
4a6022f0 989
e1fac8a6
ZJS
990 <para>Use <option>--preset-mode=</option> to control whether units shall be
991 enabled and disabled, or only enabled, or only disabled.</para>
d309c1c3 992
e1fac8a6
ZJS
993 <para>If the unit carries no install information, it will be silently ignored
994 by this command. <replaceable>UNIT</replaceable> must be the real unit name,
995 any alias names are ignored silently.</para>
d309c1c3 996
e1fac8a6
ZJS
997 <para>For more information on the preset policy format, see
998 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
7e215af7 999 </para>
ec07c3c8
AK
1000
1001 <xi:include href="version-info.xml" xpointer="v238"/>
e1fac8a6
ZJS
1002 </listitem>
1003 </varlistentry>
4a6022f0 1004
e1fac8a6
ZJS
1005 <varlistentry>
1006 <term><command>preset-all</command></term>
4a6022f0 1007
e1fac8a6
ZJS
1008 <listitem>
1009 <para>Resets all installed unit files to the defaults
1010 configured in the preset policy file (see above).</para>
4a6022f0 1011
e1fac8a6
ZJS
1012 <para>Use <option>--preset-mode=</option> to control
1013 whether units shall be enabled and disabled, or only
1014 enabled, or only disabled.</para>
ec07c3c8
AK
1015
1016 <xi:include href="version-info.xml" xpointer="v215"/>
e1fac8a6
ZJS
1017 </listitem>
1018 </varlistentry>
4a6022f0 1019
27722f96 1020 <varlistentry>
e1fac8a6 1021 <term><command>is-enabled <replaceable>UNIT</replaceable>…</command></term>
4a6022f0 1022
27722f96 1023 <listitem>
e1fac8a6
ZJS
1024 <para>Checks whether any of the specified unit files are
1025 enabled (as with <command>enable</command>). Returns an
1026 exit code of 0 if at least one is enabled, non-zero
1027 otherwise. Prints the current enable status (see table).
1028 To suppress this output, use <option>--quiet</option>.
1029 To show installation targets, use <option>--full</option>.
1030 </para>
6fdbb3c8 1031
e1fac8a6
ZJS
1032 <table>
1033 <title>
1034 <command>is-enabled</command> output
1035 </title>
6fdbb3c8 1036
e1fac8a6
ZJS
1037 <tgroup cols='3'>
1038 <thead>
1039 <row>
1040 <entry>Name</entry>
1041 <entry>Description</entry>
1042 <entry>Exit Code</entry>
1043 </row>
1044 </thead>
1045 <tbody>
1046 <row>
1047 <entry><literal>enabled</literal></entry>
1048 <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>
1049 <entry morerows='1'>0</entry>
1050 </row>
1051 <row>
1052 <entry><literal>enabled-runtime</literal></entry>
1053 </row>
1054 <row>
1055 <entry><literal>linked</literal></entry>
1056 <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>
1057 <entry morerows='1'>&gt; 0</entry>
1058 </row>
1059 <row>
1060 <entry><literal>linked-runtime</literal></entry>
1061 </row>
15d7ab87
ZJS
1062 <row>
1063 <entry><literal>alias</literal></entry>
1064 <entry>The name is an alias (symlink to another unit file).</entry>
1065 <entry>0</entry>
1066 </row>
e1fac8a6
ZJS
1067 <row>
1068 <entry><literal>masked</literal></entry>
1069 <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>
1070 <entry morerows='1'>&gt; 0</entry>
1071 </row>
1072 <row>
1073 <entry><literal>masked-runtime</literal></entry>
1074 </row>
1075 <row>
1076 <entry><literal>static</literal></entry>
bdac5608 1077 <entry>The unit file is not enabled, and has no provisions for enabling in the [Install] unit file section.</entry>
e1fac8a6
ZJS
1078 <entry>0</entry>
1079 </row>
1080 <row>
1081 <entry><literal>indirect</literal></entry>
bdac5608 1082 <entry>The unit file itself is not enabled, but it has a non-empty <varname>Also=</varname> setting in the [Install] 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 <varname>Also=</varname>. For template unit files, an instance different than the one specified in <varname>DefaultInstance=</varname> is enabled.</entry>
e1fac8a6
ZJS
1083 <entry>0</entry>
1084 </row>
1085 <row>
1086 <entry><literal>disabled</literal></entry>
bdac5608 1087 <entry>The unit file is not enabled, but contains an [Install] section with installation instructions.</entry>
e1fac8a6
ZJS
1088 <entry>&gt; 0</entry>
1089 </row>
1090 <row>
1091 <entry><literal>generated</literal></entry>
1092 <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>
1093 <entry>0</entry>
1094 </row>
1095 <row>
1096 <entry><literal>transient</literal></entry>
1097 <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.</entry>
1098 <entry>0</entry>
1099 </row>
1100 <row>
1101 <entry><literal>bad</literal></entry>
1102 <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>
1103 <entry>&gt; 0</entry>
1104 </row>
8f23229c
MY
1105 <row>
1106 <entry><literal>not-found</literal></entry>
1107 <entry>The unit file doesn't exist.</entry>
1108 <entry>4</entry>
1109 </row>
e1fac8a6
ZJS
1110 </tbody>
1111 </tgroup>
1112 </table>
6fdbb3c8 1113
465a9d2a 1114 <xi:include href="version-info.xml" xpointer="v238"/>
27722f96
LN
1115 </listitem>
1116 </varlistentry>
991f2a39 1117
27722f96 1118 <varlistentry>
e1fac8a6 1119 <term><command>mask <replaceable>UNIT</replaceable>…</command></term>
27722f96
LN
1120
1121 <listitem>
3122f4d7
LP
1122 <para>Mask one or more units, as specified on the command line. This will link these unit files
1123 to <filename>/dev/null</filename>, making it impossible to start them. This is a stronger version
1124 of <command>disable</command>, since it prohibits all kinds of activation of the unit, including
1125 enablement and manual activation. Use this option with care. This honors the
1126 <option>--runtime</option> option to only mask temporarily until the next reboot of the
1127 system. The <option>--now</option> option may be used to ensure that the units are also
1128 stopped. This command expects valid unit names only, it does not accept unit file paths.</para>
1129
1130 <para>Note that this will create a symlink under the unit's name in
1131 <filename>/etc/systemd/system/</filename> (in case <option>--runtime</option> is not specified)
1132 or <filename>/run/systemd/system/</filename> (in case <option>--runtime</option> is
1133 specified). If a matching unit file already exists under these directories this operation will
1134 hence fail. This means that the operation is primarily useful to mask units shipped by the vendor
1135 (as those are shipped in <filename>/usr/lib/systemd/system/</filename> and not the aforementioned
1136 two directories), but typically doesn't work for units created locally (as those are typically
1137 placed precisely in the two aforementioned directories). Similar restrictions apply for
1138 <option>--user</option> mode, in which case the directories are below the user's home directory
1139 however.</para>
ec07c3c8 1140
d708bb7c
MY
1141 <para>If a unit gets masked but its triggering units are still active, a warning containing
1142 the names of the triggering units is shown. <option>--no-warn</option> can be used to suppress
1143 the warning.</para>
1144
ec07c3c8 1145 <xi:include href="version-info.xml" xpointer="v238"/>
27722f96
LN
1146 </listitem>
1147 </varlistentry>
1148
cbb76c29 1149 <varlistentry>
e1fac8a6 1150 <term><command>unmask <replaceable>UNIT</replaceable>…</command></term>
cbb76c29
LP
1151
1152 <listitem>
e1fac8a6
ZJS
1153 <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of
1154 <command>mask</command>. This command expects valid unit names only, it does not accept unit file
1155 paths.</para>
ec07c3c8
AK
1156
1157 <xi:include href="version-info.xml" xpointer="v238"/>
e1fac8a6
ZJS
1158 </listitem>
1159 </varlistentry>
cbb76c29 1160
e1fac8a6
ZJS
1161 <varlistentry>
1162 <term><command>link <replaceable>PATH</replaceable>…</command></term>
ccdda955 1163
e1fac8a6 1164 <listitem>
32d2e70a 1165 <para>Link a unit file that is not in the unit file search path into the unit file search path. This
e1fac8a6
ZJS
1166 command expects an absolute path to a unit file. The effect of this may be undone with
1167 <command>disable</command>. The effect of this command is that a unit file is made available for commands
1168 such as <command>start</command>, even though it is not installed directly in the unit search path. The
1169 file system where the linked unit files are located must be accessible when systemd is started
3b121157 1170 (e.g. anything underneath <filename>/home/</filename> or <filename>/var/</filename> is not allowed, unless
e1fac8a6 1171 those directories are located on the root file system).</para>
ec07c3c8
AK
1172
1173 <xi:include href="version-info.xml" xpointer="v233"/>
cbb76c29
LP
1174 </listitem>
1175 </varlistentry>
1176
27722f96 1177 <varlistentry>
e1fac8a6 1178 <term><command>revert <replaceable>UNIT</replaceable>…</command></term>
27722f96
LN
1179
1180 <listitem>
e1fac8a6
ZJS
1181 <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration
1182 files that modify the specified units, as well as any user-configured unit file that overrides a matching
1183 vendor supplied unit file. Specifically, for a unit <literal>foo.service</literal> the matching directories
1184 <literal>foo.service.d/</literal> with all their contained files are removed, both below the persistent and
1185 runtime configuration directories (i.e. below <filename>/etc/systemd/system</filename> and
1186 <filename>/run/systemd/system</filename>); if the unit file has a vendor-supplied version (i.e. a unit file
3b121157 1187 located below <filename>/usr/</filename>) any matching persistent or runtime unit file that overrides it is
e1fac8a6
ZJS
1188 removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below
1189 <filename>/etc/systemd/system</filename> or <filename>/run/systemd/system</filename>, but not in a unit
3b121157 1190 file stored below <filename>/usr/</filename>), then it is not removed. Also, if a unit is masked, it is
e1fac8a6
ZJS
1191 unmasked.</para>
1192
1193 <para>Effectively, this command may be used to undo all changes made with <command>systemctl
1194 edit</command>, <command>systemctl set-property</command> and <command>systemctl mask</command> and puts
1195 the original unit file with its settings back in effect.</para>
ec07c3c8 1196
aefdc112 1197 <xi:include href="version-info.xml" xpointer="v230"/>
27722f96
LN
1198 </listitem>
1199 </varlistentry>
e1fac8a6 1200
27722f96 1201 <varlistentry>
e1fac8a6
ZJS
1202 <term><command>add-wants <replaceable>TARGET</replaceable>
1203 <replaceable>UNIT</replaceable>…</command></term>
1204 <term><command>add-requires <replaceable>TARGET</replaceable>
1205 <replaceable>UNIT</replaceable>…</command></term>
27722f96
LN
1206
1207 <listitem>
e1fac8a6
ZJS
1208 <para>Adds <literal>Wants=</literal> or <literal>Requires=</literal>
1209 dependencies, respectively, to the specified
1210 <replaceable>TARGET</replaceable> for one or more units. </para>
1211
1212 <para>This command honors <option>--system</option>,
1213 <option>--user</option>, <option>--runtime</option> and
1214 <option>--global</option> in a way similar to
1215 <command>enable</command>.</para>
4f0acdb3 1216
aefdc112 1217 <xi:include href="version-info.xml" xpointer="v217"/>
27722f96
LN
1218 </listitem>
1219 </varlistentry>
e1fac8a6 1220
27722f96 1221 <varlistentry>
e1fac8a6 1222 <term><command>edit <replaceable>UNIT</replaceable>…</command></term>
27722f96
LN
1223
1224 <listitem>
329050c5
ZJS
1225 <para>Edit or replace a drop-in snippet or the main unit file, to extend or override the
1226 definition of the specified unit.</para>
1227
1228 <para>Depending on whether <option>--system</option> (the default), <option>--user</option>, or
1229 <option>--global</option> is specified, this command will operate on the system unit files, unit
1230 files for the calling user, or the unit files shared between all users.</para>
1231
1232 <para>The editor (see the "Environment" section below) is invoked on temporary files which will
1233 be written to the real location if the editor exits successfully. After the editing is finished,
1234 configuration is reloaded, equivalent to <command>systemctl daemon-reload --system</command> or
1235 <command>systemctl daemon-reload --user</command>. For <command>edit --global</command>, the
1236 reload is not performed and the edits will take effect only for subsequent logins (or after a
1237 reload is requested in a different way).</para>
27722f96 1238
329050c5
ZJS
1239 <para>If <option>--full</option> is specified, a replacement for the main unit file will be
1240 created or edited. Otherwise, a drop-in file will be created or edited.</para>
27722f96 1241
f206809b
MY
1242 <para>If <option>--drop-in=</option> is specified, the given drop-in file name
1243 will be used instead of the default <filename>override.conf</filename>.</para>
1244
329050c5
ZJS
1245 <para>The unit must exist, i.e. its main unit file must be present. If <option>--force</option>
1246 is specified, this requirement is ignored and a new unit may be created (with
a753d303 1247 <option>--full</option>), or a drop-in for a nonexistent unit may be created.</para>
c4f2aaa4 1248
e1fac8a6 1249 <para>If <option>--runtime</option> is specified, the changes will
3b121157 1250 be made temporarily in <filename>/run/</filename> and they will be
e1fac8a6
ZJS
1251 lost on the next reboot.</para>
1252
329050c5
ZJS
1253 <para>If <option>--stdin</option> is specified, the new contents will be read from standard
1254 input. In this mode, the old contents of the file are discarded.</para>
1255
e1fac8a6
ZJS
1256 <para>If the temporary file is empty upon exit, the modification of
1257 the related unit is canceled.</para>
1258
e1fac8a6
ZJS
1259 <para>Note that this command cannot be used to remotely edit units
1260 and that you cannot temporarily edit units which are in
3b121157
ZJS
1261 <filename>/etc/</filename>, since they take precedence over
1262 <filename>/run/</filename>.</para>
ec07c3c8 1263
aefdc112 1264 <xi:include href="version-info.xml" xpointer="v218"/>
27722f96
LN
1265 </listitem>
1266 </varlistentry>
e1fac8a6 1267
27722f96 1268 <varlistentry>
e1fac8a6 1269 <term><command>get-default</command></term>
27722f96
LN
1270
1271 <listitem>
e1fac8a6
ZJS
1272 <para>Return the default target to boot into. This returns
1273 the target unit name <filename>default.target</filename>
1274 is aliased (symlinked) to.</para>
aefdc112
AK
1275
1276 <xi:include href="version-info.xml" xpointer="v205"/>
27722f96
LN
1277 </listitem>
1278 </varlistentry>
e1fac8a6 1279
27722f96 1280 <varlistentry>
e1fac8a6 1281 <term><command>set-default <replaceable>TARGET</replaceable></command></term>
27722f96
LN
1282
1283 <listitem>
e1fac8a6
ZJS
1284 <para>Set the default target to boot into. This sets
1285 (symlinks) the <filename>default.target</filename> alias
1286 to the given target unit.</para>
ec07c3c8 1287
aefdc112 1288 <xi:include href="version-info.xml" xpointer="v205"/>
27722f96
LN
1289 </listitem>
1290 </varlistentry>
e1fac8a6
ZJS
1291
1292 </variablelist>
1293 </refsect2>
1294
1295 <refsect2>
1296 <title>Machine Commands</title>
1297
1298 <variablelist>
27722f96 1299 <varlistentry>
e1fac8a6 1300 <term><command>list-machines</command> <optional><replaceable>PATTERN</replaceable>…</optional></term>
27722f96
LN
1301
1302 <listitem>
e1fac8a6
ZJS
1303 <para>List the host and all running local containers with
1304 their state. If one or more
1305 <replaceable>PATTERN</replaceable>s are specified, only
1306 containers matching one of them are shown.
1307 </para>
ec07c3c8 1308
aefdc112 1309 <xi:include href="version-info.xml" xpointer="v212"/>
27722f96
LN
1310 </listitem>
1311 </varlistentry>
e1fac8a6
ZJS
1312 </variablelist>
1313 </refsect2>
1314
1315 <refsect2>
1316 <title>Job Commands</title>
1317
1318 <variablelist>
27722f96 1319 <varlistentry>
e1fac8a6 1320 <term><command>list-jobs <optional><replaceable>PATTERN…</replaceable></optional></command></term>
27722f96
LN
1321
1322 <listitem>
e1fac8a6
ZJS
1323 <para>List jobs that are in progress. If one or more
1324 <replaceable>PATTERN</replaceable>s are specified, only
1325 jobs for units matching one of them are shown.</para>
27722f96 1326
e1fac8a6
ZJS
1327 <para>When combined with <option>--after</option> or <option>--before</option> the list is augmented with
1328 information on which other job each job is waiting for, and which other jobs are waiting for it, see
1329 above.</para>
ec07c3c8
AK
1330
1331 <xi:include href="version-info.xml" xpointer="v233"/>
27722f96
LN
1332 </listitem>
1333 </varlistentry>
1334 <varlistentry>
7e0aaeb2 1335 <term><command>cancel <optional><replaceable>JOB</replaceable>…</optional></command></term>
27722f96
LN
1336
1337 <listitem>
e1fac8a6
ZJS
1338 <para>Cancel one or more jobs specified on the command line
1339 by their numeric job IDs. If no job ID is specified, cancel
1340 all pending jobs.</para>
ec07c3c8
AK
1341
1342 <xi:include href="version-info.xml" xpointer="v233"/>
27722f96
LN
1343 </listitem>
1344 </varlistentry>
e1fac8a6
ZJS
1345 </variablelist>
1346 </refsect2>
1347
1348 <refsect2>
1349 <title>Environment Commands</title>
1350
0dc9fd56
ZJS
1351 <para><command>systemd</command> supports an environment block that is passed to processes the manager
1352 spawns. The names of the variables can contain ASCII letters, digits, and the underscore
1353 character. Variable names cannot be empty or start with a digit. In variable values, most characters
30927a24
ZJS
1354 are allowed, but the whole sequence must be valid UTF-8. (Note that control characters like newline
1355 (<constant>NL</constant>), tab (<constant>TAB</constant>), or the escape character
1356 (<constant>ESC</constant>), <emphasis>are</emphasis> valid ASCII and thus valid UTF-8). The total
1357 length of the environment block is limited to <constant>_SC_ARG_MAX</constant> value defined by
0dc9fd56
ZJS
1358 <citerefentry project='man-pages'><refentrytitle>sysconf</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
1359 </para>
1360
e1fac8a6 1361 <variablelist>
8c8208cb 1362 <varlistentry>
e1fac8a6 1363 <term><command>show-environment</command></term>
8c8208cb
LP
1364
1365 <listitem>
c104d7a7
LP
1366 <para>Dump the systemd manager environment block. This is the environment block that is passed to
1367 all processes the manager spawns. The environment block will be dumped in straightforward form
1368 suitable for sourcing into most shells. If no special characters or whitespace is present in the
1369 variable values, no escaping is performed, and the assignments have the form
1370 <literal>VARIABLE=value</literal>. If whitespace or characters which have special meaning to the
1371 shell are present, dollar-single-quote escaping is used, and assignments have the form
1372 <literal>VARIABLE=$'value'</literal>. This syntax is known to be supported by <citerefentry
1373 project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1374 <citerefentry
1375 project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1376 <citerefentry
1377 project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, and
1378 <citerefentry
1379 project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
1380 <citerefentry
1381 project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, but
1382 not <citerefentry
1383 project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry> or
1384 <citerefentry
1385 project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
e1fac8a6 1386 </para>
c104d7a7
LP
1387
1388 <para>Note that this shows the <emphasis>effective</emphasis> block, i.e. the combination of
1389 environment variables configured via configuration files, environment generators and via IPC
1390 (i.e. via the <command>set-environment</command> described below). At the moment a unit process
1391 is forked off this combined environment block will be further combined with per-unit environment
1392 variables, which are not visible in this command.</para>
8c8208cb
LP
1393 </listitem>
1394 </varlistentry>
27722f96 1395 <varlistentry>
e1fac8a6 1396 <term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term>
27722f96
LN
1397
1398 <listitem>
c104d7a7 1399 <para>Set one or more service manager environment variables, as specified on the command
0dc9fd56
ZJS
1400 line. This command will fail if variable names and values do not conform to the rules listed
1401 above.</para>
ec07c3c8 1402
c104d7a7
LP
1403 <para>Note that this operates on an environment block separate from the environment block
1404 configured from service manager configuration and environment generators. Whenever a process is
1405 invoked the two blocks are combined (also incorporating any per-service environment variables),
1406 and passed to it. The <command>show-environment</command> verb will show the combination of the
1407 blocks, see above.</para>
1408
ec07c3c8 1409 <xi:include href="version-info.xml" xpointer="v233"/>
27722f96
LN
1410 </listitem>
1411 </varlistentry>
1412 <varlistentry>
e1fac8a6 1413 <term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term>
27722f96
LN
1414
1415 <listitem>
c104d7a7
LP
1416 <para>Unset one or more systemd manager environment variables. If only a variable name is
1417 specified, it will be removed regardless of its value. If a variable and a value are specified,
1418 the variable is only removed if it has the specified value.</para>
1419
1420 <para>Note that this operates on an environment block separate from the environment block
1421 configured from service manager configuration and environment generators. Whenever a process is
1422 invoked the two blocks are combined (also incorporating any per-service environment variables),
1423 and passed to it. The <command>show-environment</command> verb will show the combination of the
1424 blocks, see above. Note that this means this command cannot be used to unset environment
1425 variables defined in the service manager configuration files or via generators.</para>
ec07c3c8
AK
1426
1427 <xi:include href="version-info.xml" xpointer="v233"/>
27722f96
LN
1428 </listitem>
1429 </varlistentry>
1430 <varlistentry>
e1fac8a6
ZJS
1431 <term>
1432 <command>import-environment</command>
32854f70 1433 <replaceable>VARIABLE…</replaceable>
e1fac8a6 1434 </term>
27722f96
LN
1435
1436 <listitem>
0dc9fd56 1437 <para>Import all, one or more environment variables set on the client into the systemd manager
82651d5b
ZJS
1438 environment block. If a list of environment variable names is passed, client-side values are then
1439 imported into the manager's environment block. If any names are not valid environment variable
1440 names or have invalid values according to the rules described above, an error is raised. If no
1441 arguments are passed, the entire environment block inherited by the <command>systemctl</command>
1442 process is imported. In this mode, any inherited invalid environment variables are quietly
1443 ignored.</para>
32854f70
ZJS
1444
1445 <para>Importing of the full inherited environment block (calling this command without any
1446 arguments) is deprecated. A shell will set dozens of variables which only make sense locally and
1447 are only meant for processes which are descendants of the shell. Such variables in the global
1448 environment block are confusing to other processes.</para>
ec07c3c8 1449
aefdc112 1450 <xi:include href="version-info.xml" xpointer="v209"/>
27722f96
LN
1451 </listitem>
1452 </varlistentry>
e1fac8a6
ZJS
1453 </variablelist>
1454 </refsect2>
1455
1456 <refsect2>
38fcb7f7 1457 <title>Manager State Commands</title>
e1fac8a6
ZJS
1458
1459 <variablelist>
27722f96 1460 <varlistentry>
e1fac8a6 1461 <term><command>daemon-reload</command></term>
27722f96
LN
1462
1463 <listitem>
e1fac8a6
ZJS
1464 <para>Reload the systemd manager configuration. This will
1465 rerun all generators (see
1466 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>),
1467 reload all unit files, and recreate the entire dependency
1468 tree. While the daemon is being reloaded, all sockets
1469 systemd listens on behalf of user configuration will stay
1470 accessible.</para>
33d2308c 1471
e1fac8a6
ZJS
1472 <para>This command should not be confused with the
1473 <command>reload</command> command.</para>
27722f96
LN
1474 </listitem>
1475 </varlistentry>
38fcb7f7 1476
e93c33d4 1477 <varlistentry>
e1fac8a6 1478 <term><command>daemon-reexec</command></term>
27722f96 1479
e93c33d4 1480 <listitem>
e1fac8a6
ZJS
1481 <para>Reexecute the systemd manager. This will serialize the
1482 manager state, reexecute the process and deserialize the
1483 state again. This command is of little use except for
1484 debugging and package upgrades. Sometimes, it might be
1485 helpful as a heavy-weight <command>daemon-reload</command>.
1486 While the daemon is being reexecuted, all sockets systemd listening
1487 on behalf of user configuration will stay accessible.
1488 </para>
e93c33d4
SL
1489 </listitem>
1490 </varlistentry>
38fcb7f7 1491
df957849 1492 <varlistentry id='log-level'>
38fcb7f7
ZJS
1493 <term><command>log-level</command> [<replaceable>LEVEL</replaceable>]</term>
1494
1495 <listitem><para>If no argument is given, print the current log level of the manager. If an
1496 optional argument <replaceable>LEVEL</replaceable> is provided, then the command changes the
1497 current log level of the manager to <replaceable>LEVEL</replaceable> (accepts the same values as
1498 <option>--log-level=</option> described in
1499 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).
ec07c3c8
AK
1500 </para>
1501
1502 <xi:include href="version-info.xml" xpointer="v244"/></listitem>
38fcb7f7
ZJS
1503 </varlistentry>
1504
1505 <varlistentry>
1506 <term><command>log-target</command> [<replaceable>TARGET</replaceable>]</term>
1507
1508 <listitem><para>If no argument is given, print the current log target of the manager. If an
1509 optional argument <replaceable>TARGET</replaceable> is provided, then the command changes the
1510 current log target of the manager to <replaceable>TARGET</replaceable> (accepts the same values as
1511 <option>--log-target=</option>, described in
1512 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>).
ec07c3c8
AK
1513 </para>
1514
1515 <xi:include href="version-info.xml" xpointer="v244"/></listitem>
38fcb7f7 1516 </varlistentry>
6ab86319
ZJS
1517
1518 <varlistentry>
1519 <term><command>service-watchdogs</command> [yes|no]</term>
1520
1521 <listitem><para>If no argument is given, print the current state of service runtime watchdogs of
1522 the manager. If an optional boolean argument is provided, then globally enables or disables the
1523 service runtime watchdogs (<option>WatchdogSec=</option>) and emergency actions (e.g.
1524 <option>OnFailure=</option> or <option>StartLimitAction=</option>); see
1525 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
ec07c3c8
AK
1526 The hardware watchdog is not affected by this setting.</para>
1527
1528 <xi:include href="version-info.xml" xpointer="v244"/></listitem>
6ab86319 1529 </varlistentry>
e1fac8a6
ZJS
1530 </variablelist>
1531 </refsect2>
27722f96 1532
e1fac8a6
ZJS
1533 <refsect2>
1534 <title>System Commands</title>
e9fd88f2 1535
e1fac8a6
ZJS
1536 <variablelist>
1537 <varlistentry>
1538 <term><command>is-system-running</command></term>
5b792edb 1539
e1fac8a6
ZJS
1540 <listitem>
1541 <para>Checks whether the system is operational. This
1542 returns success (exit code 0) when the system is fully up
1543 and running, specifically not in startup, shutdown or
1544 maintenance mode, and with no failed services. Failure is
1545 returned otherwise (exit code non-zero). In addition, the
1546 current state is printed in a short string to standard
1547 output, see the table below. Use <option>--quiet</option> to
1548 suppress this output.</para>
5b792edb 1549
e1fac8a6
ZJS
1550 <para>Use <option>--wait</option> to wait until the boot
1551 process is completed before printing the current state and
1552 returning the appropriate error status. If <option>--wait</option>
1553 is in use, states <varname>initializing</varname> or
1554 <varname>starting</varname> will not be reported, instead
1555 the command will block until a later state (such as
1556 <varname>running</varname> or <varname>degraded</varname>)
1557 is reached.</para>
5b792edb 1558
e1fac8a6
ZJS
1559 <table>
1560 <title><command>is-system-running</command> output</title>
1561 <tgroup cols='3'>
1562 <colspec colname='name'/>
1563 <colspec colname='description'/>
1564 <colspec colname='exit-code'/>
1565 <thead>
1566 <row>
1567 <entry>Name</entry>
1568 <entry>Description</entry>
1569 <entry>Exit Code</entry>
1570 </row>
1571 </thead>
1572 <tbody>
1573 <row>
1574 <entry><varname>initializing</varname></entry>
1575 <entry><para>Early bootup, before
1576 <filename>basic.target</filename> is reached
1577 or the <varname>maintenance</varname> state entered.
1578 </para></entry>
1579 <entry>&gt; 0</entry>
1580 </row>
1581 <row>
1582 <entry><varname>starting</varname></entry>
1583 <entry><para>Late bootup, before the job queue
1584 becomes idle for the first time, or one of the
1585 rescue targets are reached.</para></entry>
1586 <entry>&gt; 0</entry>
1587 </row>
1588 <row>
1589 <entry><varname>running</varname></entry>
1590 <entry><para>The system is fully
1591 operational.</para></entry>
1592 <entry>0</entry>
1593 </row>
1594 <row>
1595 <entry><varname>degraded</varname></entry>
1596 <entry><para>The system is operational but one or more
1597 units failed.</para></entry>
1598 <entry>&gt; 0</entry>
1599 </row>
1600 <row>
1601 <entry><varname>maintenance</varname></entry>
1602 <entry><para>The rescue or emergency target is
1603 active.</para></entry>
1604 <entry>&gt; 0</entry>
1605 </row>
1606 <row>
1607 <entry><varname>stopping</varname></entry>
1608 <entry><para>The manager is shutting
1609 down.</para></entry>
1610 <entry>&gt; 0</entry>
1611 </row>
1612 <row>
1613 <entry><varname>offline</varname></entry>
1614 <entry><para>The manager is not
1615 running. Specifically, this is the operational
1616 state if an incompatible program is running as
1617 system manager (PID 1).</para></entry>
1618 <entry>&gt; 0</entry>
1619 </row>
1620 <row>
1621 <entry><varname>unknown</varname></entry>
1622 <entry><para>The operational state could not be
1623 determined, due to lack of resources or another
1624 error cause.</para></entry>
1625 <entry>&gt; 0</entry>
1626 </row>
1627 </tbody>
1628 </tgroup>
1629 </table>
ec07c3c8 1630
465a9d2a 1631 <xi:include href="version-info.xml" xpointer="v215"/>
27722f96
LN
1632 </listitem>
1633 </varlistentry>
1634
1635 <varlistentry>
e1fac8a6 1636 <term><command>default</command></term>
27722f96
LN
1637
1638 <listitem>
e1fac8a6
ZJS
1639 <para>Enter default mode. This is equivalent to <command>systemctl isolate default.target</command>. This
1640 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
27722f96
LN
1641 </listitem>
1642 </varlistentry>
1643
1644 <varlistentry>
e1fac8a6 1645 <term><command>rescue</command></term>
27722f96
LN
1646
1647 <listitem>
e1fac8a6
ZJS
1648 <para>Enter rescue mode. This is equivalent to <command>systemctl isolate rescue.target</command>. This
1649 operation is blocking by default, use <option>--no-block</option> to request asynchronous behavior.</para>
27722f96
LN
1650 </listitem>
1651 </varlistentry>
27722f96 1652 <varlistentry>
e1fac8a6 1653 <term><command>emergency</command></term>
27722f96
LN
1654
1655 <listitem>
e1fac8a6
ZJS
1656 <para>Enter emergency mode. This is equivalent to <command>systemctl isolate
1657 emergency.target</command>. This operation is blocking by default, use <option>--no-block</option> to
1658 request asynchronous behavior.</para>
27722f96
LN
1659 </listitem>
1660 </varlistentry>
27722f96 1661 <varlistentry>
e1fac8a6 1662 <term><command>halt</command></term>
27722f96
LN
1663
1664 <listitem>
e1fac8a6
ZJS
1665 <para>Shut down and halt the system. This is mostly equivalent to <command>systemctl start halt.target
1666 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all users. This command is
1667 asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note
1668 that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered
1669 on. Use <command>systemctl poweroff</command> for powering off the system (see below).</para>
1670
1671 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1672 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1673 system halt. If <option>--force</option> is specified twice, the operation is immediately executed without
1674 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1675 <option>--force</option> is specified twice the halt operation is executed by <command>systemctl</command>
1676 itself, and the system manager is not contacted. This means the command should succeed even when the system
1677 manager has crashed.</para>
1433e1f9
MY
1678
1679 <para>If combined with <option>--when=</option>, shutdown will be scheduled after the given timestamp.
1680 And <option>--when=cancel</option> will cancel the shutdown.</para>
27722f96
LN
1681 </listitem>
1682 </varlistentry>
27722f96 1683 <varlistentry>
e1fac8a6 1684 <term><command>poweroff</command></term>
27722f96
LN
1685
1686 <listitem>
e1fac8a6
ZJS
1687 <para>Shut down and power-off the system. This is mostly equivalent to <command>systemctl start
1688 poweroff.target --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all
1689 users. This command is asynchronous; it will return after the power-off operation is enqueued, without
1690 waiting for it to complete.</para>
27722f96 1691
1433e1f9
MY
1692 <para>This command honors <option>--force</option> and <option>--when=</option> in a similar way
1693 as <command>halt</command>.</para>
e1fac8a6
ZJS
1694 </listitem>
1695 </varlistentry>
1696 <varlistentry>
dae710be 1697 <term><command>reboot</command></term>
27722f96 1698
e1fac8a6 1699 <listitem>
76c068b7
ZJS
1700 <para>Shut down and reboot the system.</para>
1701
1702 <para>This command mostly equivalent to <command>systemctl start reboot.target
1703 --job-mode=replace-irreversibly --no-block</command>, but also prints a wall message to all
1704 users. This command is asynchronous; it will return after the reboot operation is enqueued,
1705 without waiting for it to complete.</para>
3990961d 1706
dae710be 1707 <para>If the switch <option>--reboot-argument=</option> is given, it will be passed as the optional
e1fac8a6 1708 argument to the <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
dae710be 1709 system call.</para>
76c068b7
ZJS
1710
1711 <para>Options <option>--boot-loader-entry=</option>, <option>--boot-loader-menu=</option>, and
1712 <option>--firmware-setup</option> can be used to select what to do <emphasis>after</emphasis> the
1713 reboot. See the descriptions of those options for details.</para>
1433e1f9
MY
1714
1715 <para>This command honors <option>--force</option> and <option>--when=</option> in a similar way
1716 as <command>halt</command>.</para>
ec07c3c8 1717
665a3d6d
LB
1718 <para>If a new kernel has been loaded via <command>kexec --load</command>, a
1719 <command>kexec</command> will be performed instead of a reboot, unless
1720 <literal>SYSTEMCTL_SKIP_AUTO_KEXEC=1</literal> has been set. If a new root file system has
5d4072d0 1721 been set up on <literal>/run/nextroot/</literal>, a <command>soft-reboot</command> will be
665a3d6d
LB
1722 performed instead of a reboot, unless <literal>SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT=1</literal> has
1723 been set.</para>
1724
ec07c3c8 1725 <xi:include href="version-info.xml" xpointer="v246"/>
27722f96
LN
1726 </listitem>
1727 </varlistentry>
1728
1729 <varlistentry>
e1fac8a6 1730 <term><command>kexec</command></term>
27722f96
LN
1731
1732 <listitem>
fb12f140
ZJS
1733 <para>Shut down and reboot the system via <command>kexec</command>. This command will load a
1734 kexec kernel if one wasn't loaded yet or fail. A kernel may be loaded earlier by a separate step,
7c52d523 1735 this is particularly useful if a custom initrd or additional kernel command line options are
fb12f140
ZJS
1736 desired. The <option>--force</option> can be used to continue without a kexec kernel, i.e. to
1737 perform a normal reboot. The final reboot step is equivalent to
1738 <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block</command>.
1739 </para>
3990961d 1740
fb12f140
ZJS
1741 <para>To load a kernel, an enumeration is performed following the
1742 <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader Specification</ulink>,
1743 and the default boot entry is loaded. For this step to succeed, the system must be using UEFI
1744 and the boot loader entries must be configured appropriately. <command>bootctl list</command>
1745 may be used to list boot entries, see
1746 <citerefentry><refentrytitle>bootctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1747 </para>
1748
1749 <para>This command is asynchronous; it will return after the reboot operation is enqueued,
1750 without waiting for it to complete.</para>
1751
1752 <para>This command honors <option>--force</option> and <option>--when=</option> similarly
1753 to <command>halt</command>.</para>
665a3d6d
LB
1754
1755 <para>If a new kernel has been loaded via <command>kexec --load</command>, a
1756 <command>kexec</command> will be performed when <command>reboot</command> is invoked, unless
1757 <literal>SYSTEMCTL_SKIP_AUTO_KEXEC=1</literal> has been set.</para>
e1fac8a6
ZJS
1758 </listitem>
1759 </varlistentry>
3990961d 1760
4de66581
LP
1761 <varlistentry>
1762 <term><command>soft-reboot</command></term>
1763
1764 <listitem>
1765 <para>Shut down and reboot userspace. This is equivalent to <command>systemctl start
1766 soft-reboot.target --job-mode=replace-irreversibly --no-block</command>. This command is
1767 asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1768 complete.</para>
1769
1770 <para>This command honors <option>--force</option> and <option>--when=</option> in a similar way
1771 as <command>halt</command>.</para>
1772
1773 <para>This operation only reboots userspace, leaving the kernel running. See
1774 <citerefentry><refentrytitle>systemd-soft-reboot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1775 for details.</para>
ec07c3c8 1776
5d4072d0 1777 <para>If a new root file system has been set up on <literal>/run/nextroot/</literal>, a
665a3d6d
LB
1778 <command>soft-reboot</command> will be performed when <command>reboot</command> is invoked,
1779 unless <literal>SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT=1</literal> has been set.</para>
1780
ec07c3c8 1781 <xi:include href="version-info.xml" xpointer="v254"/>
4de66581
LP
1782 </listitem>
1783 </varlistentry>
1784
e1fac8a6
ZJS
1785 <varlistentry>
1786 <term><command>exit</command> <optional><replaceable>EXIT_CODE</replaceable></optional></term>
3990961d 1787
e1fac8a6
ZJS
1788 <listitem>
1789 <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in
1790 conjunction with the <option>--user</option> option) or in containers and is equivalent to
1791 <command>poweroff</command> otherwise. This command is asynchronous; it will return after the exit
1792 operation is enqueued, without waiting for it to complete.</para>
27722f96 1793
e1fac8a6
ZJS
1794 <para>The service manager will exit with the specified exit code, if
1795 <replaceable>EXIT_CODE</replaceable> is passed.</para>
ec07c3c8
AK
1796
1797 <xi:include href="version-info.xml" xpointer="v227"/>
27722f96
LN
1798 </listitem>
1799 </varlistentry>
1800
b619ec8f 1801 <varlistentry>
5ae89ef3 1802 <term><command>switch-root</command> <optional><replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></optional></term>
b619ec8f
LP
1803
1804 <listitem>
b66a6e1a
ZJS
1805 <para>Switches to a different root directory and executes a new system manager process below it.
1806 This is intended for use in the initrd, and will transition from the initrd's system manager
5ae89ef3
LP
1807 process (a.k.a. "init" process, PID 1) to the main system manager process which is loaded from
1808 the actual host root files system. This call takes two arguments: the directory that is to become
1809 the new root directory, and the path to the new system manager binary below it to execute as PID
1810 1. If both are omitted or the former is an empty string it defaults to
1811 <filename>/sysroot/</filename>. If the latter is omitted or is an empty string, a systemd binary
1812 will automatically be searched for and used as service manager. If the system manager path is
1813 omitted, equal to the empty string or identical to the path to the systemd binary, the state of
1814 the initrd's system manager process is passed to the main system manager, which allows later
1815 introspection of the state of the services involved in the initrd boot phase.</para>
ec07c3c8
AK
1816
1817 <xi:include href="version-info.xml" xpointer="v209"/>
b619ec8f
LP
1818 </listitem>
1819 </varlistentry>
1820
5b356289
MY
1821 <varlistentry>
1822 <term><command>sleep</command></term>
1823
1824 <listitem>
1825 <para>Put the system to sleep, through <command>suspend</command>, <command>hibernate</command>,
1826 <command>hybrid-sleep</command>, or <command>suspend-then-hibernate</command>. The sleep operation
1827 to use is automatically selected by <citerefentry>
1828 <refentrytitle>systemd-logind.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
1829 By default, <command>suspend-then-hibernate</command> is used, and falls back to <command>suspend</command>
1830 and then <command>hibernate</command> if not supported. Refer to <varname>SleepOperation=</varname>
1831 setting in <citerefentry><refentrytitle>logind.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1832 for more details. This command is asynchronous, and will return after the sleep operation is
1833 successfully enqueued. It will not wait for the sleep/resume cycle to complete.</para>
1834
1835 <xi:include href="version-info.xml" xpointer="v256"/>
1836 </listitem>
1837 </varlistentry>
1838
b619ec8f 1839 <varlistentry>
e1fac8a6 1840 <term><command>suspend</command></term>
b619ec8f
LP
1841
1842 <listitem>
e1fac8a6
ZJS
1843 <para>Suspend the system. This will trigger activation of the special target unit
1844 <filename>suspend.target</filename>. This command is asynchronous, and will return after the suspend
1845 operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.</para>
1846 </listitem>
1847 </varlistentry>
39207373 1848
e1fac8a6
ZJS
1849 <varlistentry>
1850 <term><command>hibernate</command></term>
b619ec8f 1851
e1fac8a6
ZJS
1852 <listitem>
1853 <para>Hibernate the system. This will trigger activation of the special target unit
1854 <filename>hibernate.target</filename>. This command is asynchronous, and will return after the hibernation
1855 operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.</para>
b619ec8f
LP
1856 </listitem>
1857 </varlistentry>
1858
1859 <varlistentry>
e1fac8a6 1860 <term><command>hybrid-sleep</command></term>
b619ec8f
LP
1861
1862 <listitem>
e1fac8a6
ZJS
1863 <para>Hibernate and suspend the system. This will trigger activation of the special target unit
1864 <filename>hybrid-sleep.target</filename>. This command is asynchronous, and will return after the hybrid
1865 sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.</para>
aefdc112
AK
1866
1867 <xi:include href="version-info.xml" xpointer="v196"/>
b619ec8f
LP
1868 </listitem>
1869 </varlistentry>
1870
27722f96 1871 <varlistentry>
e1fac8a6 1872 <term><command>suspend-then-hibernate</command></term>
27722f96
LN
1873
1874 <listitem>
e1fac8a6
ZJS
1875 <para>Suspend the system and hibernate it after the delay specified in <filename>systemd-sleep.conf</filename>.
1876 This will trigger activation of the special target unit <filename>suspend-then-hibernate.target</filename>.
1877 This command is asynchronous, and will return after the hybrid sleep operation is successfully enqueued.
1878 It will not wait for the sleep/wake-up or hibernate/thaw cycle to complete.</para>
ec07c3c8
AK
1879
1880 <xi:include href="version-info.xml" xpointer="v240"/>
e1fac8a6
ZJS
1881 </listitem>
1882 </varlistentry>
1883 </variablelist>
1884 </refsect2>
171754aa 1885
e1fac8a6
ZJS
1886 <refsect2>
1887 <title>Parameter Syntax</title>
171754aa 1888
e1fac8a6
ZJS
1889 <para>Unit commands listed above take either a single unit name (designated as <replaceable>UNIT</replaceable>),
1890 or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the
1891 unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"),
1892 systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in
1893 case of commands which operate only on specific unit types. For example,
1894 <programlisting># systemctl start sshd</programlisting> and
1895 <programlisting># systemctl start sshd.service</programlisting>
1896 are equivalent, as are
1897 <programlisting># systemctl isolate default</programlisting>
1898 and
1899 <programlisting># systemctl isolate default.target</programlisting>
1900 Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
1901 paths to mount unit names.
1902 <programlisting># systemctl status /dev/sda
1903# systemctl status /home</programlisting>
1904 are equivalent to:
1905 <programlisting># systemctl status dev-sda.device
1906# systemctl status home.mount</programlisting>
1907 In the second case, shell-style globs will be matched against the primary names of all units currently in memory;
1908 literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
1909 names always refer to exactly one unit, but globs may match zero units and this is not considered an
1910 error.</para>
171754aa 1911
e1fac8a6
ZJS
1912 <para>Glob patterns use
1913 <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1914 so normal shell-style globbing rules are used, and
1915 <literal>*</literal>, <literal>?</literal>,
1916 <literal>[]</literal> may be used. See
1917 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1918 for more details. The patterns are matched against the primary names of
1919 units currently in memory, and patterns which do not match anything
1920 are silently skipped. For example:
31dcc1b4 1921 <programlisting># systemctl stop "sshd@*.service"</programlisting>
e1fac8a6
ZJS
1922 will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
1923 in memory are not considered for glob expansion.
1924 </para>
27722f96 1925
e1fac8a6
ZJS
1926 <para>For unit file commands, the specified <replaceable>UNIT</replaceable> should be the name of the unit file
1927 (possibly abbreviated, see above), or the absolute path to the unit file:
1928 <programlisting># systemctl enable foo.service</programlisting>
1929 or
1930 <programlisting># systemctl link /path/to/foo.service</programlisting>
1931 </para>
1932 </refsect2>
27722f96 1933
e1fac8a6 1934 </refsect1>
27722f96 1935
e1fac8a6
ZJS
1936 <refsect1>
1937 <title>Options</title>
27722f96 1938
e1fac8a6 1939 <para>The following options are understood:</para>
27722f96 1940
e1fac8a6
ZJS
1941 <variablelist>
1942 <varlistentry>
1943 <term><option>-t</option></term>
1944 <term><option>--type=</option></term>
27722f96 1945
e1fac8a6 1946 <listitem>
a6e33464
ZJS
1947 <para>The argument is a comma-separated list of unit types such as <option>service</option> and
1948 <option>socket</option>. When units are listed with <command>list-units</command>,
37299769
MY
1949 <command>list-dependencies</command>, <command>show</command>, or <command>status</command>,
1950 only units of the specified types will be shown. By default, units of all types are shown.</para>
344ca755 1951
a6e33464
ZJS
1952 <para>As a special case, if one of the arguments is <option>help</option>, a list of allowed values
1953 will be printed and the program will exit.</para>
e1fac8a6
ZJS
1954 </listitem>
1955 </varlistentry>
344ca755 1956
e1fac8a6
ZJS
1957 <varlistentry>
1958 <term><option>--state=</option></term>
344ca755 1959
e1fac8a6 1960 <listitem>
a6e33464 1961 <para>The argument is a comma-separated list of unit LOAD, SUB, or ACTIVE states. When listing
37299769
MY
1962 units with <command>list-units</command>, <command>list-dependencies</command>, <command>show</command>
1963 or <command>status</command>, show only those in the specified states. Use <option>--state=failed</option>
1964 or <option>--failed</option> to show only failed units.</para>
a6e33464
ZJS
1965
1966 <para>As a special case, if one of the arguments is <option>help</option>, a list of allowed values
1967 will be printed and the program will exit.</para>
ec07c3c8
AK
1968
1969 <xi:include href="version-info.xml" xpointer="v206"/>
e1fac8a6
ZJS
1970 </listitem>
1971 </varlistentry>
27722f96 1972
e1fac8a6
ZJS
1973 <varlistentry>
1974 <term><option>-p</option></term>
1975 <term><option>--property=</option></term>
27722f96 1976
e1fac8a6
ZJS
1977 <listitem>
1978 <para>When showing unit/job/manager properties with the
1979 <command>show</command> command, limit display to properties
1980 specified in the argument. The argument should be a
1981 comma-separated list of property names, such as
1982 <literal>MainPID</literal>. Unless specified, all known
1983 properties are shown. If specified more than once, all
1984 properties with the specified names are shown. Shell
1985 completion is implemented for property names.</para>
7d4fb3b1 1986
e1fac8a6 1987 <para>For the manager itself,
c809e387
PN
1988 <command>systemctl show</command>
1989 will show all available properties, most of which are derived or closely match the options described in
e1fac8a6
ZJS
1990 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1991 </para>
7d4fb3b1 1992
e1fac8a6
ZJS
1993 <para>Properties for units vary by unit type, so showing any
1994 unit (even a non-existent one) is a way to list properties
1995 pertaining to this type. Similarly, showing any job will list
1996 properties pertaining to all jobs. Properties for units are
1997 documented in
1998 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1999 and the pages for individual unit types
2000 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
2001 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
2002 etc.</para>
2003 </listitem>
2004 </varlistentry>
7d4fb3b1 2005
5292c240
ZJS
2006 <varlistentry>
2007 <term><option>-P</option></term>
2008
2009 <listitem>
31e70e88 2010 <xi:include href="standard-options.xml" xpointer="xpointer(//varlistentry[@id='option-P']/listitem/para)" />
465a9d2a 2011 <xi:include href="version-info.xml" xpointer="v246"/>
5292c240
ZJS
2012 </listitem>
2013 </varlistentry>
2014
e1fac8a6
ZJS
2015 <varlistentry>
2016 <term><option>-a</option></term>
2017 <term><option>--all</option></term>
7d4fb3b1 2018
e1fac8a6
ZJS
2019 <listitem>
2020 <para>When listing units with <command>list-units</command>, also show inactive units and
2021 units which are following other units. When showing unit/job/manager properties, show all
2022 properties regardless whether they are set or not.</para>
7d4fb3b1 2023
e1fac8a6
ZJS
2024 <para>To list all units installed in the file system, use the
2025 <command>list-unit-files</command> command instead.</para>
39c38ce1 2026
e1fac8a6
ZJS
2027 <para>When listing units with <command>list-dependencies</command>, recursively show
2028 dependencies of all dependent units (by default only dependencies of target units are
2029 shown).</para>
7d4fb3b1 2030
e1fac8a6
ZJS
2031 <para>When used with <command>status</command>, show journal messages in full, even if they include
2032 unprintable characters or are very long. By default, fields with unprintable characters are
2033 abbreviated as "blob data". (Note that the pager may escape unprintable characters again.)</para>
2034 </listitem>
2035 </varlistentry>
7d4fb3b1 2036
e1fac8a6
ZJS
2037 <varlistentry>
2038 <term><option>-r</option></term>
2039 <term><option>--recursive</option></term>
7d4fb3b1 2040
e1fac8a6
ZJS
2041 <listitem>
2042 <para>When listing units, also show units of local
2043 containers. Units of local containers will be prefixed with
2044 the container name, separated by a single colon character
2045 (<literal>:</literal>).</para>
ec07c3c8
AK
2046
2047 <xi:include href="version-info.xml" xpointer="v212"/>
e1fac8a6
ZJS
2048 </listitem>
2049 </varlistentry>
b619ec8f 2050
e1fac8a6
ZJS
2051 <varlistentry>
2052 <term><option>--reverse</option></term>
b619ec8f 2053
e1fac8a6
ZJS
2054 <listitem>
2055 <para>Show reverse dependencies between units with
2056 <command>list-dependencies</command>, i.e. follow
2057 dependencies of type <varname>WantedBy=</varname>,
38f90179 2058 <varname>RequiredBy=</varname>, <varname>UpheldBy=</varname>,
e1fac8a6
ZJS
2059 <varname>PartOf=</varname>, <varname>BoundBy=</varname>,
2060 instead of <varname>Wants=</varname> and similar.
2061 </para>
ec07c3c8
AK
2062
2063 <xi:include href="version-info.xml" xpointer="v203"/>
e1fac8a6
ZJS
2064 </listitem>
2065 </varlistentry>
b619ec8f 2066
e1fac8a6
ZJS
2067 <varlistentry>
2068 <term><option>--after</option></term>
b619ec8f 2069
e1fac8a6
ZJS
2070 <listitem>
2071 <para>With <command>list-dependencies</command>, show the
2072 units that are ordered before the specified unit. In other
2073 words, recursively list units following the
2074 <varname>After=</varname> dependency.</para>
b619ec8f 2075
e1fac8a6
ZJS
2076 <para>Note that any <varname>After=</varname> dependency is
2077 automatically mirrored to create a
2078 <varname>Before=</varname> dependency. Temporal dependencies
2079 may be specified explicitly, but are also created implicitly
2080 for units which are <varname>WantedBy=</varname> targets
2081 (see
2082 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
2083 and as a result of other directives (for example
2084 <varname>RequiresMountsFor=</varname>). Both explicitly
2085 and implicitly introduced dependencies are shown with
2086 <command>list-dependencies</command>.</para>
27722f96 2087
e1fac8a6
ZJS
2088 <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs are
2089 waiting for it. May be combined with <option>--before</option> to show both the jobs waiting for each job as
2090 well as all jobs each job is waiting for.</para>
aefdc112
AK
2091
2092 <xi:include href="version-info.xml" xpointer="v203"/>
e1fac8a6
ZJS
2093 </listitem>
2094 </varlistentry>
0d292f5e 2095
e1fac8a6
ZJS
2096 <varlistentry>
2097 <term><option>--before</option></term>
0d292f5e 2098
e1fac8a6
ZJS
2099 <listitem>
2100 <para>With <command>list-dependencies</command>, show the
2101 units that are ordered after the specified unit. In other
2102 words, recursively list units following the
2103 <varname>Before=</varname> dependency.</para>
0d292f5e 2104
e1fac8a6
ZJS
2105 <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs it
2106 is waiting for. May be combined with <option>--after</option> to show both the jobs waiting for each job as
2107 well as all jobs each job is waiting for.</para>
ec07c3c8
AK
2108
2109 <xi:include href="version-info.xml" xpointer="v212"/>
e1fac8a6
ZJS
2110 </listitem>
2111 </varlistentry>
27722f96 2112
a602a0b4
KK
2113 <varlistentry>
2114 <term><option>--with-dependencies</option></term>
2115
2116 <listitem>
2117 <para>When used with <command>status</command>,
2118 <command>cat</command>, <command>list-units</command>, and
2119 <command>list-unit-files</command>, those commands print all
2120 specified units and the dependencies of those units.</para>
2121
2122 <para>Options <option>--reverse</option>,
2123 <option>--after</option>, <option>--before</option>
2124 may be used to change what types of dependencies
2125 are shown.</para>
ec07c3c8
AK
2126
2127 <xi:include href="version-info.xml" xpointer="v245"/>
a602a0b4
KK
2128 </listitem>
2129 </varlistentry>
2130
e1fac8a6
ZJS
2131 <varlistentry>
2132 <term><option>-l</option></term>
2133 <term><option>--full</option></term>
27722f96 2134
e1fac8a6
ZJS
2135 <listitem>
2136 <para>Do not ellipsize unit names, process tree entries,
2137 journal output, or truncate unit descriptions in the output
2138 of <command>status</command>, <command>list-units</command>,
2139 <command>list-jobs</command>, and
2140 <command>list-timers</command>.</para>
2141 <para>Also, show installation targets in the output of
2142 <command>is-enabled</command>.</para>
2143 </listitem>
2144 </varlistentry>
82948f6c 2145
e1fac8a6
ZJS
2146 <varlistentry>
2147 <term><option>--value</option></term>
27722f96 2148
e1fac8a6 2149 <listitem>
5292c240
ZJS
2150 <para>When printing properties with <command>show</command>, only print the value, and skip the
2151 property name and <literal>=</literal>. Also see option <option>-P</option> above.</para>
ec07c3c8 2152
465a9d2a 2153 <xi:include href="version-info.xml" xpointer="v230"/>
e1fac8a6
ZJS
2154 </listitem>
2155 </varlistentry>
27722f96 2156
e1fac8a6
ZJS
2157 <varlistentry>
2158 <term><option>--show-types</option></term>
27722f96 2159
e1fac8a6
ZJS
2160 <listitem>
2161 <para>When showing sockets, show the type of the socket.</para>
ec07c3c8 2162
465a9d2a 2163 <xi:include href="version-info.xml" xpointer="v202"/>
e1fac8a6
ZJS
2164 </listitem>
2165 </varlistentry>
27722f96 2166
e1fac8a6
ZJS
2167 <varlistentry>
2168 <term><option>--job-mode=</option></term>
27722f96 2169
e1fac8a6 2170 <listitem>
465a9d2a
ZJS
2171 <para>When queuing a new job, this option controls how to deal with
2172 already queued jobs. It takes one of <literal>fail</literal>,
2173 <literal>replace</literal>,
2174 <literal>replace-irreversibly</literal>,
2175 <literal>isolate</literal>,
2176 <literal>ignore-dependencies</literal>,
2177 <literal>ignore-requirements</literal>,
2178 <literal>flush</literal>,
2179 <literal>triggering</literal>, or
2180 <literal>restart-dependencies</literal>. Defaults to
2181 <literal>replace</literal>, except when the
2182 <command>isolate</command> command is used which implies the
2183 <literal>isolate</literal> job mode.</para>
2184
2185 <para>If <literal>fail</literal> is specified and a requested
2186 operation conflicts with a pending job (more specifically:
2187 causes an already pending start job to be reversed into a stop
2188 job or vice versa), cause the operation to fail.</para>
2189
2190 <para>If <literal>replace</literal> (the default) is
2191 specified, any conflicting pending job will be replaced, as
2192 necessary.</para>
2193
2194 <para>If <literal>replace-irreversibly</literal> is specified,
2195 operate like <literal>replace</literal>, but also mark the new
2196 jobs as irreversible. This prevents future conflicting
2197 transactions from replacing these jobs (or even being enqueued
2198 while the irreversible jobs are still pending). Irreversible
2199 jobs can still be cancelled using the <command>cancel</command>
2200 command. This job mode should be used on any transaction which
2201 pulls in <filename>shutdown.target</filename>.</para>
2202
2203 <para><literal>isolate</literal> is only valid for start
2204 operations and causes all other units to be stopped when the
2205 specified unit is started. This mode is always used when the
2206 <command>isolate</command> command is used.</para>
2207
2208 <para><literal>flush</literal> will cause all queued jobs to
2209 be canceled when the new job is enqueued.</para>
2210
2211 <para>If <literal>ignore-dependencies</literal> is specified,
2212 then all unit dependencies are ignored for this new job and
2213 the operation is executed immediately. If passed, no required
2214 units of the unit passed will be pulled in, and no ordering
2215 dependencies will be honored. This is mostly a debugging and
2216 rescue tool for the administrator and should not be used by
2217 applications.</para>
2218
2219 <para><literal>ignore-requirements</literal> is similar to
2220 <literal>ignore-dependencies</literal>, but only causes the
2221 requirement dependencies to be ignored, the ordering
2222 dependencies will still be honored.</para>
2223
2224 <para><literal>triggering</literal> may only be used with
2225 <command>systemctl stop</command>. In this mode, the specified
2226 unit and any active units that trigger it are stopped. See the
2227 discussion of
2228 <varname>Triggers=</varname> in <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
2229 for more information about triggering units.</para>
2230
2231 <para><literal>restart-dependencies</literal> may only be used with
2232 <command>systemctl start</command>. In this mode, dependencies of
2233 the specified unit will receive restart propagation, as if a restart
2234 job had been enqueued for the unit.</para>
2235
2236 <xi:include href="version-info.xml" xpointer="v209"/>
e9bd1853 2237 </listitem>
e1fac8a6 2238 </varlistentry>
27722f96 2239
e1fac8a6
ZJS
2240 <varlistentry>
2241 <term><option>-T</option></term>
2242 <term><option>--show-transaction</option></term>
99813a19 2243
e1fac8a6
ZJS
2244 <listitem>
2245 <para>When enqueuing a unit job (for example as effect of a <command>systemctl start</command>
2246 invocation or similar), show brief information about all jobs enqueued, covering both the requested
2247 job and any added because of unit dependencies. Note that the output will only include jobs
2248 immediately part of the transaction requested. It is possible that service start-up program code
2249 run as effect of the enqueued jobs might request further jobs to be pulled in. This means that
2250 completion of the listed jobs might ultimately entail more jobs than the listed ones.</para>
ec07c3c8 2251
465a9d2a 2252 <xi:include href="version-info.xml" xpointer="v242"/>
e1fac8a6
ZJS
2253 </listitem>
2254 </varlistentry>
2de51fdc 2255
e1fac8a6
ZJS
2256 <varlistentry>
2257 <term><option>--fail</option></term>
adb6cd9b 2258
e1fac8a6
ZJS
2259 <listitem>
2260 <para>Shorthand for <option>--job-mode=</option>fail.</para>
2261 <para>When used with the <command>kill</command> command,
2262 if no units were killed, the operation results in an error.
2263 </para>
ec07c3c8
AK
2264
2265 <xi:include href="version-info.xml" xpointer="v227"/>
e1fac8a6
ZJS
2266 </listitem>
2267 </varlistentry>
99813a19 2268
4327574f
FS
2269 <varlistentry>
2270 <term><option>--check-inhibitors=</option></term>
2271
2272 <listitem>
5b69a7c5
ZJS
2273 <para>When system shutdown or sleep state is requested, this option controls checking of inhibitor
2274 locks. It takes one of <literal>auto</literal>, <literal>yes</literal> or
4327574f 2275 <literal>no</literal>. Defaults to <literal>auto</literal>, which will behave like
5b69a7c5
ZJS
2276 <literal>yes</literal> for interactive invocations (i.e. from a TTY) and <literal>no</literal> for
2277 non-interactive invocations. <literal>yes</literal> lets the request respect inhibitor locks.
2278 <literal>no</literal> lets the request ignore inhibitor locks.</para>
2279
2280 <para>Applications can establish inhibitor locks to prevent certain important operations (such as
2281 CD burning) from being interrupted by system shutdown or sleep. Any user may take these locks and
2282 privileged users may override these locks. If any locks are taken, shutdown and sleep state
2283 requests will normally fail (unless privileged). However, if <literal>no</literal> is specified or
2284 <literal>auto</literal> is specified on a non-interactive requests, the operation will be
2285 attempted. If locks are present, the operation may require additional privileges.</para>
2286
2287 <para>Option <option>--force</option> provides another way to override inhibitors.</para>
ec07c3c8
AK
2288
2289 <xi:include href="version-info.xml" xpointer="v248"/>
4327574f
FS
2290 </listitem>
2291 </varlistentry>
2292
e1fac8a6
ZJS
2293 <varlistentry>
2294 <term><option>-i</option></term>
27722f96 2295
e1fac8a6 2296 <listitem>
4327574f 2297 <para>Shortcut for <option>--check-inhibitors=no</option>.</para>
aefdc112 2298
465a9d2a 2299 <xi:include href="version-info.xml" xpointer="v198"/>
e1fac8a6
ZJS
2300 </listitem>
2301 </varlistentry>
99813a19 2302
e1fac8a6
ZJS
2303 <varlistentry>
2304 <term><option>--dry-run</option></term>
27722f96 2305
e1fac8a6
ZJS
2306 <listitem>
2307 <para>Just print what would be done. Currently supported by verbs
2308 <command>halt</command>, <command>poweroff</command>, <command>reboot</command>,
2309 <command>kexec</command>, <command>suspend</command>, <command>hibernate</command>,
2310 <command>hybrid-sleep</command>, <command>suspend-then-hibernate</command>,
2311 <command>default</command>, <command>rescue</command>,
2312 <command>emergency</command>, and <command>exit</command>.</para>
ec07c3c8
AK
2313
2314 <xi:include href="version-info.xml" xpointer="v236"/>
e1fac8a6
ZJS
2315 </listitem>
2316 </varlistentry>
27722f96 2317
e1fac8a6
ZJS
2318 <varlistentry>
2319 <term><option>-q</option></term>
2320 <term><option>--quiet</option></term>
27722f96 2321
e1fac8a6
ZJS
2322 <listitem>
2323 <para>Suppress printing of the results of various commands
2324 and also the hints about truncated log lines. This does not
2325 suppress output of commands for which the printed output is
2326 the only result (like <command>show</command>). Errors are
2327 always printed.</para>
2328 </listitem>
2329 </varlistentry>
6324a8a7 2330
108d35ac
MY
2331 <varlistentry>
2332 <term><option>--no-warn</option></term>
2333
2334 <listitem>
91dfb74e
YW
2335 <para>Don't generate the warnings shown by default in the following cases:
2336 <itemizedlist>
2337 <listitem>
2338 <para>when <command>systemctl</command> is invoked without procfs mounted on
2339 <filename>/proc/</filename>,</para>
2340 </listitem>
2341 <listitem>
2342 <para>when using <command>enable</command> or <command>disable</command> on units without
e774d3c9
MY
2343 install information (i.e. don't have or have an empty [Install] section),</para>
2344 </listitem>
2345 <listitem>
2346 <para>when using <command>disable</command> combined with <option>--user</option> on units
0b675f97
MY
2347 that are enabled in global scope,</para>
2348 </listitem>
2349 <listitem>
d708bb7c 2350 <para>when a <command>stop</command>-ped, <command>disable</command>-d, or <command>mask</command>-ed
37257662
MY
2351 unit still has active triggering units,</para>
2352 </listitem>
2353 <listitem>
2354 <para>when a unit file is changed and requires <command>daemon-reload</command>.</para>
91dfb74e
YW
2355 </listitem>
2356 </itemizedlist>
2357 </para>
ec07c3c8
AK
2358
2359 <xi:include href="version-info.xml" xpointer="v253"/>
108d35ac
MY
2360 </listitem>
2361 </varlistentry>
2362
e1fac8a6
ZJS
2363 <varlistentry>
2364 <term><option>--no-block</option></term>
27722f96 2365
e1fac8a6
ZJS
2366 <listitem>
2367 <para>Do not synchronously wait for the requested operation
2368 to finish. If this is not specified, the job will be
2369 verified, enqueued and <command>systemctl</command> will
2370 wait until the unit's start-up is completed. By passing this
2371 argument, it is only verified and enqueued. This option may not be
2372 combined with <option>--wait</option>.</para>
2373 </listitem>
2374 </varlistentry>
6324a8a7 2375
e1fac8a6
ZJS
2376 <varlistentry>
2377 <term><option>--wait</option></term>
2378
2379 <listitem>
6be4dab0
DDM
2380 <para>When used with <command>start</command> or <command>restart</command>, synchronously wait for
2381 started units to terminate again. This option may not be combined with <option>--no-block</option>.
2382 Note that this will wait forever if any given unit never terminates (by itself or by getting
2383 stopped explicitly); particularly services which use <literal>RemainAfterExit=yes</literal>.</para>
2384
2385 <para>When used with <command>is-system-running</command>, wait until the boot process is completed
2386 before returning.</para>
2387
2388 <para>When used with <command>kill</command>, wait until the signalled units terminate. Note that
2389 this will wait forever if any given unit never terminates.</para>
ec07c3c8
AK
2390
2391 <xi:include href="version-info.xml" xpointer="v232"/>
e1fac8a6
ZJS
2392 </listitem>
2393 </varlistentry>
2394
2395 <xi:include href="user-system-options.xml" xpointer="user" />
2396 <xi:include href="user-system-options.xml" xpointer="system" />
2397
2398 <varlistentry>
2399 <term><option>--failed</option></term>
2400
2401 <listitem>
2402 <para>List units in failed state. This is equivalent to
2403 <option>--state=failed</option>.</para>
ec07c3c8
AK
2404
2405 <xi:include href="version-info.xml" xpointer="v233"/>
e1fac8a6
ZJS
2406 </listitem>
2407 </varlistentry>
2408
2409 <varlistentry>
2410 <term><option>--no-wall</option></term>
2411
2412 <listitem>
2413 <para>Do not send wall message before halt, power-off and reboot.</para>
2414 </listitem>
2415 </varlistentry>
2416
2417 <varlistentry>
2418 <term><option>--global</option></term>
2419
2420 <listitem>
2421 <para>When used with <command>enable</command> and
2422 <command>disable</command>, operate on the global user
2423 configuration directory, thus enabling or disabling a unit
2424 file globally for all future logins of all users.</para>
2425 </listitem>
2426 </varlistentry>
2427
2428 <varlistentry>
2429 <term><option>--no-reload</option></term>
2430
2431 <listitem>
2432 <para>When used with <command>enable</command> and
2433 <command>disable</command>, do not implicitly reload daemon
2434 configuration after executing the changes.</para>
2435 </listitem>
2436 </varlistentry>
2437
2438 <varlistentry>
2439 <term><option>--no-ask-password</option></term>
2440
2441 <listitem>
2442 <para>When used with <command>start</command> and related
2443 commands, disables asking for passwords. Background services
2444 may require input of a password or passphrase string, for
2445 example to unlock system hard disks or cryptographic
2446 certificates. Unless this option is specified and the
2447 command is invoked from a terminal,
2448 <command>systemctl</command> will query the user on the
2449 terminal for the necessary secrets. Use this option to
2450 switch this behavior off. In this case, the password must be
2451 supplied by some other means (for example graphical password
2452 agents) or the service might fail. This also disables
2453 querying the user for authentication for privileged
2454 operations.</para>
2455 </listitem>
2456 </varlistentry>
2457
2458 <varlistentry>
4ccde410 2459 <term><option>--kill-whom=</option></term>
e1fac8a6
ZJS
2460
2461 <listitem>
f4ff3e71
LP
2462 <para>When used with <command>kill</command>, choose which processes to send a UNIX process signal
2463 to. Must be one of <option>main</option>, <option>control</option> or <option>all</option> to
2464 select whether to kill only the main process, the control process or all processes of the unit. The
2465 main process of the unit is the one that defines the life-time of it. A control process of a unit
2466 is one that is invoked by the manager to induce state changes of it. For example, all processes
2467 started due to the <varname>ExecStartPre=</varname>, <varname>ExecStop=</varname> or
2468 <varname>ExecReload=</varname> settings of service units are control processes. Note that there is
2469 only one control process per unit at a time, as only one state change is executed at a time. For
2470 services of type <varname>Type=forking</varname>, the initial process started by the manager for
2471 <varname>ExecStart=</varname> is a control process, while the process ultimately forked off by that
2472 one is then considered the main process of the unit (if it can be determined). This is different
2473 for service units of other types, where the process forked off by the manager for
2474 <varname>ExecStart=</varname> is always the main process itself. A service unit consists of zero or
2475 one main process, zero or one control process plus any number of additional processes. Not all unit
2476 types manage processes of these types however. For example, for mount units, control processes are
2477 defined (which are the invocations of <filename>&MOUNT_PATH;</filename> and
2478 <filename>&UMOUNT_PATH;</filename>), but no main process is defined. If omitted, defaults to
e1fac8a6 2479 <option>all</option>.</para>
ec07c3c8 2480
465a9d2a 2481 <xi:include href="version-info.xml" xpointer="v252"/>
e1fac8a6 2482 </listitem>
e1fac8a6
ZJS
2483 </varlistentry>
2484
f4ff3e71 2485 <varlistentry>
9bfabe14 2486 <term><option>--kill-value=<replaceable>INT</replaceable></option></term>
f4ff3e71
LP
2487
2488 <listitem><para>If used with the <command>kill</command> command, enqueues a signal along with the
2489 specified integer value parameter to the specified process(es). This operation is only available for
2490 POSIX Realtime Signals (i.e. <option>--signal=SIGRTMIN+…</option> or
2491 <option>--signal=SIGRTMAX-…</option>), and ensures the signals are generated via the <citerefentry
2492 project='man-pages'><refentrytitle>sigqueue</refentrytitle><manvolnum>3</manvolnum></citerefentry>
2493 system call, rather than <citerefentry
2494 project='man-pages'><refentrytitle>kill</refentrytitle><manvolnum>3</manvolnum></citerefentry>. The
da890466 2495 specified value must be a 32-bit signed integer, and may be specified either in decimal, in
60c5bd77 2496 hexadecimal (if prefixed with <literal>0x</literal>), octal (if prefixed with <literal>0o</literal>)
f4ff3e71
LP
2497 or binary (if prefixed with <literal>0b</literal>)</para>
2498
2499 <para>If this option is used the signal will only be enqueued on the control or main process of the
2500 unit, never on other processes belonging to the unit, i.e. <option>--kill-whom=all</option> will only
ec07c3c8
AK
2501 affect main and control processes but no other processes.</para>
2502
2503 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
f4ff3e71
LP
2504 </varlistentry>
2505
86beb213 2506 <xi:include href="standard-options.xml" xpointer="signal" />
e1fac8a6
ZJS
2507
2508 <varlistentry>
2509 <term><option>--what=</option></term>
2510
2511 <listitem>
2512 <para>Select what type of per-unit resources to remove when the <command>clean</command> command is
4fb8f1e8
LP
2513 invoked, see above. Takes one of <constant>configuration</constant>, <constant>state</constant>,
2514 <constant>cache</constant>, <constant>logs</constant>, <constant>runtime</constant>,
2515 <constant>fdstore</constant> to select the type of resource. This option may be specified more than
2516 once, in which case all specified resource types are removed. Also accepts the special value
2517 <constant>all</constant> as a shortcut for specifying all six resource types. If this option is not
2518 specified defaults to the combination of <constant>cache</constant>, <constant>runtime</constant>
2519 and <constant>fdstore</constant>, i.e. the three kinds of resources that are generally considered
2520 to be redundant and can be reconstructed on next invocation. Note that the explicit removal of the
2521 <constant>fdstore</constant> resource type is only useful if the
2522 <varname>FileDescriptorStorePreserve=</varname> option is enabled, since the file descriptor store
2523 is otherwise cleaned automatically when the unit is stopped.</para>
ec07c3c8 2524
465a9d2a 2525 <xi:include href="version-info.xml" xpointer="v243"/>
e1fac8a6
ZJS
2526 </listitem>
2527 </varlistentry>
2528
2529 <varlistentry>
2530 <term><option>-f</option></term>
2531 <term><option>--force</option></term>
2532
2533 <listitem>
2534 <para>When used with <command>enable</command>, overwrite
2535 any existing conflicting symlinks.</para>
2536
2537 <para>When used with <command>edit</command>, create all of the
2538 specified units which do not already exist.</para>
2539
2540 <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command> or
2541 <command>kexec</command>, execute the selected operation without shutting down all units. However, all
2542 processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a
2543 drastic but relatively safe option to request an immediate reboot. If <option>--force</option> is specified
2544 twice for these operations (with the exception of <command>kexec</command>), they will be executed
617b85d1
DT
2545 immediately, without terminating any processes or unmounting any file systems.</para>
2546
2547 <warning>
2548 <para>Specifying
2549 <option>--force</option> twice with any of these operations might result in data loss. Note that when
2550 <option>--force</option> is specified twice the selected operation is executed by
2551 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
2552 succeed even when the system manager has crashed.</para>
2553 </warning>
e1fac8a6
ZJS
2554 </listitem>
2555 </varlistentry>
27722f96 2556
e1fac8a6
ZJS
2557 <varlistentry>
2558 <term><option>--message=</option></term>
6324a8a7 2559
e1fac8a6
ZJS
2560 <listitem>
2561 <para>When used with <command>halt</command>, <command>poweroff</command> or <command>reboot</command>, set a
2562 short message explaining the reason for the operation. The message will be logged together with the default
2563 shutdown message.</para>
ec07c3c8 2564
465a9d2a 2565 <xi:include href="version-info.xml" xpointer="v225"/>
e1fac8a6
ZJS
2566 </listitem>
2567 </varlistentry>
6324a8a7 2568
e1fac8a6
ZJS
2569 <varlistentry>
2570 <term><option>--now</option></term>
b619ec8f 2571
e1fac8a6
ZJS
2572 <listitem>
2573 <para>When used with <command>enable</command>, the units
2574 will also be started. When used with <command>disable</command> or
2575 <command>mask</command>, the units will also be stopped. The start
2576 or stop operation is only carried out when the respective enable or
2577 disable operation has been successful.</para>
ec07c3c8 2578
465a9d2a 2579 <xi:include href="version-info.xml" xpointer="v220"/>
e1fac8a6
ZJS
2580 </listitem>
2581 </varlistentry>
27722f96 2582
e1fac8a6
ZJS
2583 <varlistentry>
2584 <term><option>--root=</option></term>
6324a8a7 2585
e1fac8a6
ZJS
2586 <listitem>
2587 <para>When used with
2588 <command>enable</command>/<command>disable</command>/<command>is-enabled</command>
2589 (and related commands), use the specified root path when looking for unit
2590 files. If this option is present, <command>systemctl</command> will operate on
2591 the file system directly, instead of communicating with the <command>systemd</command>
2592 daemon to carry out changes.</para>
2593 </listitem>
b619ec8f 2594
e1fac8a6 2595 </varlistentry>
27722f96 2596
8aa3894e
RP
2597 <varlistentry>
2598 <term><option>--image=<replaceable>image</replaceable></option></term>
2599
2600 <listitem><para>Takes a path to a disk image file or block device node. If specified, all operations
2601 are applied to file system in the indicated disk image. This option is similar to
2602 <option>--root=</option>, but operates on file systems stored in disk images or block devices. The
2603 disk image should either contain just a file system or a set of file systems within a GPT partition
db811444 2604 table, following the <ulink url="https://uapi-group.org/specifications/specs/discoverable_partitions_specification">Discoverable Partitions
8aa3894e
RP
2605 Specification</ulink>. For further information on supported disk images, see
2606 <citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
ec07c3c8
AK
2607 switch of the same name.</para>
2608
2609 <xi:include href="version-info.xml" xpointer="v252"/></listitem>
8aa3894e
RP
2610 </varlistentry>
2611
9ea81191
LP
2612 <xi:include href="standard-options.xml" xpointer="image-policy-open" />
2613
e1fac8a6
ZJS
2614 <varlistentry>
2615 <term><option>--runtime</option></term>
6324a8a7 2616
e1fac8a6
ZJS
2617 <listitem>
2618 <para>When used with <command>enable</command>,
2619 <command>disable</command>, <command>edit</command>,
2620 (and related commands), make changes only temporarily, so
2621 that they are lost on the next reboot. This will have the
2622 effect that changes are not made in subdirectories of
3b121157 2623 <filename>/etc/</filename> but in <filename>/run/</filename>,
e1fac8a6
ZJS
2624 with identical immediate effects, however, since the latter
2625 is lost on reboot, the changes are lost too.</para>
27722f96 2626
e1fac8a6
ZJS
2627 <para>Similarly, when used with
2628 <command>set-property</command>, make changes only
2629 temporarily, so that they are lost on the next
2630 reboot.</para>
2631 </listitem>
2632 </varlistentry>
b619ec8f 2633
e1fac8a6
ZJS
2634 <varlistentry>
2635 <term><option>--preset-mode=</option></term>
b619ec8f 2636
e1fac8a6
ZJS
2637 <listitem>
2638 <para>Takes one of <literal>full</literal> (the default),
2639 <literal>enable-only</literal>,
2640 <literal>disable-only</literal>. When used with the
2641 <command>preset</command> or <command>preset-all</command>
2642 commands, controls whether units shall be disabled and
2643 enabled according to the preset rules, or only enabled, or
2644 only disabled.</para>
ec07c3c8 2645
465a9d2a 2646 <xi:include href="version-info.xml" xpointer="v215"/>
e1fac8a6
ZJS
2647 </listitem>
2648 </varlistentry>
27722f96 2649
e1fac8a6
ZJS
2650 <varlistentry>
2651 <term><option>-n</option></term>
2652 <term><option>--lines=</option></term>
b619ec8f 2653
e1fac8a6 2654 <listitem>
e04eae5e
ZJS
2655 <para>When used with <command>status</command>, controls the number of journal lines to show,
2656 counting from the most recent ones. Takes a positive integer argument, or 0 to disable journal
2657 output. Defaults to 10.</para>
e1fac8a6
ZJS
2658 </listitem>
2659 </varlistentry>
27722f96 2660
e1fac8a6
ZJS
2661 <varlistentry>
2662 <term><option>-o</option></term>
2663 <term><option>--output=</option></term>
b619ec8f 2664
e1fac8a6
ZJS
2665 <listitem>
2666 <para>When used with <command>status</command>, controls the
2667 formatting of the journal entries that are shown. For the
2668 available choices, see
2669 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
2670 Defaults to <literal>short</literal>.</para>
2671 </listitem>
2672 </varlistentry>
27722f96 2673
e1fac8a6
ZJS
2674 <varlistentry>
2675 <term><option>--firmware-setup</option></term>
6cc2b882 2676
e1fac8a6 2677 <listitem>
bc9e592c
MY
2678 <para>When used with the <command>reboot</command>, <command>poweroff</command>, or
2679 <command>halt</command> command, indicate to the system's firmware to reboot into the firmware
2680 setup interface for the next boot. Note that this functionality is not available on all systems.
2681 </para>
ec07c3c8 2682
465a9d2a 2683 <xi:include href="version-info.xml" xpointer="v220"/>
e1fac8a6
ZJS
2684 </listitem>
2685 </varlistentry>
6cc2b882 2686
e1fac8a6 2687 <varlistentry>
76c068b7 2688 <term><option>--boot-loader-menu=<replaceable>timeout</replaceable></option></term>
4a6022f0 2689
e1fac8a6 2690 <listitem>
bc9e592c
MY
2691 <para>When used with the <command>reboot</command>, <command>poweroff</command>, or
2692 <command>halt</command> command, indicate to the system's boot loader to show the boot loader menu
2693 on the following boot. Takes a time value as parameter — indicating the menu timeout. Pass zero
2694 in order to disable the menu timeout. Note that not all boot loaders support this functionality.
2695 </para>
ec07c3c8 2696
465a9d2a 2697 <xi:include href="version-info.xml" xpointer="v242"/>
e1fac8a6
ZJS
2698 </listitem>
2699 </varlistentry>
a7c0e5d7 2700
e1fac8a6 2701 <varlistentry>
76c068b7 2702 <term><option>--boot-loader-entry=<replaceable>ID</replaceable></option></term>
e3e0314b 2703
e1fac8a6 2704 <listitem>
bc9e592c
MY
2705 <para>When used with the <command>reboot</command>, <command>poweroff</command>, or
2706 <command>halt</command> command, indicate to the system's boot loader to boot into a specific
2707 boot loader entry on the following boot. Takes a boot loader entry identifier as argument,
2708 or <literal>help</literal> in order to list available entries. Note that not all boot loaders
2709 support this functionality.</para>
ec07c3c8 2710
465a9d2a 2711 <xi:include href="version-info.xml" xpointer="v242"/>
e1fac8a6
ZJS
2712 </listitem>
2713 </varlistentry>
e3e0314b 2714
dae710be 2715 <varlistentry>
2716 <term><option>--reboot-argument=</option></term>
2717
2718 <listitem>
465a9d2a
ZJS
2719 <para>This switch is used with <command>reboot</command>. The value is architecture and firmware
2720 specific. As an example, <literal>recovery</literal> might be used to trigger system recovery, and
2721 <literal>fota</literal> might be used to trigger a <quote>firmware over the air</quote>
2722 update.</para>
ec07c3c8 2723
465a9d2a 2724 <xi:include href="version-info.xml" xpointer="v246"/>
dae710be 2725 </listitem>
2726 </varlistentry>
2727
e1fac8a6
ZJS
2728 <varlistentry>
2729 <term><option>--plain</option></term>
a7c0e5d7 2730
e1fac8a6
ZJS
2731 <listitem>
2732 <para>When used with <command>list-dependencies</command>,
2733 <command>list-units</command> or <command>list-machines</command>,
2734 the output is printed as a list instead of a tree, and the bullet
2735 circles are omitted.</para>
ec07c3c8 2736
465a9d2a 2737 <xi:include href="version-info.xml" xpointer="v203"/>
e1fac8a6
ZJS
2738 </listitem>
2739 </varlistentry>
46ad9c53
LB
2740
2741 <varlistentry>
2742 <term><option>--timestamp=</option></term>
2743
2744 <listitem>
d13f2617
ZJS
2745 <para>Change the format of printed timestamps. The following values may be used:
2746 </para>
2747
2748 <variablelist>
2749 <varlistentry>
2750 <term><option>pretty</option> (this is the default)</term>
ec07c3c8
AK
2751 <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS TZ</literal></para>
2752
2753 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
d13f2617
ZJS
2754 </varlistentry>
2755 </variablelist>
2756
b58b4a9f
FS
2757 <variablelist>
2758 <varlistentry>
2759 <term><option>unix</option></term>
ec07c3c8
AK
2760 <listitem><para><literal>@seconds-since-the-epoch</literal></para>
2761
2762 <xi:include href="version-info.xml" xpointer="v251"/></listitem>
b58b4a9f
FS
2763 </varlistentry>
2764 </variablelist>
2765
d13f2617
ZJS
2766 <variablelist>
2767 <varlistentry>
2768 <term><option>us</option></term>
e503019b 2769 <term><option>μs</option></term>
aefdc112
AK
2770 <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS.UUUUUU TZ</literal></para>
2771
2772 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
d13f2617
ZJS
2773 </varlistentry>
2774 </variablelist>
2775
2776 <variablelist>
2777 <varlistentry>
2778 <term><option>utc</option></term>
ec07c3c8
AK
2779 <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS UTC</literal></para>
2780
2781 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
d13f2617
ZJS
2782 </varlistentry>
2783 </variablelist>
2784
2785 <variablelist>
2786 <varlistentry>
2787 <term><option>us+utc</option></term>
e503019b 2788 <term><option>μs+utc</option></term>
aefdc112
AK
2789 <listitem><para><literal>Day YYYY-MM-DD HH:MM:SS.UUUUUU UTC</literal></para>
2790
2791 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
d13f2617
ZJS
2792 </varlistentry>
2793 </variablelist>
ec07c3c8 2794
465a9d2a 2795 <xi:include href="version-info.xml" xpointer="v247"/>
46ad9c53
LB
2796 </listitem>
2797 </varlistentry>
e1fac8a6 2798
5e8deb94
LB
2799 <varlistentry>
2800 <term><option>--mkdir</option></term>
2801
2802 <listitem><para>When used with <command>bind</command>, creates the destination file or directory before
2803 applying the bind mount. Note that even though the name of this option suggests that it is suitable only for
2804 directories, this option also creates the destination file node to mount over if the object to mount is not
ec07c3c8
AK
2805 a directory, but a regular file, device node, socket or FIFO.</para>
2806
2807 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
5e8deb94
LB
2808 </varlistentry>
2809
c9615f73
ZJS
2810 <varlistentry>
2811 <term><option>--marked</option></term>
2812
2813 <listitem><para>Only allowed with <command>reload-or-restart</command>. Enqueues restart jobs for all
2814 units that have the <literal>needs-restart</literal> mark, and reload jobs for units that have the
2815 <literal>needs-reload</literal> mark. When a unit marked for reload does not support reload, restart
1ca1bb03 2816 will be queued. Those properties can be set using <command>set-property Markers=…</command>.</para>
c9615f73
ZJS
2817
2818 <para>Unless <option>--no-block</option> is used, <command>systemctl</command> will wait for the
ec07c3c8
AK
2819 queued jobs to finish.</para>
2820
2821 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
c9615f73
ZJS
2822 </varlistentry>
2823
5e8deb94
LB
2824 <varlistentry>
2825 <term><option>--read-only</option></term>
2826
ec07c3c8
AK
2827 <listitem><para>When used with <command>bind</command>, creates a read-only bind mount.</para>
2828
30247ea7
ZJS
2829 <xi:include href="version-info.xml" xpointer="v248"/>
2830 </listitem>
5e8deb94
LB
2831 </varlistentry>
2832
f206809b 2833 <varlistentry>
9bfabe14 2834 <term><option>--drop-in=<replaceable>NAME</replaceable></option></term>
f206809b 2835
30247ea7
ZJS
2836 <listitem><para>When used with <command>edit</command>, use <replaceable>NAME</replaceable> as the
2837 drop-in file name instead of <filename>override.conf</filename>.</para>
ec07c3c8
AK
2838
2839 <xi:include href="version-info.xml" xpointer="v253"/>
f206809b
MY
2840 </listitem>
2841 </varlistentry>
2842
1433e1f9
MY
2843 <varlistentry>
2844 <term><option>--when=</option></term>
2845
2846 <listitem>
2847 <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command>
2848 or <command>kexec</command>, schedule the action to be performed at the given timestamp,
2849 which should adhere to the syntax documented in <citerefentry
2850 project='man-pages'><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>
2851 section "PARSING TIMESTAMPS". Specially, if <literal>show</literal> is given, the currently scheduled
2852 action will be shown, which can be canceled by passing an empty string or <literal>cancel</literal>.</para>
ec07c3c8 2853
465a9d2a 2854 <xi:include href="version-info.xml" xpointer="v254"/>
1433e1f9
MY
2855 </listitem>
2856 </varlistentry>
2857
329050c5
ZJS
2858 <varlistentry>
2859 <term><option>--stdin</option></term>
2860
2861 <listitem>
2862 <para>When used with <command>edit</command>, the contents of the file will be read from standard
2863 input and the editor will not be launched. In this mode, the old contents of the file are
2864 completely replaced. This is useful to "edit" unit files from scripts:</para>
2865
2866 <programlisting>$ systemctl edit --drop-in=limits.conf --stdin some-service.service &lt;&lt;EOF
2867[Unit]
2868AllowedCPUs=7,11
2869EOF
2870 </programlisting>
2871
2872 <para>Multiple drop-ins may be "edited" in this mode; the same contents will be written to all of
2873 them.</para>
2874
2875 <xi:include href="version-info.xml" xpointer="v256"/>
1433e1f9
MY
2876 </listitem>
2877 </varlistentry>
2878
e1fac8a6
ZJS
2879 <xi:include href="user-system-options.xml" xpointer="host" />
2880 <xi:include href="user-system-options.xml" xpointer="machine" />
e8fd5554 2881 <xi:include href="user-system-options.xml" xpointer="capsule" />
e1fac8a6
ZJS
2882
2883 <xi:include href="standard-options.xml" xpointer="no-pager" />
6906da26 2884 <xi:include href="standard-options.xml" xpointer="legend" />
e1fac8a6
ZJS
2885 <xi:include href="standard-options.xml" xpointer="help" />
2886 <xi:include href="standard-options.xml" xpointer="version" />
2887 </variablelist>
4a6022f0
ZJS
2888 </refsect1>
2889
2890 <refsect1>
2891 <title>Exit status</title>
2892
23a9ffb0
ZJS
2893 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
2894
2895 <para><command>systemctl</command> uses the return codes defined by LSB, as defined in
2896 <ulink url="http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html">LSB 3.0.0</ulink>.
2897 </para>
2898
2899 <table>
2900 <title>LSB return codes</title>
2901
2902 <tgroup cols='3'>
2903 <thead>
2904 <row>
2905 <entry>Value</entry>
2906 <entry>Description in LSB</entry>
2907 <entry>Use in systemd</entry>
2908 </row>
2909 </thead>
2910 <tbody>
2911 <row>
2912 <entry><constant>0</constant></entry>
2913 <entry>"program is running or service is OK"</entry>
2914 <entry>unit is active</entry>
2915 </row>
2916 <row>
2917 <entry><constant>1</constant></entry>
2918 <entry>"program is dead and <filename>/var/run</filename> pid file exists"</entry>
2919 <entry>unit <emphasis>not</emphasis> failed (used by <command>is-failed</command>)</entry>
2920 </row>
2921 <row>
2922 <entry><constant>2</constant></entry>
2923 <entry>"program is dead and <filename>/var/lock</filename> lock file exists"</entry>
2924 <entry>unused</entry>
2925 </row>
2926 <row>
2927 <entry><constant>3</constant></entry>
2928 <entry>"program is not running"</entry>
2929 <entry>unit is not active</entry>
2930 </row>
2931 <row>
2932 <entry><constant>4</constant></entry>
2933 <entry>"program or service status is unknown"</entry>
2934 <entry>no such unit</entry>
2935 </row>
2936 </tbody>
2937 </tgroup>
2938 </table>
2939
2940 <para>The mapping of LSB service states to systemd unit states is imperfect, so it is better to
2941 not rely on those return values but to look for specific unit states and substates instead.
2942 </para>
4a6022f0
ZJS
2943 </refsect1>
2944
7d4fb3b1
RC
2945 <refsect1>
2946 <title>Environment</title>
2947
2948 <variablelist class='environment-variables'>
2949 <varlistentry>
2950 <term><varname>$SYSTEMD_EDITOR</varname></term>
2951
2952 <listitem><para>Editor to use when editing units; overrides
2953 <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither
2954 <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor
2955 <varname>$VISUAL</varname> are present or if it is set to an empty
2956 string or if their execution failed, systemctl will try to execute well
2957 known editors in this order:
9391a1c3 2958 <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
3ba3a79d
ZJS
2959 <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2960 <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2961 <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
ec07c3c8
AK
2962 </para>
2963
2964 <xi:include href="version-info.xml" xpointer="v218"/></listitem>
7d4fb3b1 2965 </varlistentry>
16a07ffc
YW
2966 <xi:include href="common-variables.xml" xpointer="log-level"/>
2967 <xi:include href="common-variables.xml" xpointer="log-color"/>
2968 <xi:include href="common-variables.xml" xpointer="log-time"/>
2969 <xi:include href="common-variables.xml" xpointer="log-location"/>
2970 <xi:include href="common-variables.xml" xpointer="log-target"/>
2971 <xi:include href="common-variables.xml" xpointer="pager"/>
2972 <xi:include href="common-variables.xml" xpointer="less"/>
2973 <xi:include href="common-variables.xml" xpointer="lesscharset"/>
2974 <xi:include href="common-variables.xml" xpointer="lesssecure"/>
2975 <xi:include href="common-variables.xml" xpointer="colors"/>
2976 <xi:include href="common-variables.xml" xpointer="urlify"/>
7d4fb3b1 2977 </variablelist>
7d4fb3b1 2978 </refsect1>
4a6022f0
ZJS
2979
2980 <refsect1>
2981 <title>See Also</title>
13a69c12
DT
2982 <para><simplelist type="inline">
2983 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
2984 <member><citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
2985 <member><citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
2986 <member><citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
2987 <member><citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
2988 <member><citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
2989 <member><citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
2990 <member><citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
2991 <member><citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
2992 <member><citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
2993 <member><citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
2994 </simplelist></para>
4a6022f0 2995 </refsect1>
7874bcd6
LP
2996
2997</refentry>