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