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