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