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