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