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