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