1 <?xml version='
1.0'
?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
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+
11 This file is part of systemd.
13 Copyright 2010 Lennart Poettering
16 <refentry id=
"systemctl"
17 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
20 <title>systemctl
</title>
21 <productname>systemd
</productname>
25 <contrib>Developer
</contrib>
26 <firstname>Lennart
</firstname>
27 <surname>Poettering
</surname>
28 <email>lennart@poettering.net
</email>
34 <refentrytitle>systemctl
</refentrytitle>
35 <manvolnum>1</manvolnum>
39 <refname>systemctl
</refname>
40 <refpurpose>Control the systemd system and service manager
</refpurpose>
45 <command>systemctl
</command>
46 <arg choice=
"opt" rep=
"repeat">OPTIONS
</arg>
47 <arg choice=
"plain">COMMAND
</arg>
48 <arg choice=
"opt" rep=
"repeat">UNIT
</arg>
53 <title>Description
</title>
55 <para><command>systemctl
</command> may be used to introspect and
56 control the state of the
<literal>systemd
</literal> system and
57 service manager. Please refer to
58 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
59 for an introduction into the basic concepts and functionality this
64 <title>Options
</title>
66 <para>The following options are understood:
</para>
70 <term><option>-t
</option></term>
71 <term><option>--type=
</option></term>
74 <para>The argument should be a comma-separated list of unit
75 types such as
<option>service
</option> and
76 <option>socket
</option>.
79 <para>If one of the arguments is a unit type, when listing
80 units, limit display to certain unit types. Otherwise, units
81 of all types will be shown.
</para>
83 <para>As a special case, if one of the arguments is
84 <option>help
</option>, a list of allowed values will be
85 printed and the program will exit.
</para>
90 <term><option>--state=
</option></term>
93 <para>The argument should be a comma-separated list of unit
94 LOAD, SUB, or ACTIVE states. When listing units, show only
95 those in the specified states. Use
<option>--state=failed
</option>
96 to show only failed units.
</para>
98 <para>As a special case, if one of the arguments is
99 <option>help
</option>, a list of allowed values will be
100 printed and the program will exit.
</para>
105 <term><option>-p
</option></term>
106 <term><option>--property=
</option></term>
109 <para>When showing unit/job/manager properties with the
110 <command>show
</command> command, limit display to properties
111 specified in the argument. The argument should be a
112 comma-separated list of property names, such as
113 <literal>MainPID
</literal>. Unless specified, all known
114 properties are shown. If specified more than once, all
115 properties with the specified names are shown. Shell
116 completion is implemented for property names.
</para>
118 <para>For the manager itself,
119 <command>systemctl show
</command> will show all available
120 properties. Those properties are documented in
121 <citerefentry><refentrytitle>systemd-system.conf
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
124 <para>Properties for units vary by unit type, so showing any
125 unit (even a non-existent one) is a way to list properties
126 pertaining to this type. Similarly, showing any job will list
127 properties pertaining to all jobs. Properties for units are
129 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
130 and the pages for individual unit types
131 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
132 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
138 <term><option>-a
</option></term>
139 <term><option>--all
</option></term>
142 <para>When listing units with
<command>list-units
</command>, also show inactive units and
143 units which are following other units. When showing unit/job/manager properties, show all
144 properties regardless whether they are set or not.
</para>
146 <para>To list all units installed in the file system, use the
147 <command>list-unit-files
</command> command instead.
</para>
149 <para>When listing units with
<command>list-dependencies
</command>, recursively show
150 dependencies of all dependent units (by default only dependencies of target units are
156 <term><option>-r
</option></term>
157 <term><option>--recursive
</option></term>
160 <para>When listing units, also show units of local
161 containers. Units of local containers will be prefixed with
162 the container name, separated by a single colon character
163 (
<literal>:
</literal>).
</para>
168 <term><option>--reverse
</option></term>
171 <para>Show reverse dependencies between units with
172 <command>list-dependencies
</command>, i.e. follow
173 dependencies of type
<varname>WantedBy=
</varname>,
174 <varname>RequiredBy=
</varname>,
175 <varname>PartOf=
</varname>,
<varname>BoundBy=
</varname>,
176 instead of
<varname>Wants=
</varname> and similar.
182 <term><option>--after
</option></term>
185 <para>With
<command>list-dependencies
</command>, show the
186 units that are ordered before the specified unit. In other
187 words, recursively list units following the
188 <varname>After=
</varname> dependency.
</para>
190 <para>Note that any
<varname>After=
</varname> dependency is
191 automatically mirrored to create a
192 <varname>Before=
</varname> dependency. Temporal dependencies
193 may be specified explicitly, but are also created implicitly
194 for units which are
<varname>WantedBy=
</varname> targets
196 <citerefentry><refentrytitle>systemd.target
</refentrytitle><manvolnum>5</manvolnum></citerefentry>),
197 and as a result of other directives (for example
198 <varname>RequiresMountsFor=
</varname>). Both explicitly
199 and implicitly introduced dependencies are shown with
200 <command>list-dependencies
</command>.
</para>
202 <para>When passed to the
<command>list-jobs
</command> command, for each printed job show which other jobs are
203 waiting for it. May be combined with
<option>--before
</option> to show both the jobs waiting for each job as
204 well as all jobs each job is waiting for.
</para>
209 <term><option>--before
</option></term>
212 <para>With
<command>list-dependencies
</command>, show the
213 units that are ordered after the specified unit. In other
214 words, recursively list units following the
215 <varname>Before=
</varname> dependency.
</para>
217 <para>When passed to the
<command>list-jobs
</command> command, for each printed job show which other jobs it
218 is waiting for. May be combined with
<option>--after
</option> to show both the jobs waiting for each job as
219 well as all jobs each job is waiting for.
</para>
224 <term><option>-l
</option></term>
225 <term><option>--full
</option></term>
228 <para>Do not ellipsize unit names, process tree entries,
229 journal output, or truncate unit descriptions in the output
230 of
<command>status
</command>,
<command>list-units
</command>,
231 <command>list-jobs
</command>, and
232 <command>list-timers
</command>.
</para>
233 <para>Also, show installation targets in the output of
234 <command>is-enabled
</command>.
</para>
239 <term><option>--value
</option></term>
242 <para>When printing properties with
<command>show
</command>,
243 only print the value, and skip the property name and
244 <literal>=
</literal>.
</para>
249 <term><option>--show-types
</option></term>
252 <para>When showing sockets, show the type of the socket.
</para>
257 <term><option>--job-mode=
</option></term>
260 <para>When queuing a new job, this option controls how to deal with
261 already queued jobs. It takes one of
<literal>fail
</literal>,
262 <literal>replace
</literal>,
263 <literal>replace-irreversibly
</literal>,
264 <literal>isolate
</literal>,
265 <literal>ignore-dependencies
</literal>,
266 <literal>ignore-requirements
</literal> or
267 <literal>flush
</literal>. Defaults to
268 <literal>replace
</literal>, except when the
269 <command>isolate
</command> command is used which implies the
270 <literal>isolate
</literal> job mode.
</para>
272 <para>If
<literal>fail
</literal> is specified and a requested
273 operation conflicts with a pending job (more specifically:
274 causes an already pending start job to be reversed into a stop
275 job or vice versa), cause the operation to fail.
</para>
277 <para>If
<literal>replace
</literal> (the default) is
278 specified, any conflicting pending job will be replaced, as
281 <para>If
<literal>replace-irreversibly
</literal> is specified,
282 operate like
<literal>replace
</literal>, but also mark the new
283 jobs as irreversible. This prevents future conflicting
284 transactions from replacing these jobs (or even being enqueued
285 while the irreversible jobs are still pending). Irreversible
286 jobs can still be cancelled using the
<command>cancel
</command>
287 command. This job mode should be used on any transaction which
288 pulls in
<filename>shutdown.target
</filename>.
</para>
290 <para><literal>isolate
</literal> is only valid for start
291 operations and causes all other units to be stopped when the
292 specified unit is started. This mode is always used when the
293 <command>isolate
</command> command is used.
</para>
295 <para><literal>flush
</literal> will cause all queued jobs to
296 be canceled when the new job is enqueued.
</para>
298 <para>If
<literal>ignore-dependencies
</literal> is specified,
299 then all unit dependencies are ignored for this new job and
300 the operation is executed immediately. If passed, no required
301 units of the unit passed will be pulled in, and no ordering
302 dependencies will be honored. This is mostly a debugging and
303 rescue tool for the administrator and should not be used by
306 <para><literal>ignore-requirements
</literal> is similar to
307 <literal>ignore-dependencies
</literal>, but only causes the
308 requirement dependencies to be ignored, the ordering
309 dependencies will still be honored.
</para>
315 <term><option>--fail
</option></term>
318 <para>Shorthand for
<option>--job-mode=
</option>fail.
</para>
319 <para>When used with the
<command>kill
</command> command,
320 if no units were killed, the operation results in an error.
326 <term><option>-i
</option></term>
327 <term><option>--ignore-inhibitors
</option></term>
330 <para>When system shutdown or a sleep state is requested,
331 ignore inhibitor locks. Applications can establish inhibitor
332 locks to avoid that certain important operations (such as CD
333 burning or suchlike) are interrupted by system shutdown or a
334 sleep state. Any user may take these locks and privileged
335 users may override these locks. If any locks are taken,
336 shutdown and sleep state requests will normally fail
337 (regardless of whether privileged or not) and a list of active locks
338 is printed. However, if
<option>--ignore-inhibitors
</option>
339 is specified, the locks are ignored and not printed, and the
340 operation attempted anyway, possibly requiring additional
346 <term><option>--dry-run
</option></term>
349 <para>Just print what would be done. Currently supported by verbs
350 <command>halt
</command>,
<command>poweroff
</command>,
<command>reboot
</command>,
351 <command>kexec
</command>,
<command>suspend
</command>,
352 <command>hibernate
</command>,
<command>hybrid-sleep
</command>,
353 <command>default
</command>,
<command>rescue
</command>,
354 <command>emergency
</command>, and
<command>exit
</command>.
</para>
359 <term><option>-q
</option></term>
360 <term><option>--quiet
</option></term>
363 <para>Suppress printing of the results of various commands
364 and also the hints about truncated log lines. This does not
365 suppress output of commands for which the printed output is
366 the only result (like
<command>show
</command>). Errors are
367 always printed.
</para>
372 <term><option>--no-block
</option></term>
375 <para>Do not synchronously wait for the requested operation
376 to finish. If this is not specified, the job will be
377 verified, enqueued and
<command>systemctl
</command> will
378 wait until the unit's start-up is completed. By passing this
379 argument, it is only verified and enqueued. This option may not be
380 combined with
<option>--wait
</option>.
</para>
385 <term><option>--wait
</option></term>
388 <para>Synchronously wait for started units to terminate again.
389 This option may not be combined with
<option>--no-block
</option>.
390 Note that this will wait forever if any given unit never terminates
391 (by itself or by getting stopped explicitly); particularly services
392 which use
<literal>RemainAfterExit=yes
</literal>.
</para>
396 <xi:include href=
"user-system-options.xml" xpointer=
"user" />
397 <xi:include href=
"user-system-options.xml" xpointer=
"system" />
400 <term><option>--failed
</option></term>
403 <para>List units in failed state. This is equivalent to
404 <option>--state=failed
</option>.
</para>
409 <term><option>--no-wall
</option></term>
412 <para>Do not send wall message before halt, power-off and reboot.
</para>
417 <term><option>--global
</option></term>
420 <para>When used with
<command>enable
</command> and
421 <command>disable
</command>, operate on the global user
422 configuration directory, thus enabling or disabling a unit
423 file globally for all future logins of all users.
</para>
428 <term><option>--no-reload
</option></term>
431 <para>When used with
<command>enable
</command> and
432 <command>disable
</command>, do not implicitly reload daemon
433 configuration after executing the changes.
</para>
438 <term><option>--no-ask-password
</option></term>
441 <para>When used with
<command>start
</command> and related
442 commands, disables asking for passwords. Background services
443 may require input of a password or passphrase string, for
444 example to unlock system hard disks or cryptographic
445 certificates. Unless this option is specified and the
446 command is invoked from a terminal,
447 <command>systemctl
</command> will query the user on the
448 terminal for the necessary secrets. Use this option to
449 switch this behavior off. In this case, the password must be
450 supplied by some other means (for example graphical password
451 agents) or the service might fail. This also disables
452 querying the user for authentication for privileged
458 <term><option>--kill-who=
</option></term>
461 <para>When used with
<command>kill
</command>, choose which
462 processes to send a signal to. Must be one of
463 <option>main
</option>,
<option>control
</option> or
464 <option>all
</option> to select whether to kill only the main
465 process, the control process or all processes of the
466 unit. The main process of the unit is the one that defines
467 the life-time of it. A control process of a unit is one that
468 is invoked by the manager to induce state changes of it. For
469 example, all processes started due to the
470 <varname>ExecStartPre=
</varname>,
471 <varname>ExecStop=
</varname> or
472 <varname>ExecReload=
</varname> settings of service units are
473 control processes. Note that there is only one control
474 process per unit at a time, as only one state change is
475 executed at a time. For services of type
476 <varname>Type=forking
</varname>, the initial process started
477 by the manager for
<varname>ExecStart=
</varname> is a
478 control process, while the process ultimately forked off by
479 that one is then considered the main process of the unit (if
480 it can be determined). This is different for service units
481 of other types, where the process forked off by the manager
482 for
<varname>ExecStart=
</varname> is always the main process
483 itself. A service unit consists of zero or one main process,
484 zero or one control process plus any number of additional
485 processes. Not all unit types manage processes of these
486 types however. For example, for mount units, control processes
487 are defined (which are the invocations of
488 <filename>&MOUNT_PATH;</filename> and
489 <filename>&UMOUNT_PATH;</filename>), but no main process
490 is defined. If omitted, defaults to
491 <option>all
</option>.
</para>
497 <term><option>-s
</option></term>
498 <term><option>--signal=
</option></term>
501 <para>When used with
<command>kill
</command>, choose which
502 signal to send to selected processes. Must be one of the
503 well-known signal specifiers such as
<constant>SIGTERM
</constant>,
<constant>SIGINT
</constant> or
504 <constant>SIGSTOP
</constant>. If omitted, defaults to
505 <option>SIGTERM
</option>.
</para>
510 <term><option>-f
</option></term>
511 <term><option>--force
</option></term>
514 <para>When used with
<command>enable
</command>, overwrite
515 any existing conflicting symlinks.
</para>
517 <para>When used with
<command>edit
</command>, create all of the
518 specified units which do not already exist.
</para>
520 <para>When used with
<command>halt
</command>,
<command>poweroff
</command>,
<command>reboot
</command> or
521 <command>kexec
</command>, execute the selected operation without shutting down all units. However, all
522 processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a
523 drastic but relatively safe option to request an immediate reboot. If
<option>--force
</option> is specified
524 twice for these operations (with the exception of
<command>kexec
</command>), they will be executed
525 immediately, without terminating any processes or unmounting any file systems. Warning: specifying
526 <option>--force
</option> twice with any of these operations might result in data loss. Note that when
527 <option>--force
</option> is specified twice the selected operation is executed by
528 <command>systemctl
</command> itself, and the system manager is not contacted. This means the command should
529 succeed even when the system manager has crashed.
</para>
534 <term><option>--message=
</option></term>
537 <para>When used with
<command>halt
</command>,
<command>poweroff
</command> or
<command>reboot
</command>, set a
538 short message explaining the reason for the operation. The message will be logged together with the default
539 shutdown message.
</para>
544 <term><option>--now
</option></term>
547 <para>When used with
<command>enable
</command>, the units
548 will also be started. When used with
<command>disable
</command> or
549 <command>mask
</command>, the units will also be stopped. The start
550 or stop operation is only carried out when the respective enable or
551 disable operation has been successful.
</para>
556 <term><option>--root=
</option></term>
560 <command>enable
</command>/
<command>disable
</command>/
<command>is-enabled
</command>
561 (and related commands), use the specified root path when looking for unit
562 files. If this option is present,
<command>systemctl
</command> will operate on
563 the file system directly, instead of communicating with the
<command>systemd
</command>
564 daemon to carry out changes.
</para>
570 <term><option>--runtime
</option></term>
573 <para>When used with
<command>set-property
</command>, make changes only
574 temporarily, so that they are lost on the next reboot.
</para>
576 <para>Similarily, when used with
<command>enable
</command>,
<command>mask
</command>,
577 <command>edit
</command> and related commands, make temporary changes, which are lost on
578 the next reboot. Changes are not made in subdirectories of
<filename>/etc
</filename>, but
579 in
<filename>/run
</filename>. The immediate effect is identical, however since the latter
580 is lost on reboot, the changes are lost too.
</para>
582 <para>Note: this option cannot be used with
<command>disable
</command>,
583 <command>unmask
</command>,
<command>preset
</command>, or
<command>preset-all
</command>,
584 because those operations sometimes need to remove symlinks under
<filename>/etc
</filename>
585 to have the desired effect, which would cause a persistent change.
</para>
590 <term><option>--preset-mode=
</option></term>
593 <para>Takes one of
<literal>full
</literal> (the default),
594 <literal>enable-only
</literal>,
595 <literal>disable-only
</literal>. When used with the
596 <command>preset
</command> or
<command>preset-all
</command>
597 commands, controls whether units shall be disabled and
598 enabled according to the preset rules, or only enabled, or
599 only disabled.
</para>
604 <term><option>-n
</option></term>
605 <term><option>--lines=
</option></term>
608 <para>When used with
<command>status
</command>, controls the
609 number of journal lines to show, counting from the most
610 recent ones. Takes a positive integer argument. Defaults to
616 <term><option>-o
</option></term>
617 <term><option>--output=
</option></term>
620 <para>When used with
<command>status
</command>, controls the
621 formatting of the journal entries that are shown. For the
622 available choices, see
623 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
624 Defaults to
<literal>short
</literal>.
</para>
629 <term><option>--firmware-setup
</option></term>
632 <para>When used with the
<command>reboot
</command> command,
633 indicate to the system's firmware to boot into setup
634 mode. Note that this is currently only supported on some EFI
635 systems and only if the system was booted in EFI
641 <term><option>--plain
</option></term>
644 <para>When used with
<command>list-dependencies
</command>,
645 <command>list-units
</command> or
<command>list-machines
</command>,
646 the output is printed as a list instead of a tree, and the bullet
647 circles are omitted.
</para>
651 <xi:include href=
"user-system-options.xml" xpointer=
"host" />
652 <xi:include href=
"user-system-options.xml" xpointer=
"machine" />
654 <xi:include href=
"standard-options.xml" xpointer=
"no-pager" />
655 <xi:include href=
"standard-options.xml" xpointer=
"no-legend" />
656 <xi:include href=
"standard-options.xml" xpointer=
"help" />
657 <xi:include href=
"standard-options.xml" xpointer=
"version" />
662 <title>Commands
</title>
664 <para>The following commands are understood:
</para>
667 <title>Unit Commands
</title>
671 <term><command>list-units
<optional><replaceable>PATTERN
</replaceable>…
</optional></command></term>
674 <para>List units that
<command>systemd
</command> currently has in memory. This includes units that are
675 either referenced directly or through a dependency, units that are pinned by applications programmatically,
676 or units that were active in the past and have failed. By default only units which are active, have pending
677 jobs, or have failed are shown; this can be changed with option
<option>--all
</option>. If one or more
678 <replaceable>PATTERN
</replaceable>s are specified, only units matching one of them are shown. The units
679 that are shown are additionally filtered by
<option>--type=
</option> and
<option>--state=
</option> if those
680 options are specified.
</para>
682 <para>Produces output similar to
683 <programlisting> UNIT LOAD ACTIVE SUB DESCRIPTION
684 sys-module-fuse.device loaded active plugged /sys/module/fuse
685 -.mount loaded active mounted Root Mount
686 boot-efi.mount loaded active mounted /boot/efi
687 systemd-journald.service loaded active running Journal Service
688 systemd-logind.service loaded active running Login Service
689 â—Ź user@
1000.service loaded active running User Manager for UID
1000
691 systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories
693 LOAD = Reflects whether the unit definition was properly loaded.
694 ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
695 SUB = The low-level unit activation state, values depend on unit type.
697 123 loaded units listed. Pass --all to see loaded but inactive units, too.
698 To show all installed unit files use 'systemctl list-unit-files'.
700 The header and the last unit of a given type are underlined if the
701 terminal supports that. A colored dot is shown next to services which
702 were masked, not found, or otherwise failed.
</para>
704 <para>The LOAD column shows the load state, one of
<constant>loaded
</constant>,
705 <constant>not-found
</constant>,
<constant>error
</constant>,
<constant>masked
</constant>. The ACTIVE columns
706 shows the general unit state, one of
<constant>active
</constant>,
<constant>reloading
</constant>,
707 <constant>inactive
</constant>,
<constant>failed
</constant>,
<constant>activating
</constant>,
708 <constant>deactivating
</constant>. The SUB column shows the unit-type-specific detailed state of the unit,
709 possible values vary by unit type. The list of possible LOAD, ACTIVE, and SUB states is not constant and
710 new systemd releases may both add and remove values.
<programlisting>systemctl --state=help
</programlisting> command maybe be
711 used to display the current set of possible values.
</para>
713 <para>This is the default command.
</para>
718 <term><command>list-sockets
<optional><replaceable>PATTERN
</replaceable>…
</optional></command></term>
721 <para>List socket units currently in memory, ordered by listening address. If one or more
722 <replaceable>PATTERN
</replaceable>s are specified, only socket units matching one of them are
723 shown. Produces output similar to
725 LISTEN UNIT ACTIVATES
726 /dev/initctl systemd-initctl.socket systemd-initctl.service
728 [::]:
22 sshd.socket sshd.service
729 kobject-uevent
1 systemd-udevd-kernel.socket systemd-udevd.service
731 5 sockets listed.
</programlisting>
732 Note: because the addresses might contains spaces, this output
733 is not suitable for programmatic consumption.
736 <para>Also see
<option>--show-types
</option>,
<option>--all
</option>, and
<option>--state=
</option>.
</para>
741 <term><command>list-timers
<optional><replaceable>PATTERN
</replaceable>…
</optional></command></term>
744 <para>List timer units currently in memory, ordered by the time they elapse next. If one or more
745 <replaceable>PATTERN
</replaceable>s are specified, only units matching one of them are shown.
746 Produces output similar to
748 NEXT LEFT LAST PASSED UNIT ACTIVATES
749 n/a n/a Thu
2017-
02-
23 13:
40:
29 EST
3 days ago ureadahead-stop.timer ureadahead-stop.service
750 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
751 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
752 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
756 <para><emphasis>NEXT
</emphasis> shows the next time the timer will run.
</para>
757 <para><emphasis>LEFT
</emphasis> shows how long till the next time the timer runs.
</para>
758 <para><emphasis>LAST
</emphasis> shows the last time the timer ran.
</para>
759 <para><emphasis>PASSED
</emphasis> shows how long has passed since the timer last ran.
</para>
760 <para><emphasis>UNIT
</emphasis> shows the name of the timer
</para>
761 <para><emphasis>ACTIVATES
</emphasis> shows the name the service the timer activates when it runs.
</para>
763 <para>Also see
<option>--all
</option> and
<option>--state=
</option>.
</para>
768 <term><command>start
<replaceable>PATTERN
</replaceable>…
</command></term>
771 <para>Start (activate) one or more units specified on the
774 <para>Note that glob patterns operate on the set of primary names of units currently in memory. Units which
775 are not active and are not in a failed state usually are not in memory, and will not be matched by any
776 pattern. In addition, in case of instantiated units, systemd is often unaware of the instance name until
777 the instance has been started. Therefore, using glob patterns with
<command>start
</command> has limited
778 usefulness. Also, secondary alias names of units are not considered.
</para>
782 <term><command>stop
<replaceable>PATTERN
</replaceable>…
</command></term>
785 <para>Stop (deactivate) one or more units specified on the
790 <term><command>reload
<replaceable>PATTERN
</replaceable>…
</command></term>
793 <para>Asks all units listed on the command line to reload
794 their configuration. Note that this will reload the
795 service-specific configuration, not the unit configuration
796 file of systemd. If you want systemd to reload the
797 configuration file of a unit, use the
798 <command>daemon-reload
</command> command. In other words:
799 for the example case of Apache, this will reload Apache's
800 <filename>httpd.conf
</filename> in the web server, not the
801 <filename>apache.service
</filename> systemd unit
804 <para>This command should not be confused with the
805 <command>daemon-reload
</command> command.
</para>
810 <term><command>restart
<replaceable>PATTERN
</replaceable>…
</command></term>
813 <para>Stop and then start one or more units specified on the command line. If the units are not running
814 yet, they will be started.
</para>
816 <para>Note that restarting a unit with this command does not necessarily flush out all of the unit's
817 resources before it is started again. For example, the per-service file descriptor storage facility (see
818 <varname>FileDescriptoreStoreMax=
</varname> in
819 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>) will
820 remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and
821 no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a
822 restart operation an explicit
<command>systemctl stop
</command> command followed by
<command>systemctl
823 start
</command> should be issued.
</para>
827 <term><command>try-restart
<replaceable>PATTERN
</replaceable>…
</command></term>
830 <para>Stop and then start one or more units specified on the
831 command line if the units are running. This does nothing
832 if units are not running.
</para>
833 <!-- Note that we don't document condrestart here, as that is just compatibility support, and we generally
834 don't document that. -->
838 <term><command>reload-or-restart
<replaceable>PATTERN
</replaceable>…
</command></term>
841 <para>Reload one or more units if they support it. If not, stop and then start them instead. If the units
842 are not running yet, they will be started.
</para>
846 <term><command>try-reload-or-restart
<replaceable>PATTERN
</replaceable>…
</command></term>
849 <para>Reload one or more units if they support it. If not, stop and then start them instead. This does
850 nothing if the units are not running.
</para>
851 <!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
852 don't document that. -->
856 <term><command>isolate
<replaceable>UNIT
</replaceable></command></term>
859 <para>Start the unit specified on the command line and its dependencies
860 and stop all others, unless they have
861 <option>IgnoreOnIsolate=yes
</option> (see
862 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
863 If a unit name with no extension is given, an extension of
864 <literal>.target
</literal> will be assumed.
</para>
866 <para>This is similar to changing the runlevel in a
867 traditional init system. The
<command>isolate
</command>
868 command will immediately stop processes that are not enabled
869 in the new unit, possibly including the graphical
870 environment or terminal you are currently using.
</para>
872 <para>Note that this is allowed only on units where
873 <option>AllowIsolate=
</option> is enabled. See
874 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
879 <term><command>kill
<replaceable>PATTERN
</replaceable>…
</command></term>
882 <para>Send a signal to one or more processes of the
883 unit. Use
<option>--kill-who=
</option> to select which
884 process to kill. Use
<option>--signal=
</option> to select
885 the signal to send.
</para>
889 <term><command>is-active
<replaceable>PATTERN
</replaceable>…
</command></term>
892 <para>Check whether any of the specified units are active
893 (i.e. running). Returns an exit code
894 <constant>0</constant> if at least one is active, or
895 non-zero otherwise. Unless
<option>--quiet
</option> is
896 specified, this will also print the current unit state to
897 standard output.
</para>
901 <term><command>is-failed
<replaceable>PATTERN
</replaceable>…
</command></term>
904 <para>Check whether any of the specified units are in a
905 "failed" state. Returns an exit code
906 <constant>0</constant> if at least one has failed,
907 non-zero otherwise. Unless
<option>--quiet
</option> is
908 specified, this will also print the current unit state to
909 standard output.
</para>
913 <term><command>status
</command> <optional><replaceable>PATTERN
</replaceable>…|
<replaceable>PID
</replaceable>…]
</optional></term>
916 <para>Show terse runtime status information about one or
917 more units, followed by most recent log data from the
918 journal. If no units are specified, show system status. If
919 combined with
<option>--all
</option>, also show the status of
920 all units (subject to limitations specified with
921 <option>-t
</option>). If a PID is passed, show information
922 about the unit the process belongs to.
</para>
924 <para>This function is intended to generate human-readable
925 output. If you are looking for computer-parsable output,
926 use
<command>show
</command> instead. By default, this
927 function only shows
10 lines of output and ellipsizes
928 lines to fit in the terminal window. This can be changed
929 with
<option>--lines
</option> and
<option>--full
</option>,
930 see above. In addition,
<command>journalctl
931 --unit=
<replaceable>NAME
</replaceable></command> or
933 --user-unit=
<replaceable>NAME
</replaceable></command> use
934 a similar filter for messages and might be more
938 <para>systemd implicitly loads units as necessary, so just running the
<command>status
</command> will
939 attempt to load a file. The command is thus not useful for determining if something was already loaded or
940 not. The units may possibly also be quickly unloaded after the operation is completed if there's no reason
941 to keep it in memory thereafter.
945 <title>Example output from systemctl status
</title>
947 <programlisting>$ systemctl status bluetooth
948 â—Ź bluetooth.service - Bluetooth service
949 Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
950 Active: active (running) since Wed
2017-
01-
04 13:
54:
04 EST;
1 weeks
0 days ago
951 Docs: man:bluetoothd(
8)
952 Main PID:
930 (bluetoothd)
957 CGroup: /system.slice/bluetooth.service
958 └─
930 /usr/lib/bluetooth/bluetoothd
960 Jan
12 10:
46:
45 example.com bluetoothd[
8900]: Not enough free handles to register service
961 Jan
12 10:
46:
45 example.com bluetoothd[
8900]: Current Time Service could not be registered
962 Jan
12 10:
46:
45 example.com bluetoothd[
8900]: gatt-time-server: Input/output error (
5)
965 <para>The dot (
"â—Ź") uses color on supported terminals to summarize the unit state at a glance. White
966 indicates an
<literal>inactive
</literal> or
<literal>deactivating
</literal> state. Red indicates a
967 <literal>failed
</literal> or
<literal>error
</literal> state and green indicates an
968 <literal>active
</literal>,
<literal>reloading
</literal> or
<literal>activating
</literal> state.
971 <para>The
"Loaded:" line in the output will show
<literal>loaded
</literal> if the unit has been loaded into
972 memory. Other possible values for
"Loaded:" include:
<literal>error
</literal> if there was a problem
973 loading it,
<literal>not-found
</literal>, and
<literal>masked
</literal>. Along with showing the path to
974 the unit file, this line will also show the enablement state. Enabled commands start at boot. See the
975 full table of possible enablement states — including the definition of
<literal>masked
</literal> — in the
976 documentation for the
<command>is-enabled
</command> command.
979 <para>The
"Active:" line shows active state. The value is usually
<literal>active
</literal> or
980 <literal>inactive
</literal>. Active could mean started, bound, plugged in, etc depending on the unit type.
981 The unit could also be in process of changing states, reporting a state of
<literal>activating
</literal> or
982 <literal>deactivating
</literal>. A special
<literal>failed
</literal> state is entered when the service
983 failed in some way, such as a crash, exiting with an error code or timing out. If the failed state is
984 entered the cause will be logged for later reference.
</para>
990 <term><command>show
</command> <optional><replaceable>PATTERN
</replaceable>…|
<replaceable>JOB
</replaceable>…
</optional></term>
993 <para>Show properties of one or more units, jobs, or the manager itself. If no argument is specified,
994 properties of the manager will be shown. If a unit name is specified, properties of the unit are shown, and
995 if a job ID is specified, properties of the job are shown. By default, empty properties are suppressed. Use
996 <option>--all
</option> to show those too. To select specific properties to show, use
997 <option>--property=
</option>. This command is intended to be used whenever computer-parsable output is
998 required. Use
<command>status
</command> if you are looking for formatted human-readable output.
</para>
1000 <para>Many properties shown by
<command>systemctl show
</command> map directly to configuration settings of
1001 the system and service manager and its unit files. Note that the properties shown by the command are
1002 generally more low-level, normalized versions of the original configuration settings and expose runtime
1003 state in addition to configuration. For example, properties shown for service units include the service's
1004 current main process identifier as
<literal>MainPID
</literal> (which is runtime state), and time settings
1005 are always exposed as properties ending in the
<literal>…USec
</literal> suffix even if a matching
1006 configuration options end in
<literal>…Sec
</literal>, because microseconds is the normalized time unit used
1007 by the system and service manager.
</para>
1011 <term><command>cat
<replaceable>PATTERN
</replaceable>…
</command></term>
1014 <para>Show backing files of one or more units. Prints the
1015 "fragment" and
"drop-ins" (source files) of units. Each
1016 file is preceded by a comment which includes the file
1017 name. Note that this shows the contents of the backing files
1018 on disk, which may not match the system manager's
1019 understanding of these units if any unit files were
1020 updated on disk and the
<command>daemon-reload
</command>
1021 command wasn't issued since.
</para>
1025 <term><command>set-property
<replaceable>UNIT
</replaceable> <replaceable>PROPERTY
</replaceable>=
<replaceable>VALUE
</replaceable>…
</command></term>
1028 <para>Set the specified unit properties at runtime where
1029 this is supported. This allows changing configuration
1030 parameter properties such as resource control settings at
1031 runtime. Not all properties may be changed at runtime, but
1032 many resource control settings (primarily those in
1033 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
1034 may. The changes are applied immediately, and stored on disk
1035 for future boots, unless
<option>--runtime
</option> is
1036 passed, in which case the settings only apply until the
1037 next reboot. The syntax of the property assignment follows
1038 closely the syntax of assignments in unit files.
</para>
1040 <para>Example:
<command>systemctl set-property foobar.service CPUShares=
777</command></para>
1042 <para>If the specified unit appears to be inactive, the
1043 changes will be only stored on disk as described
1044 previously hence they will be effective when the unit will
1047 <para>Note that this command allows changing multiple
1048 properties at the same time, which is preferable over
1049 setting them individually. Like with unit file configuration
1050 settings, assigning an empty list will reset the property.
1056 <term><command>help
<replaceable>PATTERN
</replaceable>…|
<replaceable>PID
</replaceable>…
</command></term>
1059 <para>Show manual pages for one or more units, if
1060 available. If a PID is given, the manual pages for the unit
1061 the process belongs to are shown.
</para>
1066 <term><command>reset-failed [
<replaceable>PATTERN
</replaceable>…]
</command></term>
1069 <para>Reset the
<literal>failed
</literal> state of the specified units, or if no unit name is passed, reset
1070 the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code,
1071 terminating abnormally or timing out), it will automatically enter the
<literal>failed
</literal> state and
1072 its exit code and status is recorded for introspection by the administrator until the service is
1073 stopped/re-started or reset with this command.
</para>
1079 <command>list-dependencies
</command>
1080 <optional><replaceable>UNIT
</replaceable></optional>
1084 <para>Shows units required and wanted by the specified
1085 unit. This recursively lists units following the
1086 <varname>Requires=
</varname>,
1087 <varname>Requisite=
</varname>,
1088 <varname>ConsistsOf=
</varname>,
1089 <varname>Wants=
</varname>,
<varname>BindsTo=
</varname>
1090 dependencies. If no unit is specified,
1091 <filename>default.target
</filename> is implied.
</para>
1093 <para>By default, only target units are recursively
1094 expanded. When
<option>--all
</option> is passed, all other
1095 units are recursively expanded as well.
</para>
1097 <para>Options
<option>--reverse
</option>,
1098 <option>--after
</option>,
<option>--before
</option>
1099 may be used to change what types of dependencies
1107 <title>Unit File Commands
</title>
1111 <term><command>list-unit-files
<optional><replaceable>PATTERN…
</replaceable></optional></command></term>
1114 <para>List unit files installed on the system, in combination with their enablement state (as reported by
1115 <command>is-enabled
</command>). If one or more
<replaceable>PATTERN
</replaceable>s are specified, only unit
1116 files whose name matches one of them are shown (patterns matching unit file system paths are not
1122 <term><command>enable
<replaceable>UNIT
</replaceable>…
</command></term>
1123 <term><command>enable
<replaceable>PATH
</replaceable>…
</command></term>
1126 <para>Enable one or more units or unit instances. This will create a set of symlinks, as encoded in the
1127 <literal>[Install]
</literal> sections of the indicated unit files. After the symlinks have been created,
1128 the system manager configuration is reloaded (in a way equivalent to
<command>daemon-reload
</command>), in
1129 order to ensure the changes are taken into account immediately. Note that this does
1130 <emphasis>not
</emphasis> have the effect of also starting any of the units being enabled. If this is
1131 desired, combine this command with the
<option>--now
</option> switch, or invoke
<command>start
</command>
1132 with appropriate arguments later. Note that in case of unit instance enablement (i.e. enablement of units of
1133 the form
<filename>foo@bar.service
</filename>), symlinks named the same as instances are created in the
1134 unit configuration directory, however they point to the single template unit file they are instantiated
1137 <para>This command expects either valid unit names (in which case various unit file directories are
1138 automatically searched for unit files with appropriate names), or absolute paths to unit files (in which
1139 case these files are read directly). If a specified unit file is located outside of the usual unit file
1140 directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring
1141 it is found when requested by commands such as
<command>start
</command>. The file system where the linked
1142 unit files are located must be accessible when systemd is started (e.g. anything underneath
1143 <filename>/home
</filename> or
<filename>/var
</filename> is not allowed, unless those directories are
1144 located on the root file system).
</para>
1146 <para>This command will print the file system operations executed. This output may be suppressed by passing
1147 <option>--quiet
</option>.
1150 <para>Note that this operation creates only the symlinks suggested in the
<literal>[Install]
</literal>
1151 section of the unit files. While this command is the recommended way to manipulate the unit configuration
1152 directory, the administrator is free to make additional changes manually by placing or removing symlinks
1153 below this directory. This is particularly useful to create configurations that deviate from the suggested
1154 default installation. In this case, the administrator must make sure to invoke
1155 <command>daemon-reload
</command> manually as necessary, in order to ensure the changes are taken into
1159 <para>Enabling units should not be confused with starting (activating) units, as done by the
1160 <command>start
</command> command. Enabling and starting units is orthogonal: units may be enabled without
1161 being started and started without being enabled. Enabling simply hooks the unit into various suggested
1162 places (for example, so that the unit is automatically started on boot or when a particular kind of
1163 hardware is plugged in). Starting actually spawns the daemon process (in case of service units), or binds
1164 the socket (in case of socket units), and so on.
</para>
1166 <para>Depending on whether
<option>--system
</option>,
<option>--user
</option>,
<option>--runtime
</option>,
1167 or
<option>--global
</option> is specified, this enables the unit for the system, for the calling user only,
1168 for only this boot of the system, or for all future logins of all users. Note that in the last case, no
1169 systemd daemon configuration is reloaded.
</para>
1171 <para>Using
<command>enable
</command> on masked units is not supported and results in an error.
</para>
1176 <term><command>disable
<replaceable>UNIT
</replaceable>…
</command></term>
1179 <para>Disables one or more units. This removes all symlinks to the unit files backing the specified units
1180 from the unit configuration directory, and hence undoes any changes made by
<command>enable
</command> or
1181 <command>link
</command>. Note that this removes
<emphasis>all
</emphasis> symlinks to matching unit files,
1182 including manually created symlinks, and not just those actually created by
<command>enable
</command> or
1183 <command>link
</command>. Note that while
<command>disable
</command> undoes the effect of
1184 <command>enable
</command>, the two commands are otherwise not symmetric, as
<command>disable
</command> may
1185 remove more symlinks than a prior
<command>enable
</command> invocation of the same unit created.
</para>
1187 <para>This command expects valid unit names only, it does not accept paths to unit files.
</para>
1189 <para>In addition to the units specified as arguments, all units are disabled that are listed in the
1190 <varname>Also=
</varname> setting contained in the
<literal>[Install]
</literal> section of any of the unit
1191 files being operated on.
</para>
1193 <para>This command implicitly reloads the system manager configuration after completing the operation. Note
1194 that this command does not implicitly stop the units that are being disabled. If this is desired, either
1195 combine this command with the
<option>--now
</option> switch, or invoke the
<command>stop
</command> command
1196 with appropriate arguments later.
</para>
1198 <para>This command will print information about the file system operations (symlink removals)
1199 executed. This output may be suppressed by passing
<option>--quiet
</option>.
1202 <para>This command honors
<option>--system
</option>,
<option>--user
</option>,
<option>--runtime
</option>
1203 and
<option>--global
</option> in a similar way as
<command>enable
</command>.
</para>
1208 <term><command>reenable
<replaceable>UNIT
</replaceable>…
</command></term>
1211 <para>Reenable one or more units, as specified on the command line. This is a combination of
1212 <command>disable
</command> and
<command>enable
</command> and is useful to reset the symlinks a unit file is
1213 enabled with to the defaults configured in its
<literal>[Install]
</literal> section. This command expects
1214 a unit name only, it does not accept paths to unit files.
</para>
1219 <term><command>preset
<replaceable>UNIT
</replaceable>…
</command></term>
1222 <para>Reset the enable/disable status one or more unit files, as specified on
1223 the command line, to the defaults configured in the preset policy files. This
1224 has the same effect as
<command>disable
</command> or
1225 <command>enable
</command>, depending how the unit is listed in the preset
1228 <para>Use
<option>--preset-mode=
</option> to control whether units shall be
1229 enabled and disabled, or only enabled, or only disabled.
</para>
1231 <para>If the unit carries no install information, it will be silently ignored
1232 by this command.
<replaceable>UNIT
</replaceable> must be the real unit name,
1233 any alias names are ignored silently.
</para>
1235 <para>For more information on the preset policy format, see
1236 <citerefentry><refentrytitle>systemd.preset
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1237 For more information on the concept of presets, please consult the
1238 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/Preset">Preset
</ulink>
1244 <term><command>preset-all
</command></term>
1247 <para>Resets all installed unit files to the defaults
1248 configured in the preset policy file (see above).
</para>
1250 <para>Use
<option>--preset-mode=
</option> to control
1251 whether units shall be enabled and disabled, or only
1252 enabled, or only disabled.
</para>
1257 <term><command>is-enabled
<replaceable>UNIT
</replaceable>…
</command></term>
1260 <para>Checks whether any of the specified unit files are
1261 enabled (as with
<command>enable
</command>). Returns an
1262 exit code of
0 if at least one is enabled, non-zero
1263 otherwise. Prints the current enable status (see table).
1264 To suppress this output, use
<option>--quiet
</option>.
1265 To show installation targets, use
<option>--full
</option>.
1270 <command>is-enabled
</command> output
1277 <entry>Description
</entry>
1278 <entry>Exit Code
</entry>
1283 <entry><literal>enabled
</literal></entry>
1284 <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>
1285 <entry morerows='
1'
>0</entry>
1288 <entry><literal>enabled-runtime
</literal></entry>
1291 <entry><literal>linked
</literal></entry>
1292 <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>
1293 <entry morerows='
1'
>> 0</entry>
1296 <entry><literal>linked-runtime
</literal></entry>
1299 <entry><literal>masked
</literal></entry>
1300 <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>
1301 <entry morerows='
1'
>> 0</entry>
1304 <entry><literal>masked-runtime
</literal></entry>
1307 <entry><literal>static
</literal></entry>
1308 <entry>The unit file is not enabled, and has no provisions for enabling in the
<literal>[Install]
</literal> unit file section.
</entry>
1312 <entry><literal>indirect
</literal></entry>
1313 <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>
1317 <entry><literal>disabled
</literal></entry>
1318 <entry>The unit file is not enabled, but contains an
<literal>[Install]
</literal> section with installation instructions.
</entry>
1319 <entry>> 0</entry>
1322 <entry><literal>generated
</literal></entry>
1323 <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>
1327 <entry><literal>transient
</literal></entry>
1328 <entry>The unit file has been created dynamically with the runtime API. Transient units may not be enabled.
</entry>
1332 <entry><literal>bad
</literal></entry>
1333 <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>
1334 <entry>> 0</entry>
1344 <term><command>mask
<replaceable>UNIT
</replaceable>…
</command></term>
1347 <para>Mask one or more units, as specified on the command line. This will link these unit files to
1348 <filename>/dev/null
</filename>, making it impossible to start them. This is a stronger version of
1349 <command>disable
</command>, since it prohibits all kinds of activation of the unit, including enablement
1350 and manual activation. Use this option with care. This honors the
<option>--runtime
</option> option to only
1351 mask temporarily until the next reboot of the system. The
<option>--now
</option> option may be used to
1352 ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit
1358 <term><command>unmask
<replaceable>UNIT
</replaceable>…
</command></term>
1361 <para>Unmask one or more unit files, as specified on the command line. This will undo the effect of
1362 <command>mask
</command>. This command expects valid unit names only, it does not accept unit file
1368 <term><command>link
<replaceable>PATH
</replaceable>…
</command></term>
1371 <para>Link a unit file that is not in the unit file search paths into the unit file search path. This
1372 command expects an absolute path to a unit file. The effect of this may be undone with
1373 <command>disable
</command>. The effect of this command is that a unit file is made available for commands
1374 such as
<command>start
</command>, even though it is not installed directly in the unit search path. The
1375 file system where the linked unit files are located must be accessible when systemd is started
1376 (e.g. anything underneath
<filename>/home
</filename> or
<filename>/var
</filename> is not allowed, unless
1377 those directories are located on the root file system).
</para>
1382 <term><command>revert
<replaceable>UNIT
</replaceable>…
</command></term>
1385 <para>Revert one or more unit files to their vendor versions. This command removes drop-in configuration
1386 files that modify the specified units, as well as any user-configured unit file that overrides a matching
1387 vendor supplied unit file. Specifically, for a unit
<literal>foo.service
</literal> the matching directories
1388 <literal>foo.service.d/
</literal> with all their contained files are removed, both below the persistent and
1389 runtime configuration directories (i.e. below
<filename>/etc/systemd/system
</filename> and
1390 <filename>/run/systemd/system
</filename>); if the unit file has a vendor-supplied version (i.e. a unit file
1391 located below
<filename>/usr
</filename>) any matching persistent or runtime unit file that overrides it is
1392 removed, too. Note that if a unit file has no vendor-supplied version (i.e. is only defined below
1393 <filename>/etc/systemd/system
</filename> or
<filename>/run/systemd/system
</filename>, but not in a unit
1394 file stored below
<filename>/usr
</filename>), then it is not removed. Also, if a unit is masked, it is
1397 <para>Effectively, this command may be used to undo all changes made with
<command>systemctl
1398 edit
</command>,
<command>systemctl set-property
</command> and
<command>systemctl mask
</command> and puts
1399 the original unit file with its settings back in effect.
</para>
1404 <term><command>add-wants
<replaceable>TARGET
</replaceable>
1405 <replaceable>UNIT
</replaceable>…
</command></term>
1406 <term><command>add-requires
<replaceable>TARGET
</replaceable>
1407 <replaceable>UNIT
</replaceable>…
</command></term>
1410 <para>Adds
<literal>Wants=
</literal> or
<literal>Requires=
</literal>
1411 dependencies, respectively, to the specified
1412 <replaceable>TARGET
</replaceable> for one or more units.
</para>
1414 <para>This command honors
<option>--system
</option>,
1415 <option>--user
</option>,
<option>--runtime
</option> and
1416 <option>--global
</option> in a way similar to
1417 <command>enable
</command>.
</para>
1423 <term><command>edit
<replaceable>UNIT
</replaceable>…
</command></term>
1426 <para>Edit a drop-in snippet or a whole replacement file if
1427 <option>--full
</option> is specified, to extend or override the
1428 specified unit.
</para>
1430 <para>Depending on whether
<option>--system
</option> (the default),
1431 <option>--user
</option>, or
<option>--global
</option> is specified,
1432 this command creates a drop-in file for each unit either for the system,
1433 for the calling user, or for all futures logins of all users. Then,
1434 the editor (see the
"Environment" section below) is invoked on
1435 temporary files which will be written to the real location if the
1436 editor exits successfully.
</para>
1438 <para>If
<option>--full
</option> is specified, this will copy the
1439 original units instead of creating drop-in files.
</para>
1441 <para>If
<option>--force
</option> is specified and any units do
1442 not already exist, new unit files will be opened for editing.
</para>
1444 <para>If
<option>--runtime
</option> is specified, the changes will
1445 be made temporarily in
<filename>/run
</filename> and they will be
1446 lost on the next reboot.
</para>
1448 <para>If the temporary file is empty upon exit, the modification of
1449 the related unit is canceled.
</para>
1451 <para>After the units have been edited, systemd configuration is
1452 reloaded (in a way that is equivalent to
<command>daemon-reload
</command>).
1455 <para>Note that this command cannot be used to remotely edit units
1456 and that you cannot temporarily edit units which are in
1457 <filename>/etc
</filename>, since they take precedence over
1458 <filename>/run
</filename>.
</para>
1463 <term><command>get-default
</command></term>
1466 <para>Return the default target to boot into. This returns
1467 the target unit name
<filename>default.target
</filename>
1468 is aliased (symlinked) to.
</para>
1473 <term><command>set-default
<replaceable>TARGET
</replaceable></command></term>
1476 <para>Set the default target to boot into. This sets
1477 (symlinks) the
<filename>default.target
</filename> alias
1478 to the given target unit.
</para>
1486 <title>Machine Commands
</title>
1490 <term><command>list-machines
<optional><replaceable>PATTERN
</replaceable>…
</optional></command></term>
1493 <para>List the host and all running local containers with
1494 their state. If one or more
1495 <replaceable>PATTERN
</replaceable>s are specified, only
1496 containers matching one of them are shown.
1504 <title>Job Commands
</title>
1508 <term><command>list-jobs
<optional><replaceable>PATTERN…
</replaceable></optional></command></term>
1511 <para>List jobs that are in progress. If one or more
1512 <replaceable>PATTERN
</replaceable>s are specified, only
1513 jobs for units matching one of them are shown.
</para>
1515 <para>When combined with
<option>--after
</option> or
<option>--before
</option> the list is augmented with
1516 information on which other job each job is waiting for, and which other jobs are waiting for it, see
1521 <term><command>cancel
<replaceable>JOB
</replaceable>…
</command></term>
1524 <para>Cancel one or more jobs specified on the command line
1525 by their numeric job IDs. If no job ID is specified, cancel
1526 all pending jobs.
</para>
1533 <title>Environment Commands
</title>
1537 <term><command>show-environment
</command></term>
1540 <para>Dump the systemd manager environment block. This is the environment
1541 block that is passed to all processes the manager spawns. The environment
1542 block will be dumped in straight-forward form suitable for sourcing into
1543 most shells. If no special characters or whitespace is present in the variable
1544 values, no escaping is performed, and the assignments have the form
1545 <literal>VARIABLE=value
</literal>. If whitespace or characters which have
1546 special meaning to the shell are present, dollar-single-quote escaping is
1547 used, and assignments have the form
<literal>VARIABLE=$'value'
</literal>.
1548 This syntax is known to be supported by
1549 <citerefentry project='die-net'
><refentrytitle>bash
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1550 <citerefentry project='die-net'
><refentrytitle>zsh
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1551 <citerefentry project='die-net'
><refentrytitle>ksh
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1553 <citerefentry project='die-net'
><refentrytitle>busybox
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
1554 <citerefentry project='die-net'
><refentrytitle>ash
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1556 <citerefentry project='die-net'
><refentrytitle>dash
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1558 <citerefentry project='die-net'
><refentrytitle>fish
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1563 <term><command>set-environment
<replaceable>VARIABLE=VALUE
</replaceable>…
</command></term>
1566 <para>Set one or more systemd manager environment variables,
1567 as specified on the command line.
</para>
1571 <term><command>unset-environment
<replaceable>VARIABLE
</replaceable>…
</command></term>
1574 <para>Unset one or more systemd manager environment
1575 variables. If only a variable name is specified, it will be
1576 removed regardless of its value. If a variable and a value
1577 are specified, the variable is only removed if it has the
1578 specified value.
</para>
1583 <command>import-environment
</command>
1584 <optional><replaceable>VARIABLE…
</replaceable></optional>
1588 <para>Import all, one or more environment variables set on
1589 the client into the systemd manager environment block. If
1590 no arguments are passed, the entire environment block is
1591 imported. Otherwise, a list of one or more environment
1592 variable names should be passed, whose client-side values
1593 are then imported into the manager's environment
1601 <title>Manager Lifecycle Commands
</title>
1605 <term><command>daemon-reload
</command></term>
1608 <para>Reload the systemd manager configuration. This will
1609 rerun all generators (see
1610 <citerefentry><refentrytitle>systemd.generator
</refentrytitle><manvolnum>7</manvolnum></citerefentry>),
1611 reload all unit files, and recreate the entire dependency
1612 tree. While the daemon is being reloaded, all sockets
1613 systemd listens on behalf of user configuration will stay
1616 <para>This command should not be confused with the
1617 <command>reload
</command> command.
</para>
1621 <term><command>daemon-reexec
</command></term>
1624 <para>Reexecute the systemd manager. This will serialize the
1625 manager state, reexecute the process and deserialize the
1626 state again. This command is of little use except for
1627 debugging and package upgrades. Sometimes, it might be
1628 helpful as a heavy-weight
<command>daemon-reload
</command>.
1629 While the daemon is being reexecuted, all sockets systemd listening
1630 on behalf of user configuration will stay accessible.
1638 <title>System Commands
</title>
1642 <term><command>is-system-running
</command></term>
1645 <para>Checks whether the system is operational. This
1646 returns success (exit code
0) when the system is fully up
1647 and running, specifically not in startup, shutdown or
1648 maintenance mode, and with no failed services. Failure is
1649 returned otherwise (exit code non-zero). In addition, the
1650 current state is printed in a short string to standard
1651 output, see the table below. Use
<option>--quiet
</option> to
1652 suppress this output.
</para>
1655 <title><command>is-system-running
</command> output
</title>
1657 <colspec colname='name'
/>
1658 <colspec colname='description'
/>
1659 <colspec colname='exit-code'
/>
1663 <entry>Description
</entry>
1664 <entry>Exit Code
</entry>
1669 <entry><varname>initializing
</varname></entry>
1670 <entry><para>Early bootup, before
1671 <filename>basic.target
</filename> is reached
1672 or the
<varname>maintenance
</varname> state entered.
1674 <entry>> 0</entry>
1677 <entry><varname>starting
</varname></entry>
1678 <entry><para>Late bootup, before the job queue
1679 becomes idle for the first time, or one of the
1680 rescue targets are reached.
</para></entry>
1681 <entry>> 0</entry>
1684 <entry><varname>running
</varname></entry>
1685 <entry><para>The system is fully
1686 operational.
</para></entry>
1690 <entry><varname>degraded
</varname></entry>
1691 <entry><para>The system is operational but one or more
1692 units failed.
</para></entry>
1693 <entry>> 0</entry>
1696 <entry><varname>maintenance
</varname></entry>
1697 <entry><para>The rescue or emergency target is
1698 active.
</para></entry>
1699 <entry>> 0</entry>
1702 <entry><varname>stopping
</varname></entry>
1703 <entry><para>The manager is shutting
1704 down.
</para></entry>
1705 <entry>> 0</entry>
1708 <entry><varname>offline
</varname></entry>
1709 <entry><para>The manager is not
1710 running. Specifically, this is the operational
1711 state if an incompatible program is running as
1712 system manager (PID
1).
</para></entry>
1713 <entry>> 0</entry>
1716 <entry><varname>unknown
</varname></entry>
1717 <entry><para>The operational state could not be
1718 determined, due to lack of resources or another
1719 error cause.
</para></entry>
1720 <entry>> 0</entry>
1729 <term><command>default
</command></term>
1732 <para>Enter default mode. This is equivalent to
<command>systemctl isolate default.target
</command>. This
1733 operation is blocking by default, use
<option>--no-block
</option> to request asynchronous behavior.
</para>
1738 <term><command>rescue
</command></term>
1741 <para>Enter rescue mode. This is equivalent to
<command>systemctl isolate rescue.target
</command>. This
1742 operation is blocking by default, use
<option>--no-block
</option> to request asynchronous behavior.
</para>
1746 <term><command>emergency
</command></term>
1749 <para>Enter emergency mode. This is equivalent to
<command>systemctl isolate
1750 emergency.target
</command>. This operation is blocking by default, use
<option>--no-block
</option> to
1751 request asynchronous behavior.
</para>
1755 <term><command>halt
</command></term>
1758 <para>Shut down and halt the system. This is mostly equivalent to
<command>systemctl start halt.target
1759 --job-mode=replace-irreversibly --no-block
</command>, but also prints a wall message to all users. This command is
1760 asynchronous; it will return after the halt operation is enqueued, without waiting for it to complete. Note
1761 that this operation will simply halt the OS kernel after shutting down, leaving the hardware powered
1762 on. Use
<command>systemctl poweroff
</command> for powering off the system (see below).
</para>
1764 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1765 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1766 system halt. If
<option>--force
</option> is specified twice, the operation is immediately executed without
1767 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1768 <option>--force
</option> is specified twice the halt operation is executed by
<command>systemctl
</command>
1769 itself, and the system manager is not contacted. This means the command should succeed even when the system
1770 manager has crashed.
</para>
1774 <term><command>poweroff
</command></term>
1777 <para>Shut down and power-off the system. This is mostly equivalent to
<command>systemctl start
1778 poweroff.target --job-mode=replace-irreversibly --no-block
</command>, but also prints a wall message to all
1779 users. This command is asynchronous; it will return after the power-off operation is enqueued, without
1780 waiting for it to complete.
</para>
1782 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1783 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1784 powering off. If
<option>--force
</option> is specified twice, the operation is immediately executed without
1785 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1786 <option>--force
</option> is specified twice the power-off operation is executed by
1787 <command>systemctl
</command> itself, and the system manager is not contacted. This means the command should
1788 succeed even when the system manager has crashed.
</para>
1792 <term><command>reboot
<optional><replaceable>arg
</replaceable></optional></command></term>
1795 <para>Shut down and reboot the system. This is mostly equivalent to
<command>systemctl start reboot.target
1796 --job-mode=replace-irreversibly --no-block
</command>, but also prints a wall message to all users. This
1797 command is asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1800 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1801 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1802 reboot. If
<option>--force
</option> is specified twice, the operation is immediately executed without
1803 terminating any processes or unmounting any file systems. This may result in data loss. Note that when
1804 <option>--force
</option> is specified twice the reboot operation is executed by
1805 <command>systemctl
</command> itself, and the system manager is not contacted. This means the command should
1806 succeed even when the system manager has crashed.
</para>
1808 <para>If the optional argument
<replaceable>arg
</replaceable> is given, it will be passed as the optional
1809 argument to the
<citerefentry><refentrytitle>reboot
</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1810 system call. The value is architecture and firmware specific. As an example,
<literal>recovery
</literal>
1811 might be used to trigger system recovery, and
<literal>fota
</literal> might be used to trigger a
1812 <quote>firmware over the air
</quote> update.
</para>
1817 <term><command>kexec
</command></term>
1820 <para>Shut down and reboot the system via
<command>kexec
</command>. This is equivalent to
1821 <command>systemctl start kexec.target --job-mode=replace-irreversibly --no-block
</command>. This command is
1822 asynchronous; it will return after the reboot operation is enqueued, without waiting for it to
1825 <para>If combined with
<option>--force
</option>, shutdown of all running services is skipped, however all
1826 processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the
1832 <term><command>exit
<optional><replaceable>EXIT_CODE
</replaceable></optional></command></term>
1835 <para>Ask the service manager to quit. This is only supported for user service managers (i.e. in
1836 conjunction with the
<option>--user
</option> option) or in containers and is equivalent to
1837 <command>poweroff
</command> otherwise. This command is asynchronous; it will return after the exit
1838 operation is enqueued, without waiting for it to complete.
</para>
1840 <para>The service manager will exit with the specified exit code, if
1841 <replaceable>EXIT_CODE
</replaceable> is passed.
</para>
1846 <term><command>switch-root
<replaceable>ROOT
</replaceable> <optional><replaceable>INIT
</replaceable></optional></command></term>
1849 <para>Switches to a different root directory and executes a new system manager process below it. This is
1850 intended for usage in initial RAM disks (
"initrd"), and will transition from the initrd's system manager
1851 process (a.k.a.
"init" process) to the main system manager process which is loaded from the actual host
1852 volume. This call takes two arguments: the directory that is to become the new root directory, and the path
1853 to the new system manager binary below it to execute as PID
1. If the latter is omitted or the empty
1854 string, a systemd binary will automatically be searched for and used as init. If the system manager path is
1855 omitted, equal to the empty string or identical to the path to the systemd binary, the state of the
1856 initrd's system manager process is passed to the main system manager, which allows later introspection of
1857 the state of the services involved in the initrd boot phase.
</para>
1862 <term><command>suspend
</command></term>
1865 <para>Suspend the system. This will trigger activation of the special target unit
1866 <filename>suspend.target
</filename>. This command is asynchronous, and will return after the suspend
1867 operation is successfully enqueued. It will not wait for the suspend/resume cycle to complete.
</para>
1872 <term><command>hibernate
</command></term>
1875 <para>Hibernate the system. This will trigger activation of the special target unit
1876 <filename>hibernate.target
</filename>. This command is asynchronous, and will return after the hibernation
1877 operation is successfully enqueued. It will not wait for the hibernate/thaw cycle to complete.
</para>
1882 <term><command>hybrid-sleep
</command></term>
1885 <para>Hibernate and suspend the system. This will trigger activation of the special target unit
1886 <filename>hybrid-sleep.target
</filename>. This command is asynchronous, and will return after the hybrid
1887 sleep operation is successfully enqueued. It will not wait for the sleep/wake-up cycle to complete.
</para>
1894 <title>Parameter Syntax
</title>
1896 <para>Unit commands listed above take either a single unit name (designated as
<replaceable>UNIT
</replaceable>),
1897 or multiple unit specifications (designated as
<replaceable>PATTERN
</replaceable>…). In the first case, the
1898 unit name with or without a suffix must be given. If the suffix is not specified (unit name is
"abbreviated"),
1899 systemctl will append a suitable suffix,
<literal>.service
</literal> by default, and a type-specific suffix in
1900 case of commands which operate only on specific unit types. For example,
1901 <programlisting># systemctl start sshd
</programlisting> and
1902 <programlisting># systemctl start sshd.service
</programlisting>
1903 are equivalent, as are
1904 <programlisting># systemctl isolate default
</programlisting>
1906 <programlisting># systemctl isolate default.target
</programlisting>
1907 Note that (absolute) paths to device nodes are automatically converted to device unit names, and other (absolute)
1908 paths to mount unit names.
1909 <programlisting># systemctl status /dev/sda
1910 # systemctl status /home
</programlisting>
1912 <programlisting># systemctl status dev-sda.device
1913 # systemctl status home.mount
</programlisting>
1914 In the second case, shell-style globs will be matched against the primary names of all units currently in memory;
1915 literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit
1916 names always refer to exactly one unit, but globs may match zero units and this is not considered an
1919 <para>Glob patterns use
1920 <citerefentry project='man-pages'
><refentrytitle>fnmatch
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
1921 so normal shell-style globbing rules are used, and
1922 <literal>*
</literal>,
<literal>?
</literal>,
1923 <literal>[]
</literal> may be used. See
1924 <citerefentry project='man-pages'
><refentrytitle>glob
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1925 for more details. The patterns are matched against the primary names of
1926 units currently in memory, and patterns which do not match anything
1927 are silently skipped. For example:
1928 <programlisting># systemctl stop sshd@*.service
</programlisting>
1929 will stop all
<filename>sshd@.service
</filename> instances. Note that alias names of units, and units that aren't
1930 in memory are not considered for glob expansion.
1933 <para>For unit file commands, the specified
<replaceable>UNIT
</replaceable> should be the name of the unit file
1934 (possibly abbreviated, see above), or the absolute path to the unit file:
1935 <programlisting># systemctl enable foo.service
</programlisting>
1937 <programlisting># systemctl link /path/to/foo.service
</programlisting>
1944 <title>Exit status
</title>
1946 <para>On success,
0 is returned, a non-zero failure
1947 code otherwise.
</para>
1951 <title>Environment
</title>
1953 <variablelist class='environment-variables'
>
1955 <term><varname>$SYSTEMD_EDITOR
</varname></term>
1957 <listitem><para>Editor to use when editing units; overrides
1958 <varname>$EDITOR
</varname> and
<varname>$VISUAL
</varname>. If neither
1959 <varname>$SYSTEMD_EDITOR
</varname> nor
<varname>$EDITOR
</varname> nor
1960 <varname>$VISUAL
</varname> are present or if it is set to an empty
1961 string or if their execution failed, systemctl will try to execute well
1962 known editors in this order:
1963 <citerefentry project='die-net'
><refentrytitle>editor
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1964 <citerefentry project='die-net'
><refentrytitle>nano
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1965 <citerefentry project='die-net'
><refentrytitle>vim
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1966 <citerefentry project='die-net'
><refentrytitle>vi
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1970 <xi:include href=
"less-variables.xml" xpointer=
"pager"/>
1971 <xi:include href=
"less-variables.xml" xpointer=
"less"/>
1972 <xi:include href=
"less-variables.xml" xpointer=
"lesscharset"/>
1976 <title>See Also
</title>
1978 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1979 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1980 <citerefentry><refentrytitle>loginctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1981 <citerefentry><refentrytitle>machinectl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1982 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1983 <citerefentry><refentrytitle>systemd.resource-control
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1984 <citerefentry><refentrytitle>systemd.special
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1985 <citerefentry project='man-pages'
><refentrytitle>wall
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1986 <citerefentry><refentrytitle>systemd.preset
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1987 <citerefentry><refentrytitle>systemd.generator
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1988 <citerefentry project='man-pages'
><refentrytitle>glob
</refentrytitle><manvolnum>7</manvolnum></citerefentry>