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