1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
6 <refentry id=
"systemd.special">
9 <title>systemd.special
</title>
10 <productname>systemd
</productname>
14 <refentrytitle>systemd.special
</refentrytitle>
15 <manvolnum>7</manvolnum>
19 <refname>systemd.special
</refname>
20 <refpurpose>Special systemd units
</refpurpose>
23 <refsynopsisdiv><para>
24 <!-- sort alphabetically, targets first --><filename>basic.target
</filename>,
25 <filename>bluetooth.target
</filename>,
26 <filename>cryptsetup-pre.target
</filename>,
27 <filename>cryptsetup.target
</filename>,
28 <filename>ctrl-alt-del.target
</filename>,
29 <filename>boot-complete.target
</filename>,
30 <filename>default.target
</filename>,
31 <filename>emergency.target
</filename>,
32 <filename>exit.target
</filename>,
33 <filename>final.target
</filename>,
34 <filename>getty.target
</filename>,
35 <filename>getty-pre.target
</filename>,
36 <filename>graphical.target
</filename>,
37 <filename>halt.target
</filename>,
38 <filename>hibernate.target
</filename>,
39 <filename>hybrid-sleep.target
</filename>,
40 <filename>suspend-then-hibernate.target
</filename>,
41 <filename>initrd.target
</filename>,
42 <filename>initrd-fs.target
</filename>,
43 <filename>initrd-root-device.target
</filename>,
44 <filename>initrd-root-fs.target
</filename>,
45 <filename>kbrequest.target
</filename>,
46 <filename>kexec.target
</filename>,
47 <filename>local-fs-pre.target
</filename>,
48 <filename>local-fs.target
</filename>,
49 <filename>machines.target
</filename>
50 <filename>multi-user.target
</filename>,
51 <filename>network-online.target
</filename>,
52 <filename>network-pre.target
</filename>,
53 <filename>network.target
</filename>,
54 <filename>nss-lookup.target
</filename>,
55 <filename>nss-user-lookup.target
</filename>,
56 <filename>paths.target
</filename>,
57 <filename>poweroff.target
</filename>,
58 <filename>printer.target
</filename>,
59 <filename>reboot.target
</filename>,
60 <filename>remote-cryptsetup.target
</filename>,
61 <filename>remote-fs-pre.target
</filename>,
62 <filename>remote-fs.target
</filename>,
63 <filename>rescue.target
</filename>,
64 <filename>rpcbind.target
</filename>,
65 <filename>runlevel2.target
</filename>,
66 <filename>runlevel3.target
</filename>,
67 <filename>runlevel4.target
</filename>,
68 <filename>runlevel5.target
</filename>,
69 <filename>shutdown.target
</filename>,
70 <filename>sigpwr.target
</filename>,
71 <filename>sleep.target
</filename>,
72 <filename>slices.target
</filename>,
73 <filename>smartcard.target
</filename>,
74 <filename>sockets.target
</filename>,
75 <filename>sound.target
</filename>,
76 <filename>suspend.target
</filename>,
77 <filename>swap.target
</filename>,
78 <filename>sysinit.target
</filename>,
79 <filename>system-update.target
</filename>,
80 <filename>system-update-pre.target
</filename>,
81 <filename>time-set.target
</filename>,
82 <filename>time-sync.target
</filename>,
83 <filename>timers.target
</filename>,
84 <filename>umount.target
</filename>,
85 <filename>usb-gadget.target
</filename>,
86 <!-- slices --><filename>-.slice
</filename>,
87 <filename>system.slice
</filename>,
88 <filename>user.slice
</filename>,
89 <filename>machine.slice
</filename>,
90 <!-- the rest --><filename>-.mount
</filename>,
91 <filename>dbus.service
</filename>,
92 <filename>dbus.socket
</filename>,
93 <filename>display-manager.service
</filename>,
94 <filename>init.scope
</filename>,
95 <filename>syslog.socket
</filename>,
96 <filename>system-update-cleanup.service
</filename>
97 </para></refsynopsisdiv>
100 <title>Description
</title>
102 <para>A few units are treated specially by systemd. Many of them have
103 special internal semantics and cannot be renamed, while others simply
104 have a standard meaning and should be present on all systems.
</para>
108 <title>Units managed by the system's service manager
</title>
111 <title>Special System Units
</title>
115 <term><filename>-.mount
</filename></term>
117 <para>The root mount point, i.e. the mount unit for the
<filename>/
</filename>
118 path. This unit is unconditionally active, during the entire time the system is up, as
119 this mount point is where the basic userspace is running from.
</para>
124 <term><filename>basic.target
</filename></term>
126 <para>A special target unit covering basic boot-up.
</para>
128 <para>systemd automatically adds dependency of the type
129 <varname>After=
</varname> for this target unit to all
130 services (except for those with
131 <varname>DefaultDependencies=no
</varname>).
</para>
133 <para>Usually, this should pull-in all local mount points plus
134 <filename>/var
</filename>,
<filename>/tmp
</filename> and
135 <filename>/var/tmp
</filename>, swap devices, sockets, timers,
136 path units and other basic initialization necessary for general
137 purpose daemons. The mentioned mount points are special cased
138 to allow them to be remote.
141 <para>This target usually does not pull in any non-target units
142 directly, but rather does so indirectly via other early boot targets.
143 It is instead meant as a synchronization point for late boot
145 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
146 for details on the targets involved.
151 <term><filename>boot-complete.target
</filename></term>
153 <para>This target is intended as generic synchronization point for services that shall determine or act on
154 whether the boot process completed successfully. Order units that are required to succeed for a boot process
155 to be considered successful before this unit, and add a
<varname>Requires=
</varname> dependency from the
156 target unit to them. Order units that shall only run when the boot process is considered successful after the
157 target unit and pull in the target from it, also with
<varname>Requires=
</varname>. Note that by default this
158 target unit is not part of the initial boot transaction, but is supposed to be pulled in only if required by
159 units that want to run only on successful boots.
</para>
162 <citerefentry><refentrytitle>systemd-boot-check-no-failures.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
163 for a service that implements a generic system health check and orders itself before
164 <filename>boot-complete.target
</filename>.
</para>
167 <citerefentry><refentrytitle>systemd-bless-boot.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
168 for a service that propagates boot success information to the boot loader, and orders itself after
169 <filename>boot-complete.target
</filename>.
</para>
173 <term><filename>ctrl-alt-del.target
</filename></term>
175 <para>systemd starts this target whenever Control+Alt+Del is
176 pressed on the console. Usually, this should be aliased
177 (symlinked) to
<filename>reboot.target
</filename>.
</para>
181 <term><filename>cryptsetup.target
</filename></term>
183 <para>A target that pulls in setup services for all
184 encrypted block devices.
</para>
188 <term><filename>dbus.service
</filename></term>
190 <para>A special unit for the D-Bus bus daemon. As soon as
191 this service is fully started up systemd will connect to it
192 and register its service.
</para>
196 <term><filename>dbus.socket
</filename></term>
198 <para>A special unit for the D-Bus system bus socket. All
199 units with
<varname>Type=dbus
</varname> automatically gain a
200 dependency on this unit.
</para>
204 <term><filename>default.target
</filename></term>
206 <para>The default unit systemd starts at bootup. Usually, this should be aliased (symlinked) to
207 <filename>multi-user.target
</filename> or
<filename>graphical.target
</filename>. See
208 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
209 more discussion.
</para>
211 <para>The default unit systemd starts at bootup can be overridden with the
212 <varname>systemd.unit=
</varname> kernel command line option, or more conveniently, with the short
213 names like
<varname>single
</varname>,
<varname>rescue
</varname>,
<varname>1</varname>,
214 <varname>3</varname>,
<varname>5</varname>, …; see
215 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
219 <term><filename>display-manager.service
</filename></term>
221 <para>The display manager service. Usually, this should be
222 aliased (symlinked) to
<filename>gdm.service
</filename> or a
223 similar display manager service.
</para>
227 <term><filename>emergency.target
</filename></term>
229 <para>A special target unit that starts an emergency shell on the main console. This
230 target does not pull in any services or mounts. It is the most minimal version of
231 starting the system in order to acquire an interactive shell; the only processes running
232 are usually just the system manager (PID
1) and the shell process. This unit is supposed
233 to be used with the kernel command line option
<varname>systemd.unit=
</varname>; it is
234 also used when a file system check on a required file system fails, and boot-up cannot
235 continue. Compare with
<filename>rescue.target
</filename>, which serves a similar
236 purpose, but also starts the most basic services and mounts all file systems.
</para>
238 <para>Use the
<literal>systemd.unit=emergency.target
</literal> kernel command line
239 option to boot into this mode. A short alias for this kernel command line option is
240 <literal>emergency
</literal>, for compatibility with SysV.
</para>
242 <para>In many ways booting into
<filename>emergency.target
</filename> is similar to the
243 effect of booting with
<literal>init=/bin/sh
</literal> on the kernel command line,
244 except that emergency mode provides you with the full system and service manager, and
245 allows starting individual units in order to continue the boot process in steps.
</para>
249 <term><filename>exit.target
</filename></term>
251 <para>A special service unit for shutting down the system or
252 user service manager. It is equivalent to
253 <filename>poweroff.target
</filename> on non-container
254 systems, and also works in containers.
</para>
256 <para>systemd will start this unit when it receives the
257 <constant>SIGTERM
</constant> or
<constant>SIGINT
</constant>
258 signal when running as user service daemon.
</para>
260 <para>Normally, this (indirectly) pulls in
261 <filename>shutdown.target
</filename>, which in turn should be
262 conflicted by all units that want to be scheduled for
263 shutdown when the service manager starts to exit.
</para>
267 <term><filename>final.target
</filename></term>
269 <para>A special target unit that is used during the shutdown
270 logic and may be used to pull in late services after all
271 normal services are already terminated and all mounts
277 <term><filename>getty.target
</filename></term>
279 <para>A special target unit that pulls in statically
280 configured local TTY
<filename>getty
</filename> instances.
285 <term><filename>graphical.target
</filename></term>
287 <para>A special target unit for setting up a graphical login
288 screen. This pulls in
289 <filename>multi-user.target
</filename>.
</para>
291 <para>Units that are needed for graphical logins shall add
292 <varname>Wants=
</varname> dependencies for their unit to
293 this unit (or
<filename>multi-user.target
</filename>) during
294 installation. This is best configured via
295 <varname>WantedBy=graphical.target
</varname> in the unit's
296 <literal>[Install]
</literal> section.
</para>
300 <term><filename>hibernate.target
</filename></term>
302 <para>A special target unit for hibernating the system. This
303 pulls in
<filename>sleep.target
</filename>.
</para>
307 <term><filename>hybrid-sleep.target
</filename></term>
309 <para>A special target unit for hibernating and suspending
310 the system at the same time. This pulls in
311 <filename>sleep.target
</filename>.
</para>
315 <term><filename>suspend-then-hibernate.target
</filename></term>
317 <para>A special target unit for suspending the system for a period
318 of time, waking it and putting it into hibernate. This pulls in
319 <filename>sleep.target
</filename>.
</para>
324 <term><filename>halt.target
</filename></term>
326 <para>A special target unit for shutting down and halting
327 the system. Note that this target is distinct from
328 <filename>poweroff.target
</filename> in that it generally
329 really just halts the system rather than powering it
332 <para>Applications wanting to halt the system should not start this unit
333 directly, but should instead execute
<command>systemctl halt
</command>
334 (possibly with the
<option>--no-block
</option> option) or call
335 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
336 <command>org.freedesktop.systemd1.Manager.Halt
</command> D-Bus method
341 <term><filename>init.scope
</filename></term>
343 <para>This scope unit is where the system and service manager (PID
1) itself resides. It
344 is active as long as the system is running.
</para>
348 <term><filename>initrd.target
</filename></term>
350 <para>This is the default target in the initramfs, similar to
<filename>default.target
</filename>
351 in the main system. It is used to mount the real root and transition to it. See
352 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
353 more discussion.
</para>
357 <term><filename>initrd-fs.target
</filename></term>
359 <para><citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
360 automatically adds dependencies of type
361 <varname>Before=
</varname> to
362 <filename>sysroot-usr.mount
</filename> and all mount points
363 found in
<filename>/etc/fstab
</filename> that have
364 <option>x-initrd.mount
</option> and not have
365 <option>noauto
</option> mount options set.
</para>
369 <term><filename>initrd-root-device.target
</filename></term>
371 <para>A special initrd target unit that is reached when the root filesystem device is available, but before
373 <citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
375 <citerefentry><refentrytitle>systemd-gpt-auto-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
376 automatically setup the appropriate dependencies to make this happen.
381 <term><filename>initrd-root-fs.target
</filename></term>
383 <para><citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
384 automatically adds dependencies of type
385 <varname>Before=
</varname> to the
386 <filename>sysroot.mount
</filename> unit, which is generated
387 from the kernel command line.
392 <term><filename>kbrequest.target
</filename></term>
394 <para>systemd starts this target whenever Alt+ArrowUp is
395 pressed on the console. Note that any user with physical access
396 to the machine will be able to do this, without authentication,
397 so this should be used carefully.
</para>
401 <term><filename>kexec.target
</filename></term>
403 <para>A special target unit for shutting down and rebooting
404 the system via kexec.
</para>
406 <para>Applications wanting to reboot the system should not start this unit
407 directly, but should instead execute
<command>systemctl kexec
</command>
408 (possibly with the
<option>--no-block
</option> option) or call
409 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
410 <command>org.freedesktop.systemd1.Manager.KExec
</command> D-Bus method
415 <term><filename>local-fs.target
</filename></term>
417 <para><citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
418 automatically adds dependencies of type
419 <varname>Before=
</varname> to all mount units that refer to
420 local mount points for this target unit. In addition, it
421 adds dependencies of type
<varname>Wants=
</varname> to this
422 target unit for those mounts listed in
423 <filename>/etc/fstab
</filename> that have the
424 <option>auto
</option> mount option set.
</para>
428 <term><filename>machines.target
</filename></term>
430 <para>A standard target unit for starting all the containers
431 and other virtual machines. See
<filename>systemd-nspawn@.service
</filename>
432 for an example.
</para>
436 <term><filename>multi-user.target
</filename></term>
438 <para>A special target unit for setting up a multi-user
439 system (non-graphical). This is pulled in by
440 <filename>graphical.target
</filename>.
</para>
442 <para>Units that are needed for a multi-user system shall
443 add
<varname>Wants=
</varname> dependencies for their unit to
444 this unit during installation. This is best configured via
445 <varname>WantedBy=multi-user.target
</varname> in the unit's
446 <literal>[Install]
</literal> section.
</para>
450 <term><filename>network-online.target
</filename></term>
452 <para>Units that strictly require a configured network
453 connection should pull in
454 <filename>network-online.target
</filename> (via a
455 <varname>Wants=
</varname> type dependency) and order
456 themselves after it. This target unit is intended to pull in
457 a service that delays further execution until the network is
458 sufficiently set up. What precisely this requires is left to
459 the implementation of the network managing service.
</para>
461 <para>Note the distinction between this unit and
462 <filename>network.target
</filename>. This unit is an active
463 unit (i.e. pulled in by the consumer rather than the
464 provider of this functionality) and pulls in a service which
465 possibly adds substantial delays to further execution. In
466 contrast,
<filename>network.target
</filename> is a passive
467 unit (i.e. pulled in by the provider of the functionality,
468 rather than the consumer) that usually does not delay
469 execution much. Usually,
<filename>network.target
</filename>
470 is part of the boot of most systems, while
471 <filename>network-online.target
</filename> is not, except
472 when at least one unit requires it. Also see
<ulink
473 url=
"https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget">Running
474 Services After the Network is up
</ulink> for more
477 <para>All mount units for remote network file systems
478 automatically pull in this unit, and order themselves after
479 it. Note that networking daemons that simply provide
480 functionality to other hosts generally do not need to pull
483 <para>systemd automatically adds dependencies of type
<varname>Wants=
</varname> and
484 <varname>After=
</varname> for this target unit to all SysV init script service units
485 with an LSB header referring to the
<literal>$network
</literal> facility.
</para>
487 <para>Note that this unit is only useful during the original system start-up
488 logic. After the system has completed booting up, it will not track the online state of
489 the system anymore. Due to this it cannot be used as a network connection monitor
490 concept, it is purely a one-time system start-up concept.
</para>
494 <term><filename>paths.target
</filename></term>
496 <para>A special target unit that sets up all path units (see
497 <citerefentry><refentrytitle>systemd.path
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
498 for details) that shall be active after boot.
</para>
500 <para>It is recommended that path units installed by
501 applications get pulled in via
<varname>Wants=
</varname>
502 dependencies from this unit. This is best configured via a
503 <varname>WantedBy=paths.target
</varname> in the path unit's
504 <literal>[Install]
</literal> section.
</para>
508 <term><filename>poweroff.target
</filename></term>
510 <para>A special target unit for shutting down and powering
511 off the system.
</para>
513 <para>Applications wanting to power off the system should not start this unit
514 directly, but should instead execute
<command>systemctl poweroff
</command>
515 (possibly with the
<option>--no-block
</option> option) or call
516 <citerefentry><refentrytitle>systemd-logind
</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
517 <command>org.freedesktop.login1.Manager.PowerOff
</command> D-Bus method
520 <para><filename>runlevel0.target
</filename> is an alias for
521 this target unit, for compatibility with SysV.
</para>
525 <term><filename>reboot.target
</filename></term>
527 <para>A special target unit for shutting down and rebooting
530 <para>Applications wanting to reboot the system should not start this unit
531 directly, but should instead execute
<command>systemctl reboot
</command>
532 (possibly with the
<option>--no-block
</option> option) or call
533 <citerefentry><refentrytitle>systemd-logind
</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
534 <command>org.freedesktop.login1.Manager.Reboot
</command> D-Bus method
537 <para><filename>runlevel6.target
</filename> is an alias for
538 this target unit, for compatibility with SysV.
</para>
542 <term><filename>remote-cryptsetup.target
</filename></term>
544 <para>Similar to
<filename>cryptsetup.target
</filename>, but for encrypted
545 devices which are accessed over the network. It is used for
546 <citerefentry><refentrytitle>crypttab
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
547 entries marked with
<option>_netdev
</option>.
</para>
551 <term><filename>remote-fs.target
</filename></term>
553 <para>Similar to
<filename>local-fs.target
</filename>, but
554 for remote mount points.
</para>
556 <para>systemd automatically adds dependencies of type
557 <varname>After=
</varname> for this target unit to all SysV
558 init script service units with an LSB header referring to
559 the
<literal>$remote_fs
</literal> facility.
</para>
563 <term><filename>rescue.target
</filename></term>
565 <para>A special target unit that pulls in the base system (including system mounts) and
566 spawns a rescue shell. Isolate to this target in order to administer the system in
567 single-user mode with all file systems mounted but with no services running, except for
568 the most basic. Compare with
<filename>emergency.target
</filename>, which is much more
569 reduced and does not provide the file systems or most basic services. Compare with
570 <filename>multi-user.target
</filename>, this target could be seen as
571 <filename>single-user.target
</filename>.
</para>
573 <para><filename>runlevel1.target
</filename> is an alias for this target unit, for
574 compatibility with SysV.
</para>
576 <para>Use the
<literal>systemd.unit=rescue.target
</literal> kernel command line option
577 to boot into this mode. A short alias for this kernel command line option is
578 <literal>1</literal>, for compatibility with SysV.
</para>
582 <term><filename>runlevel2.target
</filename></term>
583 <term><filename>runlevel3.target
</filename></term>
584 <term><filename>runlevel4.target
</filename></term>
585 <term><filename>runlevel5.target
</filename></term>
587 <para>These are targets that are called whenever the SysV
588 compatibility code asks for runlevel
2,
3,
4,
5,
589 respectively. It is a good idea to make this an alias for
590 (i.e. symlink to)
<filename>graphical.target
</filename>
591 (for runlevel
5) or
<filename>multi-user.target
</filename>
596 <term><filename>shutdown.target
</filename></term>
598 <para>A special target unit that terminates the services on
599 system shutdown.
</para>
601 <para>Services that shall be terminated on system shutdown
602 shall add
<varname>Conflicts=
</varname> and
603 <varname>Before=
</varname> dependencies to this unit for
604 their service unit, which is implicitly done when
605 <varname>DefaultDependencies=yes
</varname> is set (the
610 <term><filename>sigpwr.target
</filename></term>
612 <para>A special target that is started when systemd receives
613 the SIGPWR process signal, which is normally sent by the
614 kernel or UPS daemons when power fails.
</para>
618 <term><filename>sleep.target
</filename></term>
620 <para>A special target unit that is pulled in by
621 <filename>suspend.target
</filename>,
622 <filename>hibernate.target
</filename> and
623 <filename>hybrid-sleep.target
</filename> and may be used to
624 hook units into the sleep state logic.
</para>
628 <term><filename>slices.target
</filename></term>
630 <para>A special target unit that sets up all slice units (see
631 <citerefentry><refentrytitle>systemd.slice
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
632 for details) that shall always be active after boot. By default the generic
633 <filename>system.slice
</filename> slice unit as well as the root slice unit
634 <filename>-.slice
</filename> are pulled in and ordered before this unit (see
637 <para>Adding slice units to
<filename>slices.target
</filename> is generally not
638 necessary. Instead, when some unit that uses
<varname>Slice=
</varname> is started, the
639 specified slice will be started automatically. Adding
640 <varname>WantedBy=slices.target
</varname> lines to the
<literal>[Install]
</literal>
641 section should only be done for units that need to be always active. In that case care
642 needs to be taken to avoid creating a loop through the automatic dependencies on
643 "parent" slices.
</para>
647 <term><filename>sockets.target
</filename></term>
649 <para>A special target unit that sets up all socket
651 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
652 for details) that shall be active after boot.
</para>
654 <para>Services that can be socket-activated shall add
655 <varname>Wants=
</varname> dependencies to this unit for
656 their socket unit during installation. This is best
657 configured via a
<varname>WantedBy=sockets.target
</varname>
658 in the socket unit's
<literal>[Install]
</literal>
663 <term><filename>suspend.target
</filename></term>
665 <para>A special target unit for suspending the system. This
666 pulls in
<filename>sleep.target
</filename>.
</para>
670 <term><filename>swap.target
</filename></term>
672 <para>Similar to
<filename>local-fs.target
</filename>, but
673 for swap partitions and swap files.
</para>
677 <term><filename>sysinit.target
</filename></term>
679 <para>systemd automatically adds dependencies of the types
680 <varname>Requires=
</varname> and
<varname>After=
</varname>
681 for this target unit to all services (except for those with
682 <varname>DefaultDependencies=no
</varname>).
</para>
684 <para>This target pulls in the services required for system
685 initialization. System services pulled in by this target should
686 declare
<varname>DefaultDependencies=no
</varname> and specify
687 all their dependencies manually, including access to anything
688 more than a read only root filesystem. For details on the
689 dependencies of this target, refer to
690 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
695 <term><filename>syslog.socket
</filename></term>
697 <para>The socket unit syslog implementations should listen
698 on. All userspace log messages will be made available on
699 this socket. For more information about syslog integration,
700 please consult the
<ulink
701 url=
"https://www.freedesktop.org/wiki/Software/systemd/syslog">Syslog
702 Interface
</ulink> document.
</para>
706 <term><filename>system-update.target
</filename></term>
707 <term><filename>system-update-pre.target
</filename></term>
708 <term><filename>system-update-cleanup.service
</filename></term>
710 <para>A special target unit that is used for offline system updates.
711 <citerefentry><refentrytitle>systemd-system-update-generator
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
712 will redirect the boot process to this target if
<filename>/system-update
</filename>
713 exists. For more information see
714 <citerefentry><refentrytitle>systemd.offline-updates
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
717 <para>Updates should happen before the
<filename>system-update.target
</filename> is
718 reached, and the services which implement them should cause the machine to reboot. The
719 main units executing the update should order themselves after
720 <filename>system-update-pre.target
</filename> but not pull it in. Services which want to
721 run during system updates only, but before the actual system update is executed should
722 order themselves before this unit and pull it in. As a safety measure, if this does not
723 happen, and
<filename>/system-update
</filename> still exists after
724 <filename>system-update.target
</filename> is reached,
725 <filename>system-update-cleanup.service
</filename> will remove this symlink and reboot
730 <term><filename>timers.target
</filename></term>
732 <para>A special target unit that sets up all timer units
734 <citerefentry><refentrytitle>systemd.timer
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
735 for details) that shall be active after boot.
</para>
737 <para>It is recommended that timer units installed by
738 applications get pulled in via
<varname>Wants=
</varname>
739 dependencies from this unit. This is best configured via
740 <varname>WantedBy=timers.target
</varname> in the timer
741 unit's
<literal>[Install]
</literal> section.
</para>
745 <term><filename>umount.target
</filename></term>
747 <para>A special target unit that unmounts all mount and
748 automount points on system shutdown.
</para>
750 <para>Mounts that shall be unmounted on system shutdown
751 shall add Conflicts dependencies to this unit for their
752 mount unit, which is implicitly done when
753 <varname>DefaultDependencies=yes
</varname> is set (the
762 <title>Special System Units for Devices
</title>
764 <para>Some target units are automatically pulled in as devices of
765 certain kinds show up in the system. These may be used to
766 automatically activate various services based on the specific type
767 of the available hardware.
</para>
771 <term><filename>bluetooth.target
</filename></term>
773 <para>This target is started automatically as soon as a
774 Bluetooth controller is plugged in or becomes available at
777 <para>This may be used to pull in Bluetooth management
778 daemons dynamically when Bluetooth hardware is found.
</para>
782 <term><filename>printer.target
</filename></term>
784 <para>This target is started automatically as soon as a
785 printer is plugged in or becomes available at boot.
</para>
787 <para>This may be used to pull in printer management daemons
788 dynamically when printer hardware is found.
</para>
792 <term><filename>smartcard.target
</filename></term>
794 <para>This target is started automatically as soon as a
795 smartcard controller is plugged in or becomes available at
798 <para>This may be used to pull in smartcard management
799 daemons dynamically when smartcard hardware is found.
</para>
803 <term><filename>sound.target
</filename></term>
805 <para>This target is started automatically as soon as a
806 sound card is plugged in or becomes available at
809 <para>This may be used to pull in audio management daemons
810 dynamically when audio hardware is found.
</para>
814 <term><filename>usb-gadget.target
</filename></term>
816 <para>This target is started automatically as soon as a
817 USB Device Controller becomes available at boot.
</para>
819 <para>This may be used to pull in usb gadget
820 dynamically when UDC hardware is found.
</para>
827 <title>Special Passive System Units
</title>
829 <para>A number of special system targets are defined that can be
830 used to properly order boot-up of optional services. These targets
831 are generally not part of the initial boot transaction, unless
832 they are explicitly pulled in by one of the implementing services.
833 Note specifically that these
<emphasis>passive
</emphasis> target
834 units are generally not pulled in by the consumer of a service,
835 but by the provider of the service. This means: a consuming
836 service should order itself after these targets (as appropriate),
837 but not pull it in. A providing service should order itself before
838 these targets (as appropriate) and pull it in (via a
839 <varname>Wants=
</varname> type dependency).
</para>
841 <para>Note that these passive units cannot be started manually,
842 i.e.
<literal>systemctl start time-sync.target
</literal> will fail
843 with an error. They can only be pulled in by dependency. This is
844 enforced since they exist for ordering purposes only and thus are
845 not useful as only unit within a transaction.
</para>
849 <term><filename>cryptsetup-pre.target
</filename></term>
851 <para>This passive target unit may be pulled in by services
852 that want to run before any encrypted block device is set
853 up. All encrypted block devices are set up after this target
854 has been reached. Since the shutdown order is implicitly the
855 reverse start-up order between units, this target is
856 particularly useful to ensure that a service is shut down
857 only after all encrypted block devices are fully
862 <term><filename>getty-pre.target
</filename></term>
864 <para>A special passive target unit. Users of this target
865 are expected to pull it in the boot transaction via
866 a dependency (e.g.
<varname>Wants=
</varname>). Order your
867 unit before this unit if you want to make use of the console
868 just before
<filename>getty
</filename> is started.
873 <term><filename>local-fs-pre.target
</filename></term>
875 <para>This target unit is
876 automatically ordered before
877 all local mount points marked
878 with
<option>auto
</option>
879 (see above). It can be used to
880 execute certain units before
881 all local mounts.
</para>
885 <term><filename>network.target
</filename></term>
887 <para>This unit is supposed to indicate when network
888 functionality is available, but it is only very weakly
889 defined what that is supposed to mean, with one exception:
890 at shutdown, a unit that is ordered after
891 <filename>network.target
</filename> will be stopped before
892 the network — to whatever level it might be set up then —
893 is shut down. It is hence useful when writing service files
894 that require network access on shutdown, which should order
895 themselves after this target, but not pull it in. Also see
896 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget">Running
897 Services After the Network is up
</ulink> for more
898 information. Also see
899 <filename>network-online.target
</filename> described
904 <term><filename>network-pre.target
</filename></term>
906 <para>This passive target unit may be pulled in by services
907 that want to run before any network is set up, for example
908 for the purpose of setting up a firewall. All network
909 management software orders itself after this target, but
910 does not pull it in.
</para>
914 <term><filename>nss-lookup.target
</filename></term>
916 <para>A target that should be used as synchronization point for all host/network name
917 service lookups. Note that this is independent of UNIX user/group name lookups for which
918 <filename>nss-user-lookup.target
</filename> should be used. All services for which the
919 availability of full host/network name resolution is essential should be ordered after
920 this target, but not pull it in. systemd automatically adds dependencies of type
921 <varname>After=
</varname> for this target unit to all SysV init script service units
922 with an LSB header referring to the
<literal>$named
</literal> facility.
</para>
926 <term><filename>nss-user-lookup.target
</filename></term>
928 <para>A target that should be used as synchronization point for all regular UNIX
929 user/group name service lookups. Note that this is independent of host/network name
930 lookups for which
<filename>nss-lookup.target
</filename> should be used. All services
931 for which the availability of the full user/group database is essential should be
932 ordered after this target, but not pull it in. All services which provide parts of the
933 user/group database should be ordered before this target, and pull it in. Note that this
934 unit is only relevant for regular users and groups — system users and groups are
935 required to be resolvable during earliest boot already, and hence do not need any
936 special ordering against this target.
</para>
940 <term><filename>remote-fs-pre.target
</filename></term>
942 <para>This target unit is automatically ordered before all
943 mount point units (see above) and cryptsetup devices
944 marked with the
<option>_netdev
</option>. It can be used to run
945 certain units before remote encrypted devices and mounts are established.
946 Note that this unit is generally not part of the initial
947 transaction, unless the unit that wants to be ordered before
948 all remote mounts pulls it in via a
949 <varname>Wants=
</varname> type dependency. If the unit wants
950 to be pulled in by the first remote mount showing up, it
951 should use
<filename>network-online.target
</filename> (see
956 <term><filename>rpcbind.target
</filename></term>
958 <para>The portmapper/rpcbind pulls in this target and orders
959 itself before it, to indicate its availability. systemd
960 automatically adds dependencies of type
961 <varname>After=
</varname> for this target unit to all SysV
962 init script service units with an LSB header referring to
963 the
<literal>$portmap
</literal> facility.
</para>
967 <term><filename>time-set.target
</filename></term>
969 <para>Services responsible for setting the system clock from
970 a local source (such as a maintained timestamp file or
971 imprecise real-time clock) should pull in this target and
972 order themselves before it. Services where approximate time
973 is desired should be ordered after this unit, but not pull
974 it in. This target does not provide the accuracy guarantees
975 of
<filename>time-sync.target
</filename>.
</para>
979 <term><filename>time-sync.target
</filename></term>
981 <para>Services responsible for synchronizing the system
982 clock from a remote source (such as NTP client
983 implementations) should pull in this target and order
984 themselves before it. All services where correct time is
985 essential should be ordered after this unit, but not pull it
986 in. systemd automatically adds dependencies of type
987 <varname>After=
</varname> for this target unit to all SysV
988 init script service units with an LSB header referring to
989 the
<literal>$time
</literal> facility.
</para>
996 <title>Special Slice Units
</title>
998 <para>There are four
<literal>.slice
</literal> units which form the basis of the hierarchy for
999 assignment of resources for services, users, and virtual machines or containers. See
1000 <citerefentry><refentrytitle>systemd.slice
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1001 for details about slice units.
</para>
1005 <term><filename>-.slice
</filename></term>
1007 <para>The root slice is the root of the slice hierarchy. It usually does not contain
1008 units directly, but may be used to set defaults for the whole tree.
</para>
1013 <term><filename>system.slice
</filename></term>
1015 <para>By default, all system services started by
1016 <command>systemd
</command> are found in this slice.
</para>
1021 <term><filename>user.slice
</filename></term>
1023 <para>By default, all user processes and services started on
1024 behalf of the user, including the per-user systemd instance
1025 are found in this slice. This is pulled in by
1026 <filename>systemd-logind.service
</filename></para>
1031 <term><filename>machine.slice
</filename></term>
1033 <para>By default, all virtual machines and containers
1034 registered with
<command>systemd-machined
</command> are
1035 found in this slice. This is pulled in by
1036 <filename>systemd-machined.service
</filename></para>
1044 <title>Units managed by the user's service manager
</title>
1047 <title>Special User Units
</title>
1049 <para>When systemd runs as a user instance, the following special
1050 units are available:
</para>
1054 <term><filename>default.target
</filename></term>
1056 <para>This is the main target of the user session, started by default. Various services that
1057 compose the normal user session should be pulled into this target. In this regard,
1058 <filename>default.target
</filename> is similar to
<filename>multi-user.target
</filename> in the
1059 system instance, but it is a real unit, not an alias.
</para>
1064 <para>In addition, the following units are available which have definitions similar to their
1065 system counterparts:
1066 <filename>exit.target
</filename>,
1067 <filename>shutdown.target
</filename>,
1068 <filename>sockets.target
</filename>,
1069 <filename>timers.target
</filename>,
1070 <filename>paths.target
</filename>,
1071 <filename>bluetooth.target
</filename>,
1072 <filename>printer.target
</filename>,
1073 <filename>smartcard.target
</filename>,
1074 <filename>sound.target
</filename>.
</para>
1078 <title>Special Passive User Units
</title>
1082 <term><filename>graphical-session.target
</filename></term>
1084 <para>This target is active whenever any graphical session is running. It is used to
1085 stop user services which only apply to a graphical (X, Wayland, etc.) session when the
1086 session is terminated. Such services should have
1087 <literal>PartOf=graphical-session.target
</literal> in their
<literal>[Unit]
</literal>
1088 section. A target for a particular session (e. g.
1089 <filename>gnome-session.target
</filename>) starts and stops
1090 <literal>graphical-session.target
</literal> with
1091 <literal>BindsTo=graphical-session.target
</literal>.
</para>
1093 <para>Which services are started by a session target is determined by the
1094 <literal>Wants=
</literal> and
<literal>Requires=
</literal> dependencies. For services
1095 that can be enabled independently, symlinks in
<literal>.wants/
</literal> and
1096 <literal>.requires/
</literal> should be used, see
1097 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1098 Those symlinks should either be shipped in packages, or should be added dynamically
1099 after installation, for example using
<literal>systemctl add-wants
</literal>, see
1100 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1104 <title>Nautilus as part of a GNOME session
</title>
1106 <para><literal>gnome-session.target
</literal> pulls in Nautilus as top-level service:
</para>
1108 <programlisting>[Unit]
1109 Description=User systemd services for GNOME graphical session
1110 Wants=nautilus.service
1111 BindsTo=graphical-session.target
</programlisting>
1113 <para><literal>nautilus.service
</literal> gets stopped when the session stops:
</para>
1115 <programlisting>[Unit]
1116 Description=Render the desktop icons with Nautilus
1117 PartOf=graphical-session.target
1126 <term><filename>graphical-session-pre.target
</filename></term>
1128 <para>This target contains services which set up the environment or global configuration
1129 of a graphical session, such as SSH/GPG agents (which need to export an environment
1130 variable into all desktop processes) or migration of obsolete d-conf keys after an OS
1131 upgrade (which needs to happen before starting any process that might use them). This
1132 target must be started before starting a graphical session like
1133 <filename>gnome-session.target
</filename>.
</para>
1141 <title>See Also
</title>
1143 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1144 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1145 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1146 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1147 <citerefentry><refentrytitle>systemd.target
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1148 <citerefentry><refentrytitle>systemd.slice
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1149 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1150 <citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1151 <citerefentry><refentrytitle>user@.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>