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