2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM
"custom-entities.ent" >
9 SPDX-License-Identifier: LGPL-2.1+
12 <refentry id=
"systemctl"
13 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
16 <title>systemctl
</title>
17 <productname>systemd
</productname>
21 <refentrytitle>systemctl
</refentrytitle>
22 <manvolnum>1</manvolnum>
26 <refname>systemctl
</refname>
27 <refpurpose>Control the systemd system and service manager
</refpurpose>
32 <command>systemctl
</command>
33 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
34 <arg choice=
"plain">COMMAND
</arg>
35 <arg choice=
"opt" rep=
"repeat">UNIT
</arg>
40 <title>Description
</title>
42 <para><command>systemctl
</command> may be used to introspect and
43 control the state of the
<literal>systemd
</literal> system and
44 service manager. Please refer to
45 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
46 for an introduction into the basic concepts and functionality this
51 <title>Options
</title>
53 <para>The following options are understood:
</para>
57 <term><option>-t
</option></term>
58 <term><option>--type=
</option></term>
61 <para>The argument should be a comma-separated list of unit
62 types such as
<option>service
</option> and
63 <option>socket
</option>.
66 <para>If one of the arguments is a unit type, when listing
67 units, limit display to certain unit types. Otherwise, units
68 of all types will be shown.
</para>
70 <para>As a special case, if one of the arguments is
71 <option>help
</option>, a list of allowed values will be
72 printed and the program will exit.
</para>
77 <term><option>--state=
</option></term>
80 <para>The argument should be a comma-separated list of unit
81 LOAD, SUB, or ACTIVE states. When listing units, show only
82 those in the specified states. Use
<option>--state=failed
</option>
83 to show only failed units.
</para>
85 <para>As a special case, if one of the arguments is
86 <option>help
</option>, a list of allowed values will be
87 printed and the program will exit.
</para>
92 <term><option>-p
</option></term>
93 <term><option>--property=
</option></term>
96 <para>When showing unit/job/manager properties with the
97 <command>show
</command> command, limit display to properties
98 specified in the argument. The argument should be a
99 comma-separated list of property names, such as
100 <literal>MainPID
</literal>. Unless specified, all known
101 properties are shown. If specified more than once, all
102 properties with the specified names are shown. Shell
103 completion is implemented for property names.
</para>
105 <para>For the manager itself,
106 <command>systemctl show
</command> will show all available
107 properties. Those properties are documented in
108 <citerefentry><refentrytitle>systemd-system.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
111 <para>Properties for units vary by unit type, so showing any
112 unit (even a non-existent one) is a way to list properties
113 pertaining to this type. Similarly, showing any job will list
114 properties pertaining to all jobs. Properties for units are
116 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
117 and the pages for individual unit types
118 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
119 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
125 <term><option>-a
</option></term>
126 <term><option>--all
</option></term>
129 <para>When listing units with
<command>list-units
</command>, also show inactive units and
130 units which are following other units. When showing unit/job/manager properties, show all
131 properties regardless whether they are set or not.
</para>
133 <para>To list all units installed in the file system, use the
134 <command>list-unit-files
</command> command instead.
</para>
136 <para>When listing units with
<command>list-dependencies
</command>, recursively show
137 dependencies of all dependent units (by default only dependencies of target units are
143 <term><option>-r
</option></term>
144 <term><option>--recursive
</option></term>
147 <para>When listing units, also show units of local
148 containers. Units of local containers will be prefixed with
149 the container name, separated by a single colon character
150 (
<literal>:
</literal>).
</para>
155 <term><option>--reverse
</option></term>
158 <para>Show reverse dependencies between units with
159 <command>list-dependencies
</command>, i.e. follow
160 dependencies of type
<varname>WantedBy=
</varname>,
161 <varname>RequiredBy=
</varname>,
162 <varname>PartOf=
</varname>,
<varname>BoundBy=
</varname>,
163 instead of
<varname>Wants=
</varname> and similar.
169 <term><option>--after
</option></term>
172 <para>With
<command>list-dependencies
</command>, show the
173 units that are ordered before the specified unit. In other
174 words, recursively list units following the
175 <varname>After=
</varname> dependency.
</para>
177 <para>Note that any
<varname>After=
</varname> dependency is
178 automatically mirrored to create a
179 <varname>Before=
</varname> dependency. Temporal dependencies
180 may be specified explicitly, but are also created implicitly
181 for units which are
<varname>WantedBy=
</varname> targets
183 <citerefentry><refentrytitle>systemd.target
</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
184 and as a result of other directives (for example
185 <varname>RequiresMountsFor=
</varname>). Both explicitly
186 and implicitly introduced dependencies are shown with
187 <command>list-dependencies
</command>.
</para>
189 <para>When passed to the
<command>list-jobs
</command> command, for each printed job show which other jobs are
190 waiting for it. May be combined with
<option>--before
</option> to show both the jobs waiting for each job as
191 well as all jobs each job is waiting for.
</para>
196 <term><option>--before
</option></term>
199 <para>With
<command>list-dependencies
</command>, show the
200 units that are ordered after the specified unit. In other
201 words, recursively list units following the
202 <varname>Before=
</varname> dependency.
</para>
204 <para>When passed to the
<command>list-jobs
</command> command, for each printed job show which other jobs it
205 is waiting for. May be combined with
<option>--after
</option> to show both the jobs waiting for each job as
206 well as all jobs each job is waiting for.
</para>
211 <term><option>-l
</option></term>
212 <term><option>--full
</option></term>
215 <para>Do not ellipsize unit names, process tree entries,
216 journal output, or truncate unit descriptions in the output
217 of
<command>status
</command>,
<command>list-units
</command>,
218 <command>list-jobs
</command>, and
219 <command>list-timers
</command>.
</para>
220 <para>Also, show installation targets in the output of
221 <command>is-enabled
</command>.
</para>
226 <term><option>--value
</option></term>
229 <para>When printing properties with
<command>show
</command>,
230 only print the value, and skip the property name and
231 <literal>=
</literal>.
</para>
236 <term><option>--show-types
</option></term>
239 <para>When showing sockets, show the type of the socket.
</para>
244 <term><option>--job-mode=
</option></term>
247 <para>When queuing a new job, this option controls how to deal with
248 already queued jobs. It takes one of
<literal>fail
</literal>,
249 <literal>replace
</literal>,
250 <literal>replace-irreversibly
</literal>,
251 <literal>isolate
</literal>,
252 <literal>ignore-dependencies
</literal>,
253 <literal>ignore-requirements
</literal> or
254 <literal>flush
</literal>. Defaults to
255 <literal>replace
</literal>, except when the
256 <command>isolate
</command> command is used which implies the
257 <literal>isolate
</literal> job mode.
</para>
259 <para>If
<literal>fail
</literal> is specified and a requested
260 operation conflicts with a pending job (more specifically:
261 causes an already pending start job to be reversed into a stop
262 job or vice versa), cause the operation to fail.
</para>
264 <para>If
<literal>replace
</literal> (the default) is
265 specified, any conflicting pending job will be replaced, as
268 <para>If
<literal>replace-irreversibly
</literal> is specified,
269 operate like
<literal>replace
</literal>, but also mark the new
270 jobs as irreversible. This prevents future conflicting
271 transactions from replacing these jobs (or even being enqueued
272 while the irreversible jobs are still pending). Irreversible
273 jobs can still be cancelled using the
<command>cancel
</command>
274 command. This job mode should be used on any transaction which
275 pulls in
<filename>shutdown.target
</filename>.
</para>
277 <para><literal>isolate
</literal> is only valid for start
278 operations and causes all other units to be stopped when the
279 specified unit is started. This mode is always used when the
280 <command>isolate
</command> command is used.
</para>
282 <para><literal>flush
</literal> will cause all queued jobs to
283 be canceled when the new job is enqueued.
</para>
285 <para>If
<literal>ignore-dependencies
</literal> is specified,
286 then all unit dependencies are ignored for this new job and
287 the operation is executed immediately. If passed, no required
288 units of the unit passed will be pulled in, and no ordering
289 dependencies will be honored. This is mostly a debugging and
290 rescue tool for the administrator and should not be used by
293 <para><literal>ignore-requirements
</literal> is similar to
294 <literal>ignore-dependencies
</literal>, but only causes the
295 requirement dependencies to be ignored, the ordering
296 dependencies will still be honored.
</para>
302 <term><option>--fail
</option></term>
305 <para>Shorthand for
<option>--job-mode=
</option>fail.
</para>
306 <para>When used with the
<command>kill
</command> command,
307 if no units were killed, the operation results in an error.
313 <term><option>-i
</option></term>
314 <term><option>--ignore-inhibitors
</option></term>
317 <para>When system shutdown or a sleep state is requested, ignore inhibitor locks. Applications can establish
318 inhibitor locks to avoid that certain important operations (such as CD burning or suchlike) are interrupted
319 by system shutdown or a sleep state. Any user may take these locks and privileged users may override these
320 locks. If any locks are taken, shutdown and sleep state requests will normally fail (unless privileged) and a
321 list of active locks is printed. However, if
<option>--ignore-inhibitors
</option> is specified, the
322 established locks are ignored and not shown, and the operation attempted anyway, possibly requiring
323 additional privileges.
</para>
328 <term><option>--dry-run
</option></term>
331 <para>Just print what would be done. Currently supported by verbs
332 <command>halt
</command>,
<command>poweroff
</command>,
<command>reboot
</command>,
333 <command>kexec
</command>,
<command>suspend
</command>,
334 <command>hibernate
</command>,
<command>hybrid-sleep
</command>,
335 <command>default
</command>,
<command>rescue
</command>,
336 <command>emergency
</command>, and
<command>exit
</command>.
</para>
341 <term><option>-q
</option></term>
342 <term><option>--quiet
</option></term>
345 <para>Suppress printing of the results of various commands
346 and also the hints about truncated log lines. This does not
347 suppress output of commands for which the printed output is
348 the only result (like
<command>show
</command>). Errors are
349 always printed.
</para>
354 <term><option>--no-block
</option></term>
357 <para>Do not synchronously wait for the requested operation
358 to finish. If this is not specified, the job will be
359 verified, enqueued and
<command>systemctl
</command> will
360 wait until the unit's start-up is completed. By passing this
361 argument, it is only verified and enqueued. This option may not be
362 combined with
<option>--wait
</option>.
</para>
367 <term><option>--wait
</option></term>
370 <para>Synchronously wait for started units to terminate again.
371 This option may not be combined with
<option>--no-block
</option>.
372 Note that this will wait forever if any given unit never terminates
373 (by itself or by getting stopped explicitly); particularly services
374 which use
<literal>RemainAfterExit=yes
</literal>.
</para>
376 <para>When used with
<command>is-system-running
</command>, wait
377 until the boot process is completed before returning.
</para>
381 <xi:include href=
"user-system-options.xml" xpointer=
"user" />
382 <xi:include href=
"user-system-options.xml" xpointer=
"system" />
385 <term><option>--failed
</option></term>
388 <para>List units in failed state. This is equivalent to
389 <option>--state=failed
</option>.
</para>
394 <term><option>--no-wall
</option></term>
397 <para>Do not send wall message before halt, power-off and reboot.
</para>
402 <term><option>--global
</option></term>
405 <para>When used with
<command>enable
</command> and
406 <command>disable
</command>, operate on the global user
407 configuration directory, thus enabling or disabling a unit
408 file globally for all future logins of all users.
</para>
413 <term><option>--no-reload
</option></term>
416 <para>When used with
<command>enable
</command> and
417 <command>disable
</command>, do not implicitly reload daemon
418 configuration after executing the changes.
</para>
423 <term><option>--no-ask-password
</option></term>
426 <para>When used with
<command>start
</command> and related
427 commands, disables asking for passwords. Background services
428 may require input of a password or passphrase string, for
429 example to unlock system hard disks or cryptographic
430 certificates. Unless this option is specified and the
431 command is invoked from a terminal,
432 <command>systemctl
</command> will query the user on the
433 terminal for the necessary secrets. Use this option to
434 switch this behavior off. In this case, the password must be
435 supplied by some other means (for example graphical password
436 agents) or the service might fail. This also disables
437 querying the user for authentication for privileged
443 <term><option>--kill-who=
</option></term>
446 <para>When used with
<command>kill
</command>, choose which
447 processes to send a signal to. Must be one of
448 <option>main
</option>,
<option>control
</option> or
449 <option>all
</option> to select whether to kill only the main
450 process, the control process or all processes of the
451 unit. The main process of the unit is the one that defines
452 the life-time of it. A control process of a unit is one that
453 is invoked by the manager to induce state changes of it. For
454 example, all processes started due to the
455 <varname>ExecStartPre=
</varname>,
456 <varname>ExecStop=
</varname> or
457 <varname>ExecReload=
</varname> settings of service units are
458 control processes. Note that there is only one control
459 process per unit at a time, as only one state change is
460 executed at a time. For services of type
461 <varname>Type=forking
</varname>, the initial process started
462 by the manager for
<varname>ExecStart=
</varname> is a
463 control process, while the process ultimately forked off by
464 that one is then considered the main process of the unit (if
465 it can be determined). This is different for service units
466 of other types, where the process forked off by the manager
467 for
<varname>ExecStart=
</varname> is always the main process
468 itself. A service unit consists of zero or one main process,
469 zero or one control process plus any number of additional
470 processes. Not all unit types manage processes of these
471 types however. For example, for mount units, control processes
472 are defined (which are the invocations of
473 <filename>&MOUNT_PATH;</filename> and
474 <filename>&UMOUNT_PATH;</filename>), but no main process
475 is defined. If omitted, defaults to
476 <option>all
</option>.
</para>
482 <term><option>-s
</option></term>
483 <term><option>--signal=
</option></term>
486 <para>When used with
<command>kill
</command>, choose which
487 signal to send to selected processes. Must be one of the
488 well-known signal specifiers such as
<constant>SIGTERM
</constant>,
<constant>SIGINT
</constant> or
489 <constant>SIGSTOP
</constant>. If omitted, defaults to
490 <option>SIGTERM
</option>.
</para>
495 <term><option>-f
</option></term>
496 <term><option>--force
</option></term>
499 <para>When used with
<command>enable
</command>, overwrite
500 any existing conflicting symlinks.
</para>
502 <para>When used with
<command>edit
</command>, create all of the
503 specified units which do not already exist.
</para>
505 <para>When used with
<command>halt
</command>,
<command>poweroff
</command>,
<command>reboot
</command> or
506 <command>kexec
</command>, execute the selected operation without shutting down all units. However, all
507 processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a
508 drastic but relatively safe option to request an immediate reboot. If
<option>--force
</option> is specified
509 twice for these operations (with the exception of
<command>kexec
</command>), they will be executed
510 immediately, without terminating any processes or unmounting any file systems. Warning: specifying
511 <option>--force
</option> twice with any of these operations might result in data loss. Note that when
512 <option>--force
</option> is specified twice the selected operation is executed by
513 <command>systemctl
</command> itself, and the system manager is not contacted. This means the command should
514 succeed even when the system manager has crashed.
</para>
519 <term><option>--message=
</option></term>
522 <para>When used with
<command>halt
</command>,
<command>poweroff
</command> or
<command>reboot
</command>, set a
523 short message explaining the reason for the operation. The message will be logged together with the default
524 shutdown message.
</para>
529 <term><option>--now
</option></term>
532 <para>When used with
<command>enable
</command>, the units
533 will also be started. When used with
<command>disable
</command> or
534 <command>mask
</command>, the units will also be stopped. The start
535 or stop operation is only carried out when the respective enable or
536 disable operation has been successful.
</para>
541 <term><option>--root=
</option></term>
545 <command>enable
</command>/
<command>disable
</command>/
<command>is-enabled
</command>
546 (and related commands), use the specified root path when looking for unit
547 files. If this option is present,
<command>systemctl
</command> will operate on
548 the file system directly, instead of communicating with the
<command>systemd
</command>
549 daemon to carry out changes.
</para>
555 <term><option>--runtime
</option></term>
558 <para>When used with
<command>set-property
</command>, make changes only
559 temporarily, so that they are lost on the next reboot.
</para>
561 <para>Similarily, when used with
<command>enable
</command>,
<command>mask
</command>,
562 <command>edit
</command> and related commands, make temporary changes, which are lost on
563 the next reboot. Changes are not made in subdirectories of
<filename>/etc
</filename>, but
564 in
<filename>/run
</filename>. The immediate effect is identical, however since the latter
565 is lost on reboot, the changes are lost too.
</para>
567 <para>Note: this option cannot be used with
<command>disable
</command>,
568 <command>unmask
</command>,
<command>preset
</command>, or
<command>preset-all
</command>,
569 because those operations sometimes need to remove symlinks under
<filename>/etc
</filename>
570 to have the desired effect, which would cause a persistent change.
</para>
575 <term><option>--preset-mode=
</option></term>
578 <para>Takes one of
<literal>full
</literal> (the default),
579 <literal>enable-only
</literal>,
580 <literal>disable-only
</literal>. When used with the
581 <command>preset
</command> or
<command>preset-all
</command>
582 commands, controls whether units shall be disabled and
583 enabled according to the preset rules, or only enabled, or
584 only disabled.
</para>
589 <term><option>-n
</option></term>
590 <term><option>--lines=
</option></term>
593 <para>When used with
<command>status
</command>, controls the
594 number of journal lines to show, counting from the most
595 recent ones. Takes a positive integer argument. Defaults to
601 <term><option>-o
</option></term>
602 <term><option>--output=
</option></term>
605 <para>When used with
<command>status
</command>, controls the
606 formatting of the journal entries that are shown. For the
607 available choices, see
608 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
609 Defaults to
<literal>short
</literal>.
</para>
614 <term><option>--firmware-setup
</option></term>
617 <para>When used with the
<command>reboot
</command> command,
618 indicate to the system's firmware to boot into setup
619 mode. Note that this is currently only supported on some EFI
620 systems and only if the system was booted in EFI
626 <term><option>--plain
</option></term>
629 <para>When used with
<command>list-dependencies
</command>,
630 <command>list-units
</command> or
<command>list-machines
</command>,
631 the output is printed as a list instead of a tree, and the bullet
632 circles are omitted.
</para>
636 <xi:include href=
"user-system-options.xml" xpointer=
"host" />
637 <xi:include href=
"user-system-options.xml" xpointer=
"machine" />
639 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
640 <xi:include href=
"standard-options.xml" xpointer=
"no-legend" />
641 <xi:include href=
"standard-options.xml" xpointer=
"help" />
642 <xi:include href=
"standard-options.xml" xpointer=
"version" />
647 <title>Commands
</title>
649 <para>The following commands are understood:
</para>
652 <title>Unit Commands
</title>
656 <term><command>list-units
</command> <optional><replaceable>PATTERN
</replaceable>…
</optional></term>
659 <para>List units that
<command>systemd
</command> currently has in memory. This includes units that are
660 either referenced directly or through a dependency, units that are pinned by applications programmatically,
661 or units that were active in the past and have failed. By default only units which are active, have pending
662 jobs, or have failed are shown; this can be changed with option
<option>--all
</option>. If one or more
663 <replaceable>PATTERN
</replaceable>s are specified, only units matching one of them are shown. The units
664 that are shown are additionally filtered by
<option>--type=
</option> and
<option>--state=
</option> if those
665 options are specified.
</para>
667 <para>Produces output similar to
668 <programlisting> UNIT LOAD ACTIVE SUB DESCRIPTION
669 sys-module-fuse.device loaded active plugged /sys/module/fuse
670 -.mount loaded active mounted Root Mount
671 boot-efi.mount loaded active mounted /boot/efi
672 systemd-journald.service loaded active running Journal Service
673 systemd-logind.service loaded active running Login Service
674 â—Ź user@
1000.service loaded failed failed User Manager for UID
1000
676 systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
678 LOAD = Reflects whether the unit definition was properly loaded.
679 ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
680 SUB = The low-level unit activation state, values depend on unit type.
682 123 loaded units listed. Pass --all to see loaded but inactive units, too.
683 To show all installed unit files use 'systemctl list-unit-files'.
685 The header and the last unit of a given type are underlined if the
686 terminal supports that. A colored dot is shown next to services which
687 were masked, not found, or otherwise failed.
</para>
689 <para>The LOAD column shows the load state, one of
<constant>loaded
</constant>,
690 <constant>not-found
</constant>,
<constant>bad-setting
</constant>,
<constant>error
</constant>,
691 <constant>masked
</constant>. The ACTIVE columns shows the general unit state, one of
692 <constant>active
</constant>,
<constant>reloading
</constant>,
<constant>inactive
</constant>,
693 <constant>failed
</constant>,
<constant>activating
</constant>,
<constant>deactivating
</constant>. The SUB
694 column shows the unit-type-specific detailed state of the unit, possible values vary by unit type. The list
695 of possible LOAD, ACTIVE, and SUB states is not constant and new systemd releases may both add and remove
696 values.
<programlisting>systemctl --state=help
</programlisting> command maybe be used to display the
697 current set of possible values.
</para>
699 <para>This is the default command.
</para>
704 <term><command>list-sockets
</command> <optional><replaceable>PATTERN
</replaceable>…
</optional></term>
707 <para>List socket units currently in memory, ordered by listening address. If one or more
708 <replaceable>PATTERN
</replaceable>s are specified, only socket units matching one of them are
709 shown. Produces output similar to
711 LISTEN UNIT ACTIVATES
712 /dev/initctl systemd-initctl.socket systemd-initctl.service
714 [::]:
22 sshd.socket sshd.service
715 kobject-uevent
1 systemd-udevd-kernel.socket systemd-udevd.service
717 5 sockets listed.
</programlisting>
718 Note: because the addresses might contains spaces, this output
719 is not suitable for programmatic consumption.
722 <para>Also see
<option>--show-types
</option>,
<option>--all
</option>, and
<option>--state=
</option>.
</para>
727 <term><command>list-timers
</command> <optional><replaceable>PATTERN
</replaceable>…
</optional></term>
730 <para>List timer units currently in memory, ordered by the time they elapse next. If one or more
731 <replaceable>PATTERN
</replaceable>s are specified, only units matching one of them are shown.
732 Produces output similar to
734 NEXT LEFT LAST PASSED UNIT ACTIVATES
735 n/a n/a Thu
2017-
02-
23 13:
40:
29 EST
3 days ago ureadahead-stop.timer ureadahead-stop.service
736 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
737 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
738 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
742 <para><emphasis>NEXT
</emphasis> shows the next time the timer will run.
</para>
743 <para><emphasis>LEFT
</emphasis> shows how long till the next time the timer runs.
</para>
744 <para><emphasis>LAST
</emphasis> shows the last time the timer ran.
</para>
745 <para><emphasis>PASSED
</emphasis> shows how long has passed since the timer last ran.
</para>
746 <para><emphasis>UNIT
</emphasis> shows the name of the timer
</para>
747 <para><emphasis>ACTIVATES
</emphasis> shows the name the service the timer activates when it runs.
</para>
749 <para>Also see
<option>--all
</option> and
<option>--state=
</option>.
</para>
754 <term><command>start
<replaceable>PATTERN
</replaceable>…
</command></term>
757 <para>Start (activate) one or more units specified on the
760 <para>Note that glob patterns operate on the set of primary names of units currently in memory. Units which
761 are not active and are not in a failed state usually are not in memory, and will not be matched by any
762 pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until
763 the instance has been started. Therefore, using glob patterns with
<command>start
</command> has limited
764 usefulness. Also, secondary alias names of units are not considered.
</para>
768 <term><command>stop
<replaceable>PATTERN
</replaceable>…
</command></term>
771 <para>Stop (deactivate) one or more units specified on the
776 <term><command>reload
<replaceable>PATTERN
</replaceable>…
</command></term>
779 <para>Asks all units listed on the command line to reload
780 their configuration. Note that this will reload the
781 service-specific configuration, not the unit configuration
782 file of systemd. If you want systemd to reload the
783 configuration file of a unit, use the
784 <command>daemon-reload
</command> command. In other words:
785 for the example case of Apache, this will reload Apache's
786 <filename>httpd.conf
</filename> in the web server, not the
787 <filename>apache.service
</filename> systemd unit
790 <para>This command should not be confused with the
791 <command>daemon-reload
</command> command.
</para>
796 <term><command>restart
<replaceable>PATTERN
</replaceable>…
</command></term>
799 <para>Stop and then start one or more units specified on the command line. If the units are not running
800 yet, they will be started.
</para>
802 <para>Note that restarting a unit with this command does not necessarily flush out all of the unit's
803 resources before it is started again. For example, the per-service file descriptor storage facility (see
804 <varname>FileDescriptoreStoreMax=
</varname> in
805 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>) will
806 remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and
807 no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a
808 restart operation an explicit
<command>systemctl stop
</command> command followed by
<command>systemctl
809 start
</command> should be issued.
</para>
813 <term><command>try-restart
<replaceable>PATTERN
</replaceable>…
</command></term>
816 <para>Stop and then start one or more units specified on the
817 command line if the units are running. This does nothing
818 if units are not running.
</para>
819 <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally
820 don't document that. -->
824 <term><command>reload-or-restart
<replaceable>PATTERN
</replaceable>…
</command></term>
827 <para>Reload one or more units if they support it. If not, stop and then start them instead. If the units
828 are not running yet, they will be started.
</para>
832 <term><command>try-reload-or-restart
<replaceable>PATTERN
</replaceable>…
</command></term>
835 <para>Reload one or more units if they support it. If not, stop and then start them instead. This does
836 nothing if the units are not running.
</para>
837 <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
838 don't document that. -->
842 <term><command>isolate
<replaceable>UNIT
</replaceable></command></term>
845 <para>Start the unit specified on the command line and its dependencies
846 and stop all others, unless they have
847 <option>IgnoreOnIsolate=yes
</option> (see
848 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
849 If a unit name with no extension is given, an extension of
850 <literal>.target
</literal> will be assumed.
</para>
852 <para>This is similar to changing the runlevel in a
853 traditional init system. The
<command>isolate
</command>
854 command will immediately stop processes that are not enabled
855 in the new unit, possibly including the graphical
856 environment or terminal you are currently using.
</para>
858 <para>Note that this is allowed only on units where
859 <option>AllowIsolate=
</option> is enabled. See
860 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
865 <term><command>kill
<replaceable>PATTERN
</replaceable>…
</command></term>
868 <para>Send a signal to one or more processes of the
869 unit. Use
<option>--kill-who=
</option> to select which
870 process to kill. Use
<option>--signal=
</option> to select
871 the signal to send.
</para>
875 <term><command>is-active
<replaceable>PATTERN
</replaceable>…
</command></term>
878 <para>Check whether any of the specified units are active
879 (i.e. running). Returns an exit code
880 <constant>0</constant> if at least one is active, or
881 non-zero otherwise. Unless
<option>--quiet
</option> is
882 specified, this will also print the current unit state to
883 standard output.
</para>
887 <term><command>is-failed
<replaceable>PATTERN
</replaceable>…
</command></term>
890 <para>Check whether any of the specified units are in a
891 "failed" state. Returns an exit code
892 <constant>0</constant> if at least one has failed,
893 non-zero otherwise. Unless
<option>--quiet
</option> is
894 specified, this will also print the current unit state to
895 standard output.
</para>
899 <term><command>status
</command> <optional><replaceable>PATTERN
</replaceable>…|
<replaceable>PID
</replaceable>…]
</optional></term>
902 <para>Show terse runtime status information about one or
903 more units, followed by most recent log data from the
904 journal. If no units are specified, show system status. If
905 combined with
<option>--all
</option>, also show the status of
906 all units (subject to limitations specified with
907 <option>-t
</option>). If a PID is passed, show information
908 about the unit the process belongs to.
</para>
910 <para>This function is intended to generate human-readable
911 output. If you are looking for computer-parsable output,
912 use
<command>show
</command> instead. By default, this
913 function only shows
10 lines of output and ellipsizes
914 lines to fit in the terminal window. This can be changed
915 with
<option>--lines
</option> and
<option>--full
</option>,
916 see above. In addition,
<command>journalctl
917 --unit=
<replaceable>NAME
</replaceable></command> or
919 --user-unit=
<replaceable>NAME
</replaceable></command> use
920 a similar filter for messages and might be more
924 <para>systemd implicitly loads units as necessary, so just running the
<command>status
</command> will
925 attempt to load a file. The command is thus not useful for determining if something was already loaded or
926 not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason
927 to keep it in memory thereafter.
931 <title>Example output from systemctl status
</title>
933 <programlisting>$ systemctl status bluetooth
934 â—Ź bluetooth.service - Bluetooth service
935 Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
936 Active: active (running) since Wed
2017-
01-
04 13:
54:
04 EST;
1 weeks
0 days ago
937 Docs: man:bluetoothd(
8)
938 Main PID:
930 (bluetoothd)
943 CGroup: /system.slice/bluetooth.service
944 └─
930 /usr/lib/bluetooth/bluetoothd
946 Jan
12 10:
46:
45 example.com bluetoothd[
8900]: Not enough free handles to register service
947 Jan
12 10:
46:
45 example.com bluetoothd[
8900]: Current Time Service could not be registered
948 Jan
12 10:
46:
45 example.com bluetoothd[
8900]: gatt-time-server: Input/output error (
5)
951 <para>The dot (
"â—Ź") uses color on supported terminals to summarize the unit state at a glance. White
952 indicates an
<literal>inactive
</literal> or
<literal>deactivating
</literal> state. Red indicates a
953 <literal>failed
</literal> or
<literal>error
</literal> state and green indicates an
954 <literal>active
</literal>,
<literal>reloading
</literal> or
<literal>activating
</literal> state.
957 <para>The
"Loaded:" line in the output will show
<literal>loaded
</literal> if the unit has been loaded into
958 memory. Other possible values for
"Loaded:" include:
<literal>error
</literal> if there was a problem
959 loading it,
<literal>not-found
</literal> if not unit file was found for this unit,
960 <literal>bad-setting
</literal> if an essential unit file setting could not be parsed and
961 <literal>masked
</literal> if the unit file has been masked. Along with showing the path to the unit file,
962 this line will also show the enablement state. Enabled commands start at boot. See the full table of
963 possible enablement states — including the definition of
<literal>masked
</literal> — in the documentation
964 for the
<command>is-enabled
</command> command.
967 <para>The
"Active:" line shows active state. The value is usually
<literal>active
</literal> or
968 <literal>inactive
</literal>. Active could mean started, bound, plugged in, etc depending on the unit type.
969 The unit could also be in process of changing states, reporting a state of
<literal>activating
</literal> or
970 <literal>deactivating
</literal>. A special
<literal>failed
</literal> state is entered when the service
971 failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is
972 entered the cause will be logged for later reference.
</para>
978 <term><command>show
</command> <optional><replaceable>PATTERN
</replaceable>…|
<replaceable>JOB
</replaceable>…
</optional></term>
981 <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified,
982 properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and
983 if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use
984 <option>--all
</option> to show those too. To select specific properties to show, use
985 <option>--property=
</option>. This command is intended to be used whenever computer-parsable output is
986 required. Use
<command>status
</command> if you are looking for formatted human-readable output.
</para>
988 <para>Many properties shown by
<command>systemctl show
</command> map directly to configuration settings of
989 the system and service manager and its unit files. Note that the properties shown by the command are
990 generally more low-level, normalized versions of the original configuration settings and expose runtime
991 state in addition to configuration. For example, properties shown for service units include the service's
992 current main process identifier as
<literal>MainPID
</literal> (which is runtime state), and time settings
993 are always exposed as properties ending in the
<literal>…USec
</literal> suffix even if a matching
994 configuration options end in
<literal>…Sec
</literal>, because microseconds is the normalized time unit used
995 by the system and service manager.
</para>
999 <term><command>cat
<replaceable>PATTERN
</replaceable>…
</command></term>
1002 <para>Show backing files of one or more units. Prints the
1003 "fragment" and
"drop-ins" (source files) of units. Each
1004 file is preceded by a comment which includes the file
1005 name. Note that this shows the contents of the backing files
1006 on disk, which may not match the system manager's
1007 understanding of these units if any unit files were
1008 updated on disk and the
<command>daemon-reload
</command>
1009 command wasn't issued since.
</para>
1013 <term><command>set-property
<replaceable>UNIT
</replaceable> <replaceable>PROPERTY
</replaceable>=
<replaceable>VALUE
</replaceable>…
</command></term>
1016 <para>Set the specified unit properties at runtime where
1017 this is supported. This allows changing configuration
1018 parameter properties such as resource control settings at
1019 runtime. Not all properties may be changed at runtime, but
1020 many resource control settings (primarily those in
1021 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
1022 may. The changes are applied immediately, and stored on disk
1023 for future boots, unless
<option>--runtime
</option> is
1024 passed, in which case the settings only apply until the
1025 next reboot. The syntax of the property assignment follows
1026 closely the syntax of assignments in unit files.
</para>
1028 <para>Example:
<command>systemctl set-property foobar.service CPUShares=
777</command></para>
1030 <para>If the specified unit appears to be inactive, the
1031 changes will be only stored on disk as described
1032 previously hence they will be effective when the unit will
1035 <para>Note that this command allows changing multiple
1036 properties at the same time, which is preferable over
1037 setting them individually. Like with unit file configuration
1038 settings, assigning an empty list will reset the property.
1044 <term><command>help
<replaceable>PATTERN
</replaceable>…|
<replaceable>PID
</replaceable>…
</command></term>
1047 <para>Show manual pages for one or more units, if
1048 available. If a PID is given, the manual pages for the unit
1049 the process belongs to are shown.
</para>
1054 <term><command>reset-failed [
<replaceable>PATTERN
</replaceable>…]
</command></term>
1057 <para>Reset the
<literal>failed
</literal> state of the specified units, or if no unit name is passed, reset
1058 the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code,
1059 terminating abnormally or timing out), it will automatically enter the
<literal>failed
</literal> state and
1060 its exit code and status is recorded for introspection by the administrator until the service is
1061 stopped/re-started or reset with this command.
</para>
1067 <command>list-dependencies
</command>
1068 <optional><replaceable>UNIT
</replaceable></optional>
1072 <para>Shows units required and wanted by the specified
1073 unit. This recursively lists units following the
1074 <varname>Requires=
</varname>,
1075 <varname>Requisite=
</varname>,
1076 <varname>ConsistsOf=
</varname>,
1077 <varname>Wants=
</varname>,
<varname>BindsTo=
</varname>
1078 dependencies. If no unit is specified,
1079 <filename>default.target
</filename> is implied.
</para>
1081 <para>By default, only target units are recursively
1082 expanded. When
<option>--all
</option> is passed, all other
1083 units are recursively expanded as well.
</para>
1085 <para>Options
<option>--reverse
</option>,
1086 <option>--after
</option>,
<option>--before
</option>
1087 may be used to change what types of dependencies
1095 <title>Unit File Commands
</title>
1099 <term><command>list-unit-files
</command> <optional><replaceable>PATTERN…
</replaceable></optional></term>
1102 <para>List unit files installed on the system, in combination with their enablement state (as reported by
1103 <command>is-enabled
</command>). If one or more
<replaceable>PATTERN
</replaceable>s are specified, only unit
1104 files whose name matches one of them are shown (patterns matching unit file system paths are not
1110 <term><command>enable
<replaceable>UNIT
</replaceable>…
</command></term>
1111 <term><command>enable
<replaceable>PATH
</replaceable>…
</command></term>
1114 <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the
1115 <literal>[Install]
</literal> sections of the indicated unit files. After the symlinks have been created,
1116 the system manager configuration is reloaded (in a way equivalent to
<command>daemon-reload
</command>), in
1117 order to ensure the changes are taken into account immediately. Note that this does
1118 <emphasis>not
</emphasis> have the effect of also starting any of the units being enabled. If this is
1119 desired, combine this command with the
<option>--now
</option> switch, or invoke
<command>start
</command>
1120 with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of
1121 the form
<filename>foo@bar.service
</filename>), symlinks named the same as instances are created in the
1122 unit configuration directory, however they point to the single template unit file they are instantiated
1125 <para>This command expects either valid unit names (in which case various unit file directories are
1126 automatically searched for unit files with appropriate names), or absolute paths to unit files (in which
1127 case these files are read directly). If a specified unit file is located outside of the usual unit file
1128 directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring
1129 it is found when requested by commands such as
<command>start
</command>. The file system where the linked
1130 unit files are located must be accessible when systemd is started (e.g. anything underneath
1131 <filename>/home
</filename> or
<filename>/var
</filename> is not allowed, unless those directories are
1132 located on the root file system).
</para>
1134 <para>This command will print the file system operations executed. This output may be suppressed by passing
1135 <option>--quiet
</option>.
1138 <para>Note that this operation creates only the symlinks suggested in the
<literal>[Install]
</literal>
1139 section of the unit files. While this command is the recommended way to manipulate the unit configuration
1140 directory, the administrator is free to make additional changes manually by placing or removing symlinks
1141 below this directory. This is particularly useful to create configurations that deviate from the suggested
1142 default installation. In this case, the administrator must make sure to invoke
1143 <command>daemon-reload
</command> manually as necessary, in order to ensure the changes are taken into
1147 <para>Enabling units should not be confused with starting (activating) units, as done by the
1148 <command>start
</command> command. Enabling and starting units is orthogonal: units may be enabled without
1149 being started and started without being enabled. Enabling simply hooks the unit into various suggested
1150 places (for example, so that the unit is automatically started on boot or when a particular kind of
1151 hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds
1152 the socket (in case of socket units), and so on.
</para>
1154 <para>Depending on whether
<option>--system
</option>,
<option>--user
</option>,
<option>--runtime
</option>,
1155 or
<option>--global
</option> is specified, this enables the unit for the system, for the calling user only,
1156 for only this boot of the system, or for all future logins of all users. Note that in the last case, no
1157 systemd daemon configuration is reloaded.
</para>
1159 <para>Using
<command>enable
</command> on masked units is not supported and results in an error.
</para>
1164 <term><command>disable
<replaceable>UNIT
</replaceable>…
</command></term>
1167 <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units
1168 from the unit configuration directory, and hence undoes any changes made by
<command>enable
</command> or
1169 <command>link
</command>. Note that this removes
<emphasis>all
</emphasis> symlinks to matching unit files,
1170 including manually created symlinks, and not just those actually created by
<command>enable
</command> or
1171 <command>link
</command>. Note that while
<command>disable
</command> undoes the effect of
1172 <command>enable
</command>, the two commands are otherwise not symmetric, as
<command>disable
</command> may
1173 remove more symlinks than a prior
<command>enable
</command> invocation of the same unit created.
</para>
1175 <para>This command expects valid unit names only, it does not accept paths to unit files.
</para>
1177 <para>In addition to the units specified as arguments, all units are disabled that are listed in the
1178 <varname>Also=
</varname> setting contained in the
<literal>[Install]
</literal> section of any of the unit
1179 files being operated on.
</para>
1181 <para>This command implicitly reloads the system manager configuration after completing the operation. Note
1182 that this command does not implicitly stop the units that are being disabled. If this is desired, either
1183 combine this command with the
<option>--now
</option> switch, or invoke the
<command>stop
</command> command
1184 with appropriate arguments later.
</para>
1186 <para>This command will print information about the file system operations (symlink removals)
1187 executed. This output may be suppressed by passing
<option>--quiet
</option>.
1190 <para>This command honors
<option>--system
</option>,
<option>--user
</option>,
<option>--runtime
</option>
1191 and
<option>--global
</option> in a similar way as
<command>enable
</command>.
</para>
1196 <term><command>reenable
<replaceable>UNIT
</replaceable>…
</command></term>
1199 <para>Reenable one or more units, as specified on the command line. This is a combination of
1200 <command>disable
</command> and
<command>enable
</command> and is useful to reset the symlinks a unit file is
1201 enabled with to the defaults configured in its
<literal>[Install]
</literal> section. This command expects
1202 a unit name only, it does not accept paths to unit files.
</para>
1207 <term><command>preset
<replaceable>UNIT
</replaceable>…
</command></term>
1210 <para>Reset the enable/disable status one or more unit files, as specified on
1211 the command line, to the defaults configured in the preset policy files. This
1212 has the same effect as
<command>disable
</command> or
1213 <command>enable
</command>, depending how the unit is listed in the preset
1216 <para>Use
<option>--preset-mode=
</option> to control whether units shall be
1217 enabled and disabled, or only enabled, or only disabled.
</para>
1219 <para>If the unit carries no install information, it will be silently ignored
1220 by this command.
<replaceable>UNIT
</replaceable> must be the real unit name,
1221 any alias names are ignored silently.
</para>
1223 <para>For more information on the preset policy format, see
1224 <citerefentry><refentrytitle>systemd.preset
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1225 For more information on the concept of presets, please consult the
1226 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset
</ulink>
1232 <term><command>preset-all
</command></term>
1235 <para>Resets all installed unit files to the defaults
1236 configured in the preset policy file (see above).
</para>
1238 <para>Use
<option>--preset-mode=
</option> to control
1239 whether units shall be enabled and disabled, or only
1240 enabled, or only disabled.
</para>
1245 <term><command>is-enabled
<replaceable>UNIT
</replaceable>…
</command></term>
1248 <para>Checks whether any of the specified unit files are
1249 enabled (as with
<command>enable
</command>). Returns an
1250 exit code of
0 if at least one is enabled, non-zero
1251 otherwise. Prints the current enable status (see table).
1252 To suppress this output, use
<option>--quiet
</option>.
1253 To show installation targets, use
<option>--full
</option>.
1258 <command>is-enabled
</command> output
1265 <entry>Description
</entry>
1266 <entry>Exit Code
</entry>
1271 <entry><literal>enabled
</literal></entry>
1272 <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>
1273 <entry morerows='
1'
>0</entry>
1276 <entry><literal>enabled-runtime
</literal></entry>
1279 <entry><literal>linked
</literal></entry>
1280 <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>
1281 <entry morerows='
1'
>> 0</entry>
1284 <entry><literal>linked-runtime
</literal></entry>
1287 <entry><literal>masked
</literal></entry>
1288 <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>
1289 <entry morerows='
1'
>> 0</entry>
1292 <entry><literal>masked-runtime
</literal></entry>
1295 <entry><literal>static
</literal></entry>
1296 <entry>The unit file is not enabled, and has no provisions for enabling in the
<literal>[Install]
</literal> unit file section.
</entry>
1300 <entry><literal>indirect
</literal></entry>
1301 <entry>The unit file itself is not enabled, but it has a non-empty
<varname>Also=
</varname> setting in the
<literal>[Install]
</literal> 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 Also=. For template unit file, an instance different than the one specified in
<varname>DefaultInstance=
</varname> is enabled.
</entry>
1305 <entry><literal>disabled
</literal></entry>
1306 <entry>The unit file is not enabled, but contains an
<literal>[Install]
</literal> section with installation instructions.
</entry>
1307 <entry>> 0</entry>
1310 <entry><literal>generated
</literal></entry>
1311 <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>
1315 <entry><literal>transient
</literal></entry>
1316 <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.
</entry>
1320 <entry><literal>bad
</literal></entry>
1321 <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>
1322 <entry>> 0</entry>
1332 <term><command>mask
<replaceable>UNIT
</replaceable>…
</command></term>
1335 <para>Mask one or more units, as specified on the command line. This will link these unit files to
1336 <filename>/dev/null
</filename>, making it impossible to start them. This is a stronger version of
1337 <command>disable
</command>, since it prohibits all kinds of activation of the unit, including enablement
1338 and manual activation. Use this option with care. This honors the
<option>--runtime
</option> option to only
1339 mask temporarily until the next reboot of the system. The
<option>--now
</option> option may be used to
1340 ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit
1346 <term><command>unmask
<replaceable>UNIT
</replaceable>…
</command></term>
1349 <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of
1350 <command>mask
</command>. This command expects valid unit names only, it does not accept unit file
1356 <term><command>link
<replaceable>PATH
</replaceable>…
</command></term>
1359 <para>Link a unit file that is not in the unit file search paths into the unit file search path. This
1360 command expects an absolute path to a unit file. The effect of this may be undone with
1361 <command>disable
</command>. The effect of this command is that a unit file is made available for commands
1362 such as
<command>start
</command>, even though it is not installed directly in the unit search path. The
1363 file system where the linked unit files are located must be accessible when systemd is started
1364 (e.g. anything underneath
<filename>/home
</filename> or
<filename>/var
</filename> is not allowed, unless
1365 those directories are located on the root file system).
</para>
1370 <term><command>revert
<replaceable>UNIT
</replaceable>…
</command></term>
1373 <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration
1374 files that modify the specified units, as well as any user-configured unit file that overrides a matching
1375 vendor supplied unit file. Specifically, for a unit
<literal>foo.service
</literal> the matching directories
1376 <literal>foo.service.d/
</literal> with all their contained files are removed, both below the persistent and
1377 runtime configuration directories (i.e. below
<filename>/etc/systemd/system
</filename> and
1378 <filename>/run/systemd/system
</filename>); if the unit file has a vendor-supplied version (i.e. a unit file
1379 located below
<filename>/usr
</filename>) any matching persistent or runtime unit file that overrides it is
1380 removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below
1381 <filename>/etc/systemd/system
</filename> or
<filename>/run/systemd/system
</filename>, but not in a unit
1382 file stored below
<filename>/usr
</filename>), then it is not removed. Also, if a unit is masked, it is
1385 <para>Effectively, this command may be used to undo all changes made with
<command>systemctl
1386 edit
</command>,
<command>systemctl set-property
</command> and
<command>systemctl mask
</command> and puts
1387 the original unit file with its settings back in effect.
</para>
1392 <term><command>add-wants
<replaceable>TARGET
</replaceable>
1393 <replaceable>UNIT
</replaceable>…
</command></term>
1394 <term><command>add-requires
<replaceable>TARGET
</replaceable>
1395 <replaceable>UNIT
</replaceable>…
</command></term>
1398 <para>Adds
<literal>Wants=
</literal> or
<literal>Requires=
</literal>
1399 dependencies, respectively, to the specified
1400 <replaceable>TARGET
</replaceable> for one or more units.
</para>
1402 <para>This command honors
<option>--system
</option>,
1403 <option>--user
</option>,
<option>--runtime
</option> and
1404 <option>--global
</option> in a way similar to
1405 <command>enable
</command>.
</para>
1411 <term><command>edit
<replaceable>UNIT
</replaceable>…
</command></term>
1414 <para>Edit a drop-in snippet or a whole replacement file if
1415 <option>--full
</option> is specified, to extend or override the
1416 specified unit.
</para>
1418 <para>Depending on whether
<option>--system
</option> (the default),
1419 <option>--user
</option>, or
<option>--global
</option> is specified,
1420 this command creates a drop-in file for each unit either for the system,
1421 for the calling user, or for all futures logins of all users. Then,
1422 the editor (see the
"Environment" section below) is invoked on
1423 temporary files which will be written to the real location if the
1424 editor exits successfully.
</para>
1426 <para>If
<option>--full
</option> is specified, this will copy the
1427 original units instead of creating drop-in files.
</para>
1429 <para>If
<option>--force
</option> is specified and any units do
1430 not already exist, new unit files will be opened for editing.
</para>
1432 <para>If
<option>--runtime
</option> is specified, the changes will
1433 be made temporarily in
<filename>/run
</filename> and they will be
1434 lost on the next reboot.
</para>
1436 <para>If the temporary file is empty upon exit, the modification of
1437 the related unit is canceled.
</para>
1439 <para>After the units have been edited, systemd configuration is
1440 reloaded (in a way that is equivalent to
<command>daemon-reload
</command>).
1443 <para>Note that this command cannot be used to remotely edit units
1444 and that you cannot temporarily edit units which are in
1445 <filename>/etc
</filename>, since they take precedence over
1446 <filename>/run
</filename>.
</para>
1451 <term><command>get-default
</command></term>
1454 <para>Return the default target to boot into. This returns
1455 the target unit name
<filename>default.target
</filename>
1456 is aliased (symlinked) to.
</para>
1461 <term><command>set-default
<replaceable>TARGET
</replaceable></command></term>
1464 <para>Set the default target to boot into. This sets
1465 (symlinks) the
<filename>default.target
</filename> alias
1466 to the given target unit.
</para>
1474 <title>Machine Commands
</title>
1478 <term><command>list-machines
</command> <optional><replaceable>PATTERN
</replaceable>…
</optional></term>
1481 <para>List the host and all running local containers with
1482 their state. If one or more
1483 <replaceable>PATTERN
</replaceable>s are specified, only
1484 containers matching one of them are shown.
1492 <title>Job Commands
</title>
1496 <term><command>list-jobs
<optional><replaceable>PATTERN…
</replaceable></optional></command></term>
1499 <para>List jobs that are in progress. If one or more
1500 <replaceable>PATTERN
</replaceable>s are specified, only
1501 jobs for units matching one of them are shown.
</para>
1503 <para>When combined with
<option>--after
</option> or
<option>--before
</option> the list is augmented with
1504 information on which other job each job is waiting for, and which other jobs are waiting for it, see
1509 <term><command>cancel
<replaceable>JOB
</replaceable>…
</command></term>
1512 <para>Cancel one or more jobs specified on the command line
1513 by their numeric job IDs. If no job ID is specified, cancel
1514 all pending jobs.
</para>
1521 <title>Environment Commands
</title>
1525 <term><command>show-environment
</command></term>
1528 <para>Dump the systemd manager environment block. This is the environment
1529 block that is passed to all processes the manager spawns. The environment
1530 block will be dumped in straight-forward form suitable for sourcing into
1531 most shells. If no special characters or whitespace is present in the variable
1532 values, no escaping is performed, and the assignments have the form
1533 <literal>VARIABLE=value
</literal>. If whitespace or characters which have
1534 special meaning to the shell are present, dollar-single-quote escaping is
1535 used, and assignments have the form
<literal>VARIABLE=$'value'
</literal>.
1536 This syntax is known to be supported by
1537 <citerefentry project='die-net'
><refentrytitle>bash
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1538 <citerefentry project='die-net'
><refentrytitle>zsh
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1539 <citerefentry project='die-net'
><refentrytitle>ksh
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1541 <citerefentry project='die-net'
><refentrytitle>busybox
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
1542 <citerefentry project='die-net'
><refentrytitle>ash
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1544 <citerefentry project='die-net'
><refentrytitle>dash
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1546 <citerefentry project='die-net'
><refentrytitle>fish
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1551 <term><command>set-environment
<replaceable>VARIABLE=VALUE
</replaceable>…
</command></term>
1554 <para>Set one or more systemd manager environment variables,
1555 as specified on the command line.
</para>
1559 <term><command>unset-environment
<replaceable>VARIABLE
</replaceable>…
</command></term>
1562 <para>Unset one or more systemd manager environment
1563 variables. If only a variable name is specified, it will be
1564 removed regardless of its value. If a variable and a value
1565 are specified, the variable is only removed if it has the
1566 specified value.
</para>
1571 <command>import-environment
</command>
1572 <optional><replaceable>VARIABLE…
</replaceable></optional>
1576 <para>Import all, one or more environment variables set on
1577 the client into the systemd manager environment block. If
1578 no arguments are passed, the entire environment block is
1579 imported. Otherwise, a list of one or more environment
1580 variable names should be passed, whose client-side values
1581 are then imported into the manager's environment
1589 <title>Manager Lifecycle Commands
</title>
1593 <term><command>daemon-reload
</command></term>
1596 <para>Reload the systemd manager configuration. This will
1597 rerun all generators (see
1598 <citerefentry><refentrytitle>systemd.generator
</refentrytitle><manvolnum>7</manvolnum></citerefentry>),
1599 reload all unit files, and recreate the entire dependency
1600 tree. While the daemon is being reloaded, all sockets
1601 systemd listens on behalf of user configuration will stay
1604 <para>This command should not be confused with the
1605 <command>reload
</command> command.
</para>
1609 <term><command>daemon-reexec
</command></term>
1612 <para>Reexecute the systemd manager. This will serialize the
1613 manager state, reexecute the process and deserialize the
1614 state again. This command is of little use except for
1615 debugging and package upgrades. Sometimes, it might be
1616 helpful as a heavy-weight
<command>daemon-reload
</command>.
1617 While the daemon is being reexecuted, all sockets systemd listening
1618 on behalf of user configuration will stay accessible.
1626 <title>System Commands
</title>
1630 <term><command>is-system-running
</command></term>
1633 <para>Checks whether the system is operational. This
1634 returns success (exit code
0) when the system is fully up
1635 and running, specifically not in startup, shutdown or
1636 maintenance mode, and with no failed services. Failure is
1637 returned otherwise (exit code non-zero). In addition, the
1638 current state is printed in a short string to standard
1639 output, see the table below. Use
<option>--quiet
</option> to
1640 suppress this output.
</para>
1642 <para>Use
<option>--wait
</option> to wait until the boot
1643 process is completed before printing the current state and
1644 returning the appropriate error status. If
<option>--wait
</option>
1645 is in use, states
<varname>initializing
</varname> or
1646 <varname>starting
</varname> will not be reported, instead
1647 the command will block until a later state (such as
1648 <varname>running
</varname> or
<varname>degraded
</varname>)
1652 <title><command>is-system-running
</command> output
</title>
1654 <colspec colname='name'
/>
1655 <colspec colname='description'
/>
1656 <colspec colname='exit-code'
/>
1660 <entry>Description
</entry>
1661 <entry>Exit Code
</entry>
1666 <entry><varname>initializing
</varname></entry>
1667 <entry><para>Early bootup, before
1668 <filename>basic.target
</filename> is reached
1669 or the
<varname>maintenance
</varname> state entered.
1671 <entry>> 0</entry>
1674 <entry><varname>starting
</varname></entry>
1675 <entry><para>Late bootup, before the job queue
1676 becomes idle for the first time, or one of the
1677 rescue targets are reached.
</para></entry>
1678 <entry>> 0</entry>
1681 <entry><varname>running
</varname></entry>
1682 <entry><para>The system is fully
1683 operational.
</para></entry>
1687 <entry><varname>degraded
</varname></entry>
1688 <entry><para>The system is operational but one or more
1689 units failed.
</para></entry>
1690 <entry>> 0</entry>
1693 <entry><varname>maintenance
</varname></entry>
1694 <entry><para>The rescue or emergency target is
1695 active.
</para></entry>
1696 <entry>> 0</entry>
1699 <entry><varname>stopping
</varname></entry>
1700 <entry><para>The manager is shutting
1701 down.
</para></entry>
1702 <entry>> 0</entry>
1705 <entry><varname>offline
</varname></entry>
1706 <entry><para>The manager is not
1707 running. Specifically, this is the operational
1708 state if an incompatible program is running as
1709 system manager (PID
1).
</para></entry>
1710 <entry>> 0</entry>
1713 <entry><varname>unknown
</varname></entry>
1714 <entry><para>The operational state could not be
1715 determined, due to lack of resources or another
1716 error cause.
</para></entry>
1717 <entry>> 0</entry>
1726 <term><command>default
</command></term>
1729 <para>Enter default mode. This is equivalent to
<command>systemctl isolate default.target
</command>. This
1730 operation is blocking by default, use
<option>--no-block
</option> to request asynchronous behavior.
</para>
1735 <term><command>rescue
</command></term>
1738 <para>Enter rescue mode. This is equivalent to
<command>systemctl isolate rescue.target
</command>. This
1739 operation is blocking by default, use
<option>--no-block
</option> to request asynchronous behavior.
</para>
1743 <term><command>emergency
</command></term>
1746 <para>Enter emergency mode. This is equivalent to
<command>systemctl isolate
1747 emergency.target
</command>. This operation is blocking by default, use
<option>--no-block
</option> to
1748 request asynchronous behavior.
</para>
1752 <term><command>halt
</command></term>
1755 <para>Shut down and halt the system. This is mostly equivalent to
<command>systemctl start halt.target
1756 --job-mode=replace-irreversibly --no-block
</command>, but also prints a wall message to all users. This command is
1757 asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note
1758 that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered
1759 on. Use
<command>systemctl poweroff
</command> for powering off the system (see below).
</para>
1761 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1762 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1763 system halt. If
<option>--force
</option> is specified twice, the operation is immediately executed without
1764 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1765 <option>--force
</option> is specified twice the halt operation is executed by
<command>systemctl
</command>
1766 itself, and the system manager is not contacted. This means the command should succeed even when the system
1767 manager has crashed.
</para>
1771 <term><command>poweroff
</command></term>
1774 <para>Shut down and power-off the system. This is mostly equivalent to
<command>systemctl start
1775 poweroff.target --job-mode=replace-irreversibly --no-block
</command>, but also prints a wall message to all
1776 users. This command is asynchronous; it will return after the power-off operation is enqueued, without
1777 waiting for it to complete.
</para>
1779 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1780 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1781 powering off. If
<option>--force
</option> is specified twice, the operation is immediately executed without
1782 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1783 <option>--force
</option> is specified twice the power-off operation is executed by
1784 <command>systemctl
</command> itself, and the system manager is not contacted. This means the command should
1785 succeed even when the system manager has crashed.
</para>
1789 <term><command>reboot
</command> <optional><replaceable>arg
</replaceable></optional></term>
1792 <para>Shut down and reboot the system. This is mostly equivalent to
<command>systemctl start reboot.target
1793 --job-mode=replace-irreversibly --no-block
</command>, but also prints a wall message to all users. This
1794 command is asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1797 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1798 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1799 reboot. If
<option>--force
</option> is specified twice, the operation is immediately executed without
1800 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1801 <option>--force
</option> is specified twice the reboot operation is executed by
1802 <command>systemctl
</command> itself, and the system manager is not contacted. This means the command should
1803 succeed even when the system manager has crashed.
</para>
1805 <para>If the optional argument
<replaceable>arg
</replaceable> is given, it will be passed as the optional
1806 argument to the
<citerefentry><refentrytitle>reboot
</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1807 system call. The value is architecture and firmware specific. As an example,
<literal>recovery
</literal>
1808 might be used to trigger system recovery, and
<literal>fota
</literal> might be used to trigger a
1809 <quote>firmware over the air
</quote> update.
</para>
1814 <term><command>kexec
</command></term>
1817 <para>Shut down and reboot the system via
<command>kexec
</command>. This is equivalent to
1818 <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block
</command>. This command is
1819 asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1822 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1823 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1829 <term><command>exit
</command> <optional><replaceable>EXIT_CODE
</replaceable></optional></term>
1832 <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in
1833 conjunction with the
<option>--user
</option> option) or in containers and is equivalent to
1834 <command>poweroff
</command> otherwise. This command is asynchronous; it will return after the exit
1835 operation is enqueued, without waiting for it to complete.
</para>
1837 <para>The service manager will exit with the specified exit code, if
1838 <replaceable>EXIT_CODE
</replaceable> is passed.
</para>
1843 <term><command>switch-root
</command> <replaceable>ROOT
</replaceable> <optional><replaceable>INIT
</replaceable></optional></term>
1846 <para>Switches to a different root directory and executes a new system manager process below it. This is
1847 intended for usage in initial RAM disks (
"initrd"), and will transition from the initrd's system manager
1848 process (a.k.a.
"init" process) to the main system manager process which is loaded from the actual host
1849 volume. This call takes two arguments: the directory that is to become the new root directory, and the path
1850 to the new system manager binary below it to execute as PID
1. If the latter is omitted or the empty
1851 string, a systemd binary will automatically be searched for and used as init. If the system manager path is
1852 omitted, equal to the empty string or identical to the path to the systemd binary, the state of the
1853 initrd's system manager process is passed to the main system manager, which allows later introspection of
1854 the state of the services involved in the initrd boot phase.
</para>
1859 <term><command>suspend
</command></term>
1862 <para>Suspend the system. This will trigger activation of the special target unit
1863 <filename>suspend.target
</filename>. This command is asynchronous, and will return after the suspend
1864 operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.
</para>
1869 <term><command>hibernate
</command></term>
1872 <para>Hibernate the system. This will trigger activation of the special target unit
1873 <filename>hibernate.target
</filename>. This command is asynchronous, and will return after the hibernation
1874 operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.
</para>
1879 <term><command>hybrid-sleep
</command></term>
1882 <para>Hibernate and suspend the system. This will trigger activation of the special target unit
1883 <filename>hybrid-sleep.target
</filename>. This command is asynchronous, and will return after the hybrid
1884 sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.
</para>
1891 <title>Parameter Syntax
</title>
1893 <para>Unit commands listed above take either a single unit name (designated as
<replaceable>UNIT
</replaceable>),
1894 or multiple unit specifications (designated as
<replaceable>PATTERN
</replaceable>…). In the first case, the
1895 unit name with or without a suffix must be given. If the suffix is not specified (unit name is
"abbreviated"),
1896 systemctl will append a suitable suffix,
<literal>.service
</literal> by default, and a type-specific suffix in
1897 case of commands which operate only on specific unit types. For example,
1898 <programlisting># systemctl start sshd
</programlisting> and
1899 <programlisting># systemctl start sshd.service
</programlisting>
1900 are equivalent, as are
1901 <programlisting># systemctl isolate default
</programlisting>
1903 <programlisting># systemctl isolate default.target
</programlisting>
1904 Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
1905 paths to mount unit names.
1906 <programlisting># systemctl status /dev/sda
1907 # systemctl status /home
</programlisting>
1909 <programlisting># systemctl status dev-sda.device
1910 # systemctl status home.mount
</programlisting>
1911 In the second case, shell-style globs will be matched against the primary names of all units currently in memory;
1912 literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
1913 names always refer to exactly one unit, but globs may match zero units and this is not considered an
1916 <para>Glob patterns use
1917 <citerefentry project='man-pages'
><refentrytitle>fnmatch
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1918 so normal shell-style globbing rules are used, and
1919 <literal>*
</literal>,
<literal>?
</literal>,
1920 <literal>[]
</literal> may be used. See
1921 <citerefentry project='man-pages'
><refentrytitle>glob
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1922 for more details. The patterns are matched against the primary names of
1923 units currently in memory, and patterns which do not match anything
1924 are silently skipped. For example:
1925 <programlisting># systemctl stop sshd@*.service
</programlisting>
1926 will stop all
<filename>sshd@.service
</filename> instances. Note that alias names of units, and units that aren't
1927 in memory are not considered for glob expansion.
1930 <para>For unit file commands, the specified
<replaceable>UNIT
</replaceable> should be the name of the unit file
1931 (possibly abbreviated, see above), or the absolute path to the unit file:
1932 <programlisting># systemctl enable foo.service
</programlisting>
1934 <programlisting># systemctl link /path/to/foo.service
</programlisting>
1941 <title>Exit status
</title>
1943 <para>On success,
0 is returned, a non-zero failure
1944 code otherwise.
</para>
1948 <title>Environment
</title>
1950 <variablelist class='environment-variables'
>
1952 <term><varname>$SYSTEMD_EDITOR
</varname></term>
1954 <listitem><para>Editor to use when editing units; overrides
1955 <varname>$EDITOR
</varname> and
<varname>$VISUAL
</varname>. If neither
1956 <varname>$SYSTEMD_EDITOR
</varname> nor
<varname>$EDITOR
</varname> nor
1957 <varname>$VISUAL
</varname> are present or if it is set to an empty
1958 string or if their execution failed, systemctl will try to execute well
1959 known editors in this order:
1960 <citerefentry project='die-net'
><refentrytitle>editor
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1961 <citerefentry project='die-net'
><refentrytitle>nano
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1962 <citerefentry project='die-net'
><refentrytitle>vim
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1963 <citerefentry project='die-net'
><refentrytitle>vi
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1967 <xi:include href=
"less-variables.xml" xpointer=
"pager"/>
1968 <xi:include href=
"less-variables.xml" xpointer=
"less"/>
1969 <xi:include href=
"less-variables.xml" xpointer=
"lesscharset"/>
1973 <title>See Also
</title>
1975 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1976 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1977 <citerefentry><refentrytitle>loginctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1978 <citerefentry><refentrytitle>machinectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1979 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1980 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1981 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1982 <citerefentry project='man-pages'
><refentrytitle>wall
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1983 <citerefentry><refentrytitle>systemd.preset
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1984 <citerefentry><refentrytitle>systemd.generator
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1985 <citerefentry project='man-pages'
><refentrytitle>glob
</refentrytitle><manvolnum>7</manvolnum></citerefentry>