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