]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemctl.xml
6dc7cd66f3528403cbb6258f283601ac1b60e20f
[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 not 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 <literal>[Install]</literal> 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 <literal>[Install]</literal>
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 <literal>[Install]</literal> 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 <literal>[Install]</literal> 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 <literal>[Install]</literal> 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 <literal>[Install]</literal> 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 file, 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 <literal>[Install]</literal> 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> <optional><replaceable>arg</replaceable></optional></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 optional argument <replaceable>arg</replaceable> is given, it will be passed as the optional
1315 argument to the <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1316 system call. The value is architecture and firmware specific. As an example, <literal>recovery</literal>
1317 might be used to trigger system recovery, and <literal>fota</literal> might be used to trigger a
1318 <quote>firmware over the air</quote> update.</para>
1319 </listitem>
1320 </varlistentry>
1321
1322 <varlistentry>
1323 <term><command>kexec</command></term>
1324
1325 <listitem>
1326 <para>Shut down and reboot the system via <command>kexec</command>. This is equivalent to
1327 <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block</command>. This command is
1328 asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1329 complete.</para>
1330
1331 <para>If combined with <option>--force</option>, shutdown of all running services is skipped, however all
1332 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1333 reboot.</para>
1334 </listitem>
1335 </varlistentry>
1336
1337 <varlistentry>
1338 <term><command>exit</command> <optional><replaceable>EXIT_CODE</replaceable></optional></term>
1339
1340 <listitem>
1341 <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in
1342 conjunction with the <option>--user</option> option) or in containers and is equivalent to
1343 <command>poweroff</command> otherwise. This command is asynchronous; it will return after the exit
1344 operation is enqueued, without waiting for it to complete.</para>
1345
1346 <para>The service manager will exit with the specified exit code, if
1347 <replaceable>EXIT_CODE</replaceable> is passed.</para>
1348 </listitem>
1349 </varlistentry>
1350
1351 <varlistentry>
1352 <term><command>switch-root</command> <replaceable>ROOT</replaceable> <optional><replaceable>INIT</replaceable></optional></term>
1353
1354 <listitem>
1355 <para>Switches to a different root directory and executes a new system manager process below it. This is
1356 intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager
1357 process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host
1358 volume. This call takes two arguments: the directory that is to become the new root directory, and the path
1359 to the new system manager binary below it to execute as PID 1. If the latter is omitted or the empty
1360 string, a systemd binary will automatically be searched for and used as init. If the system manager path is
1361 omitted, equal to the empty string or identical to the path to the systemd binary, the state of the
1362 initrd's system manager process is passed to the main system manager, which allows later introspection of
1363 the state of the services involved in the initrd boot phase.</para>
1364 </listitem>
1365 </varlistentry>
1366
1367 <varlistentry>
1368 <term><command>suspend</command></term>
1369
1370 <listitem>
1371 <para>Suspend the system. This will trigger activation of the special target unit
1372 <filename>suspend.target</filename>. This command is asynchronous, and will return after the suspend
1373 operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.</para>
1374 </listitem>
1375 </varlistentry>
1376
1377 <varlistentry>
1378 <term><command>hibernate</command></term>
1379
1380 <listitem>
1381 <para>Hibernate the system. This will trigger activation of the special target unit
1382 <filename>hibernate.target</filename>. This command is asynchronous, and will return after the hibernation
1383 operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.</para>
1384 </listitem>
1385 </varlistentry>
1386
1387 <varlistentry>
1388 <term><command>hybrid-sleep</command></term>
1389
1390 <listitem>
1391 <para>Hibernate and suspend the system. This will trigger activation of the special target unit
1392 <filename>hybrid-sleep.target</filename>. This command is asynchronous, and will return after the hybrid
1393 sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.</para>
1394 </listitem>
1395 </varlistentry>
1396
1397 <varlistentry>
1398 <term><command>suspend-then-hibernate</command></term>
1399
1400 <listitem>
1401 <para>Suspend the system and hibernate it after the delay specified in <filename>systemd-sleep.conf</filename>.
1402 This will trigger activation of the special target unit <filename>suspend-then-hibernate.target</filename>.
1403 This command is asynchronous, and will return after the hybrid sleep operation is successfully enqueued.
1404 It will not wait for the sleep/wake-up or hibernate/thaw cycle to complete.</para>
1405 </listitem>
1406 </varlistentry>
1407 </variablelist>
1408 </refsect2>
1409
1410 <refsect2>
1411 <title>Parameter Syntax</title>
1412
1413 <para>Unit commands listed above take either a single unit name (designated as <replaceable>UNIT</replaceable>),
1414 or multiple unit specifications (designated as <replaceable>PATTERN</replaceable>…). In the first case, the
1415 unit name with or without a suffix must be given. If the suffix is not specified (unit name is "abbreviated"),
1416 systemctl will append a suitable suffix, <literal>.service</literal> by default, and a type-specific suffix in
1417 case of commands which operate only on specific unit types. For example,
1418 <programlisting># systemctl start sshd</programlisting> and
1419 <programlisting># systemctl start sshd.service</programlisting>
1420 are equivalent, as are
1421 <programlisting># systemctl isolate default</programlisting>
1422 and
1423 <programlisting># systemctl isolate default.target</programlisting>
1424 Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
1425 paths to mount unit names.
1426 <programlisting># systemctl status /dev/sda
1427 # systemctl status /home</programlisting>
1428 are equivalent to:
1429 <programlisting># systemctl status dev-sda.device
1430 # systemctl status home.mount</programlisting>
1431 In the second case, shell-style globs will be matched against the primary names of all units currently in memory;
1432 literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
1433 names always refer to exactly one unit, but globs may match zero units and this is not considered an
1434 error.</para>
1435
1436 <para>Glob patterns use
1437 <citerefentry project='man-pages'><refentrytitle>fnmatch</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1438 so normal shell-style globbing rules are used, and
1439 <literal>*</literal>, <literal>?</literal>,
1440 <literal>[]</literal> may be used. See
1441 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1442 for more details. The patterns are matched against the primary names of
1443 units currently in memory, and patterns which do not match anything
1444 are silently skipped. For example:
1445 <programlisting># systemctl stop sshd@*.service</programlisting>
1446 will stop all <filename>sshd@.service</filename> instances. Note that alias names of units, and units that aren't
1447 in memory are not considered for glob expansion.
1448 </para>
1449
1450 <para>For unit file commands, the specified <replaceable>UNIT</replaceable> should be the name of the unit file
1451 (possibly abbreviated, see above), or the absolute path to the unit file:
1452 <programlisting># systemctl enable foo.service</programlisting>
1453 or
1454 <programlisting># systemctl link /path/to/foo.service</programlisting>
1455 </para>
1456 </refsect2>
1457
1458 </refsect1>
1459
1460 <refsect1>
1461 <title>Options</title>
1462
1463 <para>The following options are understood:</para>
1464
1465 <variablelist>
1466 <varlistentry>
1467 <term><option>-t</option></term>
1468 <term><option>--type=</option></term>
1469
1470 <listitem>
1471 <para>The argument should be a comma-separated list of unit
1472 types such as <option>service</option> and
1473 <option>socket</option>.
1474 </para>
1475
1476 <para>If one of the arguments is a unit type, when listing
1477 units, limit display to certain unit types. Otherwise, units
1478 of all types will be shown.</para>
1479
1480 <para>As a special case, if one of the arguments is
1481 <option>help</option>, a list of allowed values will be
1482 printed and the program will exit.</para>
1483 </listitem>
1484 </varlistentry>
1485
1486 <varlistentry>
1487 <term><option>--state=</option></term>
1488
1489 <listitem>
1490 <para>The argument should be a comma-separated list of unit
1491 LOAD, SUB, or ACTIVE states. When listing units, show only
1492 those in the specified states. Use <option>--state=failed</option>
1493 to show only failed units.</para>
1494
1495 <para>As a special case, if one of the arguments is
1496 <option>help</option>, a list of allowed values will be
1497 printed and the program will exit.</para>
1498 </listitem>
1499 </varlistentry>
1500
1501 <varlistentry>
1502 <term><option>-p</option></term>
1503 <term><option>--property=</option></term>
1504
1505 <listitem>
1506 <para>When showing unit/job/manager properties with the
1507 <command>show</command> command, limit display to properties
1508 specified in the argument. The argument should be a
1509 comma-separated list of property names, such as
1510 <literal>MainPID</literal>. Unless specified, all known
1511 properties are shown. If specified more than once, all
1512 properties with the specified names are shown. Shell
1513 completion is implemented for property names.</para>
1514
1515 <para>For the manager itself,
1516 <command>systemctl show</command> will show all available
1517 properties. Those properties are documented in
1518 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1519 </para>
1520
1521 <para>Properties for units vary by unit type, so showing any
1522 unit (even a non-existent one) is a way to list properties
1523 pertaining to this type. Similarly, showing any job will list
1524 properties pertaining to all jobs. Properties for units are
1525 documented in
1526 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1527 and the pages for individual unit types
1528 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1529 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1530 etc.</para>
1531 </listitem>
1532 </varlistentry>
1533
1534 <varlistentry>
1535 <term><option>-P</option></term>
1536
1537 <listitem>
1538 <para>Equivalent to <option>--value</option> <option>--property=</option>, i.e. shows the
1539 value of the property without the property name or <literal>=</literal>. Note that using
1540 <option>-P</option> once will also affect all properties listed with
1541 <option>-p</option>/<option>--property=</option>.</para>
1542 </listitem>
1543 </varlistentry>
1544
1545 <varlistentry>
1546 <term><option>-a</option></term>
1547 <term><option>--all</option></term>
1548
1549 <listitem>
1550 <para>When listing units with <command>list-units</command>, also show inactive units and
1551 units which are following other units. When showing unit/job/manager properties, show all
1552 properties regardless whether they are set or not.</para>
1553
1554 <para>To list all units installed in the file system, use the
1555 <command>list-unit-files</command> command instead.</para>
1556
1557 <para>When listing units with <command>list-dependencies</command>, recursively show
1558 dependencies of all dependent units (by default only dependencies of target units are
1559 shown).</para>
1560
1561 <para>When used with <command>status</command>, show journal messages in full, even if they include
1562 unprintable characters or are very long. By default, fields with unprintable characters are
1563 abbreviated as "blob data". (Note that the pager may escape unprintable characters again.)</para>
1564 </listitem>
1565 </varlistentry>
1566
1567 <varlistentry>
1568 <term><option>-r</option></term>
1569 <term><option>--recursive</option></term>
1570
1571 <listitem>
1572 <para>When listing units, also show units of local
1573 containers. Units of local containers will be prefixed with
1574 the container name, separated by a single colon character
1575 (<literal>:</literal>).</para>
1576 </listitem>
1577 </varlistentry>
1578
1579 <varlistentry>
1580 <term><option>--reverse</option></term>
1581
1582 <listitem>
1583 <para>Show reverse dependencies between units with
1584 <command>list-dependencies</command>, i.e. follow
1585 dependencies of type <varname>WantedBy=</varname>,
1586 <varname>RequiredBy=</varname>,
1587 <varname>PartOf=</varname>, <varname>BoundBy=</varname>,
1588 instead of <varname>Wants=</varname> and similar.
1589 </para>
1590 </listitem>
1591 </varlistentry>
1592
1593 <varlistentry>
1594 <term><option>--after</option></term>
1595
1596 <listitem>
1597 <para>With <command>list-dependencies</command>, show the
1598 units that are ordered before the specified unit. In other
1599 words, recursively list units following the
1600 <varname>After=</varname> dependency.</para>
1601
1602 <para>Note that any <varname>After=</varname> dependency is
1603 automatically mirrored to create a
1604 <varname>Before=</varname> dependency. Temporal dependencies
1605 may be specified explicitly, but are also created implicitly
1606 for units which are <varname>WantedBy=</varname> targets
1607 (see
1608 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
1609 and as a result of other directives (for example
1610 <varname>RequiresMountsFor=</varname>). Both explicitly
1611 and implicitly introduced dependencies are shown with
1612 <command>list-dependencies</command>.</para>
1613
1614 <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs are
1615 waiting for it. May be combined with <option>--before</option> to show both the jobs waiting for each job as
1616 well as all jobs each job is waiting for.</para>
1617 </listitem>
1618 </varlistentry>
1619
1620 <varlistentry>
1621 <term><option>--before</option></term>
1622
1623 <listitem>
1624 <para>With <command>list-dependencies</command>, show the
1625 units that are ordered after the specified unit. In other
1626 words, recursively list units following the
1627 <varname>Before=</varname> dependency.</para>
1628
1629 <para>When passed to the <command>list-jobs</command> command, for each printed job show which other jobs it
1630 is waiting for. May be combined with <option>--after</option> to show both the jobs waiting for each job as
1631 well as all jobs each job is waiting for.</para>
1632 </listitem>
1633 </varlistentry>
1634
1635 <varlistentry>
1636 <term><option>--with-dependencies</option></term>
1637
1638 <listitem>
1639 <para>When used with <command>status</command>,
1640 <command>cat</command>, <command>list-units</command>, and
1641 <command>list-unit-files</command>, those commands print all
1642 specified units and the dependencies of those units.</para>
1643
1644 <para>Options <option>--reverse</option>,
1645 <option>--after</option>, <option>--before</option>
1646 may be used to change what types of dependencies
1647 are shown.</para>
1648 </listitem>
1649 </varlistentry>
1650
1651 <varlistentry>
1652 <term><option>-l</option></term>
1653 <term><option>--full</option></term>
1654
1655 <listitem>
1656 <para>Do not ellipsize unit names, process tree entries,
1657 journal output, or truncate unit descriptions in the output
1658 of <command>status</command>, <command>list-units</command>,
1659 <command>list-jobs</command>, and
1660 <command>list-timers</command>.</para>
1661 <para>Also, show installation targets in the output of
1662 <command>is-enabled</command>.</para>
1663 </listitem>
1664 </varlistentry>
1665
1666 <varlistentry>
1667 <term><option>--value</option></term>
1668
1669 <listitem>
1670 <para>When printing properties with <command>show</command>, only print the value, and skip the
1671 property name and <literal>=</literal>. Also see option <option>-P</option> above.</para>
1672 </listitem>
1673 </varlistentry>
1674
1675 <varlistentry>
1676 <term><option>--show-types</option></term>
1677
1678 <listitem>
1679 <para>When showing sockets, show the type of the socket.</para>
1680 </listitem>
1681 </varlistentry>
1682
1683 <varlistentry>
1684 <term><option>--job-mode=</option></term>
1685
1686 <listitem>
1687 <para>When queuing a new job, this option controls how to deal with
1688 already queued jobs. It takes one of <literal>fail</literal>,
1689 <literal>replace</literal>,
1690 <literal>replace-irreversibly</literal>,
1691 <literal>isolate</literal>,
1692 <literal>ignore-dependencies</literal>,
1693 <literal>ignore-requirements</literal>,
1694 <literal>flush</literal>, or
1695 <literal>triggering</literal>. Defaults to
1696 <literal>replace</literal>, except when the
1697 <command>isolate</command> command is used which implies the
1698 <literal>isolate</literal> job mode.</para>
1699
1700 <para>If <literal>fail</literal> is specified and a requested
1701 operation conflicts with a pending job (more specifically:
1702 causes an already pending start job to be reversed into a stop
1703 job or vice versa), cause the operation to fail.</para>
1704
1705 <para>If <literal>replace</literal> (the default) is
1706 specified, any conflicting pending job will be replaced, as
1707 necessary.</para>
1708
1709 <para>If <literal>replace-irreversibly</literal> is specified,
1710 operate like <literal>replace</literal>, but also mark the new
1711 jobs as irreversible. This prevents future conflicting
1712 transactions from replacing these jobs (or even being enqueued
1713 while the irreversible jobs are still pending). Irreversible
1714 jobs can still be cancelled using the <command>cancel</command>
1715 command. This job mode should be used on any transaction which
1716 pulls in <filename>shutdown.target</filename>.</para>
1717
1718 <para><literal>isolate</literal> is only valid for start
1719 operations and causes all other units to be stopped when the
1720 specified unit is started. This mode is always used when the
1721 <command>isolate</command> command is used.</para>
1722
1723 <para><literal>flush</literal> will cause all queued jobs to
1724 be canceled when the new job is enqueued.</para>
1725
1726 <para>If <literal>ignore-dependencies</literal> is specified,
1727 then all unit dependencies are ignored for this new job and
1728 the operation is executed immediately. If passed, no required
1729 units of the unit passed will be pulled in, and no ordering
1730 dependencies will be honored. This is mostly a debugging and
1731 rescue tool for the administrator and should not be used by
1732 applications.</para>
1733
1734 <para><literal>ignore-requirements</literal> is similar to
1735 <literal>ignore-dependencies</literal>, but only causes the
1736 requirement dependencies to be ignored, the ordering
1737 dependencies will still be honored.</para>
1738 </listitem>
1739
1740 <para><literal>triggering</literal> may only be used with
1741 <command>systemctl stop</command>. In this mode, the specified
1742 unit and any active units that trigger it are stopped. See the
1743 discussion of
1744 <varname>Triggers=</varname> in <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1745 for more information about triggering units.</para>
1746
1747 </varlistentry>
1748
1749 <varlistentry>
1750 <term><option>-T</option></term>
1751 <term><option>--show-transaction</option></term>
1752
1753 <listitem>
1754 <para>When enqueuing a unit job (for example as effect of a <command>systemctl start</command>
1755 invocation or similar), show brief information about all jobs enqueued, covering both the requested
1756 job and any added because of unit dependencies. Note that the output will only include jobs
1757 immediately part of the transaction requested. It is possible that service start-up program code
1758 run as effect of the enqueued jobs might request further jobs to be pulled in. This means that
1759 completion of the listed jobs might ultimately entail more jobs than the listed ones.</para>
1760 </listitem>
1761 </varlistentry>
1762
1763 <varlistentry>
1764 <term><option>--fail</option></term>
1765
1766 <listitem>
1767 <para>Shorthand for <option>--job-mode=</option>fail.</para>
1768 <para>When used with the <command>kill</command> command,
1769 if no units were killed, the operation results in an error.
1770 </para>
1771 </listitem>
1772 </varlistentry>
1773
1774 <varlistentry>
1775 <term><option>-i</option></term>
1776 <term><option>--ignore-inhibitors</option></term>
1777
1778 <listitem>
1779 <para>When system shutdown or a sleep state is requested, ignore inhibitor locks. Applications can establish
1780 inhibitor locks to avoid that certain important operations (such as CD burning or suchlike) are interrupted
1781 by system shutdown or a sleep state. Any user may take these locks and privileged users may override these
1782 locks. If any locks are taken, shutdown and sleep state requests will normally fail (unless privileged) and a
1783 list of active locks is printed. However, if <option>--ignore-inhibitors</option> is specified, the
1784 established locks are ignored and not shown, and the operation attempted anyway, possibly requiring
1785 additional privileges.</para>
1786 </listitem>
1787 </varlistentry>
1788
1789 <varlistentry>
1790 <term><option>--dry-run</option></term>
1791
1792 <listitem>
1793 <para>Just print what would be done. Currently supported by verbs
1794 <command>halt</command>, <command>poweroff</command>, <command>reboot</command>,
1795 <command>kexec</command>, <command>suspend</command>, <command>hibernate</command>,
1796 <command>hybrid-sleep</command>, <command>suspend-then-hibernate</command>,
1797 <command>default</command>, <command>rescue</command>,
1798 <command>emergency</command>, and <command>exit</command>.</para>
1799 </listitem>
1800 </varlistentry>
1801
1802 <varlistentry>
1803 <term><option>-q</option></term>
1804 <term><option>--quiet</option></term>
1805
1806 <listitem>
1807 <para>Suppress printing of the results of various commands
1808 and also the hints about truncated log lines. This does not
1809 suppress output of commands for which the printed output is
1810 the only result (like <command>show</command>). Errors are
1811 always printed.</para>
1812 </listitem>
1813 </varlistentry>
1814
1815 <varlistentry>
1816 <term><option>--no-block</option></term>
1817
1818 <listitem>
1819 <para>Do not synchronously wait for the requested operation
1820 to finish. If this is not specified, the job will be
1821 verified, enqueued and <command>systemctl</command> will
1822 wait until the unit's start-up is completed. By passing this
1823 argument, it is only verified and enqueued. This option may not be
1824 combined with <option>--wait</option>.</para>
1825 </listitem>
1826 </varlistentry>
1827
1828 <varlistentry>
1829 <term><option>--wait</option></term>
1830
1831 <listitem>
1832 <para>Synchronously wait for started units to terminate again.
1833 This option may not be combined with <option>--no-block</option>.
1834 Note that this will wait forever if any given unit never terminates
1835 (by itself or by getting stopped explicitly); particularly services
1836 which use <literal>RemainAfterExit=yes</literal>.</para>
1837
1838 <para>When used with <command>is-system-running</command>, wait
1839 until the boot process is completed before returning.</para>
1840 </listitem>
1841 </varlistentry>
1842
1843 <xi:include href="user-system-options.xml" xpointer="user" />
1844 <xi:include href="user-system-options.xml" xpointer="system" />
1845
1846 <varlistentry>
1847 <term><option>--failed</option></term>
1848
1849 <listitem>
1850 <para>List units in failed state. This is equivalent to
1851 <option>--state=failed</option>.</para>
1852 </listitem>
1853 </varlistentry>
1854
1855 <varlistentry>
1856 <term><option>--no-wall</option></term>
1857
1858 <listitem>
1859 <para>Do not send wall message before halt, power-off and reboot.</para>
1860 </listitem>
1861 </varlistentry>
1862
1863 <varlistentry>
1864 <term><option>--global</option></term>
1865
1866 <listitem>
1867 <para>When used with <command>enable</command> and
1868 <command>disable</command>, operate on the global user
1869 configuration directory, thus enabling or disabling a unit
1870 file globally for all future logins of all users.</para>
1871 </listitem>
1872 </varlistentry>
1873
1874 <varlistentry>
1875 <term><option>--no-reload</option></term>
1876
1877 <listitem>
1878 <para>When used with <command>enable</command> and
1879 <command>disable</command>, do not implicitly reload daemon
1880 configuration after executing the changes.</para>
1881 </listitem>
1882 </varlistentry>
1883
1884 <varlistentry>
1885 <term><option>--no-ask-password</option></term>
1886
1887 <listitem>
1888 <para>When used with <command>start</command> and related
1889 commands, disables asking for passwords. Background services
1890 may require input of a password or passphrase string, for
1891 example to unlock system hard disks or cryptographic
1892 certificates. Unless this option is specified and the
1893 command is invoked from a terminal,
1894 <command>systemctl</command> will query the user on the
1895 terminal for the necessary secrets. Use this option to
1896 switch this behavior off. In this case, the password must be
1897 supplied by some other means (for example graphical password
1898 agents) or the service might fail. This also disables
1899 querying the user for authentication for privileged
1900 operations.</para>
1901 </listitem>
1902 </varlistentry>
1903
1904 <varlistentry>
1905 <term><option>--kill-who=</option></term>
1906
1907 <listitem>
1908 <para>When used with <command>kill</command>, choose which
1909 processes to send a signal to. Must be one of
1910 <option>main</option>, <option>control</option> or
1911 <option>all</option> to select whether to kill only the main
1912 process, the control process or all processes of the
1913 unit. The main process of the unit is the one that defines
1914 the life-time of it. A control process of a unit is one that
1915 is invoked by the manager to induce state changes of it. For
1916 example, all processes started due to the
1917 <varname>ExecStartPre=</varname>,
1918 <varname>ExecStop=</varname> or
1919 <varname>ExecReload=</varname> settings of service units are
1920 control processes. Note that there is only one control
1921 process per unit at a time, as only one state change is
1922 executed at a time. For services of type
1923 <varname>Type=forking</varname>, the initial process started
1924 by the manager for <varname>ExecStart=</varname> is a
1925 control process, while the process ultimately forked off by
1926 that one is then considered the main process of the unit (if
1927 it can be determined). This is different for service units
1928 of other types, where the process forked off by the manager
1929 for <varname>ExecStart=</varname> is always the main process
1930 itself. A service unit consists of zero or one main process,
1931 zero or one control process plus any number of additional
1932 processes. Not all unit types manage processes of these
1933 types however. For example, for mount units, control processes
1934 are defined (which are the invocations of
1935 <filename>&MOUNT_PATH;</filename> and
1936 <filename>&UMOUNT_PATH;</filename>), but no main process
1937 is defined. If omitted, defaults to
1938 <option>all</option>.</para>
1939 </listitem>
1940
1941 </varlistentry>
1942
1943 <varlistentry>
1944 <term><option>-s</option></term>
1945 <term><option>--signal=</option></term>
1946
1947 <listitem>
1948 <para>When used with <command>kill</command>, choose which
1949 signal to send to selected processes. Must be one of the
1950 well-known signal specifiers such as <constant>SIGTERM</constant>, <constant>SIGINT</constant> or
1951 <constant>SIGSTOP</constant>. If omitted, defaults to
1952 <option>SIGTERM</option>.</para>
1953 </listitem>
1954 </varlistentry>
1955
1956 <varlistentry>
1957 <term><option>--what=</option></term>
1958
1959 <listitem>
1960 <para>Select what type of per-unit resources to remove when the <command>clean</command> command is
1961 invoked, see below. Takes one of <constant>configuration</constant>, <constant>state</constant>,
1962 <constant>cache</constant>, <constant>logs</constant>, <constant>runtime</constant> to select the
1963 type of resource. This option may be specified more than once, in which case all specified resource
1964 types are removed. Also accepts the special value <constant>all</constant> as a shortcut for
1965 specifying all five resource types. If this option is not specified defaults to the combination of
1966 <constant>cache</constant> and <constant>runtime</constant>, i.e. the two kinds of resources that
1967 are generally considered to be redundant and can be reconstructed on next invocation.</para>
1968 </listitem>
1969 </varlistentry>
1970
1971 <varlistentry>
1972 <term><option>-f</option></term>
1973 <term><option>--force</option></term>
1974
1975 <listitem>
1976 <para>When used with <command>enable</command>, overwrite
1977 any existing conflicting symlinks.</para>
1978
1979 <para>When used with <command>edit</command>, create all of the
1980 specified units which do not already exist.</para>
1981
1982 <para>When used with <command>halt</command>, <command>poweroff</command>, <command>reboot</command> or
1983 <command>kexec</command>, execute the selected operation without shutting down all units. However, all
1984 processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a
1985 drastic but relatively safe option to request an immediate reboot. If <option>--force</option> is specified
1986 twice for these operations (with the exception of <command>kexec</command>), they will be executed
1987 immediately, without terminating any processes or unmounting any file systems. Warning: specifying
1988 <option>--force</option> twice with any of these operations might result in data loss. Note that when
1989 <option>--force</option> is specified twice the selected operation is executed by
1990 <command>systemctl</command> itself, and the system manager is not contacted. This means the command should
1991 succeed even when the system manager has crashed.</para>
1992 </listitem>
1993 </varlistentry>
1994
1995 <varlistentry>
1996 <term><option>--message=</option></term>
1997
1998 <listitem>
1999 <para>When used with <command>halt</command>, <command>poweroff</command> or <command>reboot</command>, set a
2000 short message explaining the reason for the operation. The message will be logged together with the default
2001 shutdown message.</para>
2002 </listitem>
2003 </varlistentry>
2004
2005 <varlistentry>
2006 <term><option>--now</option></term>
2007
2008 <listitem>
2009 <para>When used with <command>enable</command>, the units
2010 will also be started. When used with <command>disable</command> or
2011 <command>mask</command>, the units will also be stopped. The start
2012 or stop operation is only carried out when the respective enable or
2013 disable operation has been successful.</para>
2014 </listitem>
2015 </varlistentry>
2016
2017 <varlistentry>
2018 <term><option>--root=</option></term>
2019
2020 <listitem>
2021 <para>When used with
2022 <command>enable</command>/<command>disable</command>/<command>is-enabled</command>
2023 (and related commands), use the specified root path when looking for unit
2024 files. If this option is present, <command>systemctl</command> will operate on
2025 the file system directly, instead of communicating with the <command>systemd</command>
2026 daemon to carry out changes.</para>
2027 </listitem>
2028
2029 </varlistentry>
2030
2031 <varlistentry>
2032 <term><option>--runtime</option></term>
2033
2034 <listitem>
2035 <para>When used with <command>enable</command>,
2036 <command>disable</command>, <command>edit</command>,
2037 (and related commands), make changes only temporarily, so
2038 that they are lost on the next reboot. This will have the
2039 effect that changes are not made in subdirectories of
2040 <filename>/etc</filename> but in <filename>/run</filename>,
2041 with identical immediate effects, however, since the latter
2042 is lost on reboot, the changes are lost too.</para>
2043
2044 <para>Similarly, when used with
2045 <command>set-property</command>, make changes only
2046 temporarily, so that they are lost on the next
2047 reboot.</para>
2048 </listitem>
2049 </varlistentry>
2050
2051 <varlistentry>
2052 <term><option>--preset-mode=</option></term>
2053
2054 <listitem>
2055 <para>Takes one of <literal>full</literal> (the default),
2056 <literal>enable-only</literal>,
2057 <literal>disable-only</literal>. When used with the
2058 <command>preset</command> or <command>preset-all</command>
2059 commands, controls whether units shall be disabled and
2060 enabled according to the preset rules, or only enabled, or
2061 only disabled.</para>
2062 </listitem>
2063 </varlistentry>
2064
2065 <varlistentry>
2066 <term><option>-n</option></term>
2067 <term><option>--lines=</option></term>
2068
2069 <listitem>
2070 <para>When used with <command>status</command>, controls the number of journal lines to show, counting from
2071 the most recent ones. Takes a positive integer argument, or 0 to disable journal output. Defaults to
2072 10.</para>
2073 </listitem>
2074 </varlistentry>
2075
2076 <varlistentry>
2077 <term><option>-o</option></term>
2078 <term><option>--output=</option></term>
2079
2080 <listitem>
2081 <para>When used with <command>status</command>, controls the
2082 formatting of the journal entries that are shown. For the
2083 available choices, see
2084 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
2085 Defaults to <literal>short</literal>.</para>
2086 </listitem>
2087 </varlistentry>
2088
2089 <varlistentry>
2090 <term><option>--firmware-setup</option></term>
2091
2092 <listitem>
2093 <para>When used with the <command>reboot</command> command, indicate to the system's firmware to reboot into
2094 the firmware setup interface. Note that this functionality is not available on all systems.</para>
2095 </listitem>
2096 </varlistentry>
2097
2098 <varlistentry>
2099 <term><option>--boot-loader-menu=</option></term>
2100
2101 <listitem>
2102 <para>When used with the <command>reboot</command> command, indicate to the system's boot loader to show the
2103 boot loader menu on the following boot. Takes a time value as parameter — indicating the menu timeout. Pass
2104 zero in order to disable the menu timeout. Note that not all boot loaders support this
2105 functionality.</para>
2106 </listitem>
2107 </varlistentry>
2108
2109 <varlistentry>
2110 <term><option>--boot-loader-entry=</option></term>
2111
2112 <listitem>
2113 <para>When used with the <command>reboot</command> command, indicate to the system's boot loader to boot into
2114 a specific boot loader entry on the following boot. Takes a boot loader entry identifier as argument, or
2115 <literal>help</literal> in order to list available entries. Note that not all boot loaders support this
2116 functionality.</para>
2117 </listitem>
2118 </varlistentry>
2119
2120 <varlistentry>
2121 <term><option>--plain</option></term>
2122
2123 <listitem>
2124 <para>When used with <command>list-dependencies</command>,
2125 <command>list-units</command> or <command>list-machines</command>,
2126 the output is printed as a list instead of a tree, and the bullet
2127 circles are omitted.</para>
2128 </listitem>
2129 </varlistentry>
2130
2131 <xi:include href="user-system-options.xml" xpointer="host" />
2132 <xi:include href="user-system-options.xml" xpointer="machine" />
2133
2134 <xi:include href="standard-options.xml" xpointer="no-pager" />
2135 <xi:include href="standard-options.xml" xpointer="no-legend" />
2136 <xi:include href="standard-options.xml" xpointer="help" />
2137 <xi:include href="standard-options.xml" xpointer="version" />
2138 </variablelist>
2139 </refsect1>
2140
2141 <refsect1>
2142 <title>Exit status</title>
2143
2144 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
2145
2146 <para><command>systemctl</command> uses the return codes defined by LSB, as defined in
2147 <ulink url="http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html">LSB 3.0.0</ulink>.
2148 </para>
2149
2150 <table>
2151 <title>LSB return codes</title>
2152
2153 <tgroup cols='3'>
2154 <thead>
2155 <row>
2156 <entry>Value</entry>
2157 <entry>Description in LSB</entry>
2158 <entry>Use in systemd</entry>
2159 </row>
2160 </thead>
2161 <tbody>
2162 <row>
2163 <entry><constant>0</constant></entry>
2164 <entry>"program is running or service is OK"</entry>
2165 <entry>unit is active</entry>
2166 </row>
2167 <row>
2168 <entry><constant>1</constant></entry>
2169 <entry>"program is dead and <filename>/var/run</filename> pid file exists"</entry>
2170 <entry>unit <emphasis>not</emphasis> failed (used by <command>is-failed</command>)</entry>
2171 </row>
2172 <row>
2173 <entry><constant>2</constant></entry>
2174 <entry>"program is dead and <filename>/var/lock</filename> lock file exists"</entry>
2175 <entry>unused</entry>
2176 </row>
2177 <row>
2178 <entry><constant>3</constant></entry>
2179 <entry>"program is not running"</entry>
2180 <entry>unit is not active</entry>
2181 </row>
2182 <row>
2183 <entry><constant>4</constant></entry>
2184 <entry>"program or service status is unknown"</entry>
2185 <entry>no such unit</entry>
2186 </row>
2187 </tbody>
2188 </tgroup>
2189 </table>
2190
2191 <para>The mapping of LSB service states to systemd unit states is imperfect, so it is better to
2192 not rely on those return values but to look for specific unit states and substates instead.
2193 </para>
2194 </refsect1>
2195
2196 <refsect1>
2197 <title>Environment</title>
2198
2199 <variablelist class='environment-variables'>
2200 <varlistentry>
2201 <term><varname>$SYSTEMD_EDITOR</varname></term>
2202
2203 <listitem><para>Editor to use when editing units; overrides
2204 <varname>$EDITOR</varname> and <varname>$VISUAL</varname>. If neither
2205 <varname>$SYSTEMD_EDITOR</varname> nor <varname>$EDITOR</varname> nor
2206 <varname>$VISUAL</varname> are present or if it is set to an empty
2207 string or if their execution failed, systemctl will try to execute well
2208 known editors in this order:
2209 <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2210 <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2211 <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2212 <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
2213 </para></listitem>
2214 </varlistentry>
2215 </variablelist>
2216 <xi:include href="less-variables.xml" xpointer="pager"/>
2217 <xi:include href="less-variables.xml" xpointer="less"/>
2218 <xi:include href="less-variables.xml" xpointer="lesscharset"/>
2219 <xi:include href="less-variables.xml" xpointer="colors"/>
2220 <xi:include href="less-variables.xml" xpointer="urlify"/>
2221 </refsect1>
2222
2223 <refsect1>
2224 <title>See Also</title>
2225 <para>
2226 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2227 <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2228 <citerefentry><refentrytitle>loginctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2229 <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2230 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
2231 <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
2232 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
2233 <citerefentry project='man-pages'><refentrytitle>wall</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
2234 <citerefentry><refentrytitle>systemd.preset</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
2235 <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
2236 <citerefentry project='man-pages'><refentrytitle>glob</refentrytitle><manvolnum>7</manvolnum></citerefentry>
2237 </para>
2238 </refsect1>
2239
2240 </refentry>