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>blockdev@.target
</filename>,
30 <filename>boot-complete.target
</filename>,
31 <filename>default.target
</filename>,
32 <filename>emergency.target
</filename>,
33 <filename>exit.target
</filename>,
34 <filename>final.target
</filename>,
35 <filename>getty.target
</filename>,
36 <filename>getty-pre.target
</filename>,
37 <filename>graphical.target
</filename>,
38 <filename>halt.target
</filename>,
39 <filename>hibernate.target
</filename>,
40 <filename>hybrid-sleep.target
</filename>,
41 <filename>suspend-then-hibernate.target
</filename>,
42 <filename>initrd.target
</filename>,
43 <filename>initrd-fs.target
</filename>,
44 <filename>initrd-root-device.target
</filename>,
45 <filename>initrd-root-fs.target
</filename>,
46 <filename>kbrequest.target
</filename>,
47 <filename>kexec.target
</filename>,
48 <filename>local-fs-pre.target
</filename>,
49 <filename>local-fs.target
</filename>,
50 <filename>machines.target
</filename>
51 <filename>multi-user.target
</filename>,
52 <filename>network-online.target
</filename>,
53 <filename>network-pre.target
</filename>,
54 <filename>network.target
</filename>,
55 <filename>nss-lookup.target
</filename>,
56 <filename>nss-user-lookup.target
</filename>,
57 <filename>paths.target
</filename>,
58 <filename>poweroff.target
</filename>,
59 <filename>printer.target
</filename>,
60 <filename>reboot.target
</filename>,
61 <filename>remote-cryptsetup.target
</filename>,
62 <filename>remote-fs-pre.target
</filename>,
63 <filename>remote-fs.target
</filename>,
64 <filename>rescue.target
</filename>,
65 <filename>rpcbind.target
</filename>,
66 <filename>runlevel2.target
</filename>,
67 <filename>runlevel3.target
</filename>,
68 <filename>runlevel4.target
</filename>,
69 <filename>runlevel5.target
</filename>,
70 <filename>shutdown.target
</filename>,
71 <filename>sigpwr.target
</filename>,
72 <filename>sleep.target
</filename>,
73 <filename>slices.target
</filename>,
74 <filename>smartcard.target
</filename>,
75 <filename>sockets.target
</filename>,
76 <filename>sound.target
</filename>,
77 <filename>suspend.target
</filename>,
78 <filename>swap.target
</filename>,
79 <filename>sysinit.target
</filename>,
80 <filename>system-update.target
</filename>,
81 <filename>system-update-pre.target
</filename>,
82 <filename>time-set.target
</filename>,
83 <filename>time-sync.target
</filename>,
84 <filename>timers.target
</filename>,
85 <filename>umount.target
</filename>,
86 <filename>usb-gadget.target
</filename>,
87 <!-- slices --><filename>-.slice
</filename>,
88 <filename>system.slice
</filename>,
89 <filename>user.slice
</filename>,
90 <filename>machine.slice
</filename>,
91 <!-- the rest --><filename>-.mount
</filename>,
92 <filename>dbus.service
</filename>,
93 <filename>dbus.socket
</filename>,
94 <filename>display-manager.service
</filename>,
95 <filename>init.scope
</filename>,
96 <filename>syslog.socket
</filename>,
97 <filename>system-update-cleanup.service
</filename>
98 </para></refsynopsisdiv>
101 <title>Description
</title>
103 <para>A few units are treated specially by systemd. Many of them have
104 special internal semantics and cannot be renamed, while others simply
105 have a standard meaning and should be present on all systems.
</para>
109 <title>Units managed by the system's service manager
</title>
112 <title>Special System Units
</title>
116 <term><filename>-.mount
</filename></term>
118 <para>The root mount point, i.e. the mount unit for the
<filename>/
</filename>
119 path. This unit is unconditionally active, during the entire time the system is up, as
120 this mount point is where the basic userspace is running from.
</para>
125 <term><filename>basic.target
</filename></term>
127 <para>A special target unit covering basic boot-up.
</para>
129 <para>systemd automatically adds dependency of the type
130 <varname>After=
</varname> for this target unit to all
131 services (except for those with
132 <varname>DefaultDependencies=no
</varname>).
</para>
134 <para>Usually, this should pull-in all local mount points plus
135 <filename>/var
</filename>,
<filename>/tmp
</filename> and
136 <filename>/var/tmp
</filename>, swap devices, sockets, timers,
137 path units and other basic initialization necessary for general
138 purpose daemons. The mentioned mount points are special cased
139 to allow them to be remote.
142 <para>This target usually does not pull in any non-target units
143 directly, but rather does so indirectly via other early boot targets.
144 It is instead meant as a synchronization point for late boot
146 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
147 for details on the targets involved.
152 <term><filename>boot-complete.target
</filename></term>
154 <para>This target is intended as generic synchronization point for services that shall determine or act on
155 whether the boot process completed successfully. Order units that are required to succeed for a boot process
156 to be considered successful before this unit, and add a
<varname>Requires=
</varname> dependency from the
157 target unit to them. Order units that shall only run when the boot process is considered successful after the
158 target unit and pull in the target from it, also with
<varname>Requires=
</varname>. Note that by default this
159 target unit is not part of the initial boot transaction, but is supposed to be pulled in only if required by
160 units that want to run only on successful boots.
</para>
163 <citerefentry><refentrytitle>systemd-boot-check-no-failures.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
164 for a service that implements a generic system health check and orders itself before
165 <filename>boot-complete.target
</filename>.
</para>
168 <citerefentry><refentrytitle>systemd-bless-boot.service
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
169 for a service that propagates boot success information to the boot loader, and orders itself after
170 <filename>boot-complete.target
</filename>.
</para>
174 <term><filename>ctrl-alt-del.target
</filename></term>
176 <para>systemd starts this target whenever Control+Alt+Del is
177 pressed on the console. Usually, this should be aliased
178 (symlinked) to
<filename>reboot.target
</filename>.
</para>
182 <term><filename>cryptsetup.target
</filename></term>
184 <para>A target that pulls in setup services for all
185 encrypted block devices.
</para>
189 <term><filename>dbus.service
</filename></term>
191 <para>A special unit for the D-Bus bus daemon. As soon as
192 this service is fully started up systemd will connect to it
193 and register its service.
</para>
197 <term><filename>dbus.socket
</filename></term>
199 <para>A special unit for the D-Bus system bus socket. All
200 units with
<varname>Type=dbus
</varname> automatically gain a
201 dependency on this unit.
</para>
205 <term><filename>default.target
</filename></term>
207 <para>The default unit systemd starts at bootup. Usually, this should be aliased (symlinked) to
208 <filename>multi-user.target
</filename> or
<filename>graphical.target
</filename>. See
209 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
210 more discussion.
</para>
212 <para>The default unit systemd starts at bootup can be overridden with the
213 <varname>systemd.unit=
</varname> kernel command line option, or more conveniently, with the short
214 names like
<varname>single
</varname>,
<varname>rescue
</varname>,
<varname>1</varname>,
215 <varname>3</varname>,
<varname>5</varname>, …; see
216 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
</para>
220 <term><filename>display-manager.service
</filename></term>
222 <para>The display manager service. Usually, this should be
223 aliased (symlinked) to
<filename>gdm.service
</filename> or a
224 similar display manager service.
</para>
228 <term><filename>emergency.target
</filename></term>
230 <para>A special target unit that starts an emergency shell on the main console. This
231 target does not pull in other services or mounts. It is the most minimal version of
232 starting the system in order to acquire an interactive shell; the only processes running
233 are usually just the system manager (PID
1) and the shell process. This unit may be used
234 by specifying
<varname>emergency
</varname> on the kernel command line; it is
235 also used when a file system check on a required file system fails and boot-up cannot
236 continue. Compare with
<filename>rescue.target
</filename>, which serves a similar
237 purpose, but also starts the most basic services and mounts all file systems.
</para>
239 <para>In many ways booting into
<filename>emergency.target
</filename> is similar to the
240 effect of booting with
<literal>init=/bin/sh
</literal> on the kernel command line,
241 except that emergency mode provides you with the full system and service manager, and
242 allows starting individual units in order to continue the boot process in steps.
</para>
244 <para>Note that depending on how
<filename>emergency.target
</filename> is reached, the root file
245 system might be mounted read-only or read-write (no remounting is done specially for this
246 target). For example, the system may boot with root mounted read-only when
<varname>ro
</varname>
247 is used on the kernel command line and remain this way for
<filename>emergency.target
</filename>,
248 or the system may transition to
<filename>emergency.target
</filename> after the system has been
249 partially booted and disks have already been remounted read-write.
</para>
253 <term><filename>exit.target
</filename></term>
255 <para>A special service unit for shutting down the system or
256 user service manager. It is equivalent to
257 <filename>poweroff.target
</filename> on non-container
258 systems, and also works in containers.
</para>
260 <para>systemd will start this unit when it receives the
261 <constant>SIGTERM
</constant> or
<constant>SIGINT
</constant>
262 signal when running as user service daemon.
</para>
264 <para>Normally, this (indirectly) pulls in
265 <filename>shutdown.target
</filename>, which in turn should be
266 conflicted by all units that want to be scheduled for
267 shutdown when the service manager starts to exit.
</para>
271 <term><filename>final.target
</filename></term>
273 <para>A special target unit that is used during the shutdown
274 logic and may be used to pull in late services after all
275 normal services are already terminated and all mounts
281 <term><filename>getty.target
</filename></term>
283 <para>A special target unit that pulls in statically
284 configured local TTY
<filename>getty
</filename> instances.
289 <term><filename>graphical.target
</filename></term>
291 <para>A special target unit for setting up a graphical login
292 screen. This pulls in
293 <filename>multi-user.target
</filename>.
</para>
295 <para>Units that are needed for graphical logins shall add
296 <varname>Wants=
</varname> dependencies for their unit to
297 this unit (or
<filename>multi-user.target
</filename>) during
298 installation. This is best configured via
299 <varname>WantedBy=graphical.target
</varname> in the unit's
300 <literal>[Install]
</literal> section.
</para>
304 <term><filename>hibernate.target
</filename></term>
306 <para>A special target unit for hibernating the system. This
307 pulls in
<filename>sleep.target
</filename>.
</para>
311 <term><filename>hybrid-sleep.target
</filename></term>
313 <para>A special target unit for hibernating and suspending
314 the system at the same time. This pulls in
315 <filename>sleep.target
</filename>.
</para>
319 <term><filename>suspend-then-hibernate.target
</filename></term>
321 <para>A special target unit for suspending the system for a period
322 of time, waking it and putting it into hibernate. This pulls in
323 <filename>sleep.target
</filename>.
</para>
328 <term><filename>halt.target
</filename></term>
330 <para>A special target unit for shutting down and halting
331 the system. Note that this target is distinct from
332 <filename>poweroff.target
</filename> in that it generally
333 really just halts the system rather than powering it
336 <para>Applications wanting to halt the system should not start this unit
337 directly, but should instead execute
<command>systemctl halt
</command>
338 (possibly with the
<option>--no-block
</option> option) or call
339 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
340 <command>org.freedesktop.systemd1.Manager.Halt
</command> D-Bus method
345 <term><filename>init.scope
</filename></term>
347 <para>This scope unit is where the system and service manager (PID
1) itself resides. It
348 is active as long as the system is running.
</para>
352 <term><filename>initrd.target
</filename></term>
354 <para>This is the default target in the initramfs, similar to
<filename>default.target
</filename>
355 in the main system. It is used to mount the real root and transition to it. See
356 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
357 more discussion.
</para>
361 <term><filename>initrd-fs.target
</filename></term>
363 <para><citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
364 automatically adds dependencies of type
365 <varname>Before=
</varname> to
366 <filename>sysroot-usr.mount
</filename> and all mount points
367 found in
<filename>/etc/fstab
</filename> that have
368 <option>x-initrd.mount
</option> and not have
369 <option>noauto
</option> mount options set.
</para>
373 <term><filename>initrd-root-device.target
</filename></term>
375 <para>A special initrd target unit that is reached when the root filesystem device is available, but before
377 <citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
379 <citerefentry><refentrytitle>systemd-gpt-auto-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
380 automatically setup the appropriate dependencies to make this happen.
385 <term><filename>initrd-root-fs.target
</filename></term>
387 <para><citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
388 automatically adds dependencies of type
389 <varname>Before=
</varname> to the
390 <filename>sysroot.mount
</filename> unit, which is generated
391 from the kernel command line.
396 <term><filename>kbrequest.target
</filename></term>
398 <para>systemd starts this target whenever Alt+ArrowUp is
399 pressed on the console. Note that any user with physical access
400 to the machine will be able to do this, without authentication,
401 so this should be used carefully.
</para>
405 <term><filename>kexec.target
</filename></term>
407 <para>A special target unit for shutting down and rebooting
408 the system via kexec.
</para>
410 <para>Applications wanting to reboot the system should not start this unit
411 directly, but should instead execute
<command>systemctl kexec
</command>
412 (possibly with the
<option>--no-block
</option> option) or call
413 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
414 <command>org.freedesktop.systemd1.Manager.KExec
</command> D-Bus method
419 <term><filename>local-fs.target
</filename></term>
421 <para><citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>3</manvolnum></citerefentry>
422 automatically adds dependencies of type
423 <varname>Before=
</varname> to all mount units that refer to
424 local mount points for this target unit. In addition, it
425 adds dependencies of type
<varname>Wants=
</varname> to this
426 target unit for those mounts listed in
427 <filename>/etc/fstab
</filename> that have the
428 <option>auto
</option> mount option set.
</para>
432 <term><filename>machines.target
</filename></term>
434 <para>A standard target unit for starting all the containers
435 and other virtual machines. See
<filename>systemd-nspawn@.service
</filename>
436 for an example.
</para>
440 <term><filename>multi-user.target
</filename></term>
442 <para>A special target unit for setting up a multi-user
443 system (non-graphical). This is pulled in by
444 <filename>graphical.target
</filename>.
</para>
446 <para>Units that are needed for a multi-user system shall
447 add
<varname>Wants=
</varname> dependencies for their unit to
448 this unit during installation. This is best configured via
449 <varname>WantedBy=multi-user.target
</varname> in the unit's
450 <literal>[Install]
</literal> section.
</para>
454 <term><filename>network-online.target
</filename></term>
456 <para>Units that strictly require a configured network
457 connection should pull in
458 <filename>network-online.target
</filename> (via a
459 <varname>Wants=
</varname> type dependency) and order
460 themselves after it. This target unit is intended to pull in
461 a service that delays further execution until the network is
462 sufficiently set up. What precisely this requires is left to
463 the implementation of the network managing service.
</para>
465 <para>Note the distinction between this unit and
466 <filename>network.target
</filename>. This unit is an active
467 unit (i.e. pulled in by the consumer rather than the
468 provider of this functionality) and pulls in a service which
469 possibly adds substantial delays to further execution. In
470 contrast,
<filename>network.target
</filename> is a passive
471 unit (i.e. pulled in by the provider of the functionality,
472 rather than the consumer) that usually does not delay
473 execution much. Usually,
<filename>network.target
</filename>
474 is part of the boot of most systems, while
475 <filename>network-online.target
</filename> is not, except
476 when at least one unit requires it. Also see
<ulink
477 url=
"https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget">Running
478 Services After the Network is up
</ulink> for more
481 <para>All mount units for remote network file systems
482 automatically pull in this unit, and order themselves after
483 it. Note that networking daemons that simply provide
484 functionality to other hosts generally do not need to pull
487 <para>systemd automatically adds dependencies of type
<varname>Wants=
</varname> and
488 <varname>After=
</varname> for this target unit to all SysV init script service units
489 with an LSB header referring to the
<literal>$network
</literal> facility.
</para>
491 <para>Note that this unit is only useful during the original system start-up
492 logic. After the system has completed booting up, it will not track the online state of
493 the system anymore. Due to this it cannot be used as a network connection monitor
494 concept, it is purely a one-time system start-up concept.
</para>
498 <term><filename>paths.target
</filename></term>
500 <para>A special target unit that sets up all path units (see
501 <citerefentry><refentrytitle>systemd.path
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
502 for details) that shall be active after boot.
</para>
504 <para>It is recommended that path units installed by
505 applications get pulled in via
<varname>Wants=
</varname>
506 dependencies from this unit. This is best configured via a
507 <varname>WantedBy=paths.target
</varname> in the path unit's
508 <literal>[Install]
</literal> section.
</para>
512 <term><filename>poweroff.target
</filename></term>
514 <para>A special target unit for shutting down and powering
515 off the system.
</para>
517 <para>Applications wanting to power off the system should not start this unit
518 directly, but should instead execute
<command>systemctl poweroff
</command>
519 (possibly with the
<option>--no-block
</option> option) or call
520 <citerefentry><refentrytitle>systemd-logind
</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
521 <command>org.freedesktop.login1.Manager.PowerOff
</command> D-Bus method
524 <para><filename>runlevel0.target
</filename> is an alias for
525 this target unit, for compatibility with SysV.
</para>
529 <term><filename>reboot.target
</filename></term>
531 <para>A special target unit for shutting down and rebooting
534 <para>Applications wanting to reboot the system should not start this unit
535 directly, but should instead execute
<command>systemctl reboot
</command>
536 (possibly with the
<option>--no-block
</option> option) or call
537 <citerefentry><refentrytitle>systemd-logind
</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
538 <command>org.freedesktop.login1.Manager.Reboot
</command> D-Bus method
541 <para><filename>runlevel6.target
</filename> is an alias for
542 this target unit, for compatibility with SysV.
</para>
546 <term><filename>remote-cryptsetup.target
</filename></term>
548 <para>Similar to
<filename>cryptsetup.target
</filename>, but for encrypted
549 devices which are accessed over the network. It is used for
550 <citerefentry><refentrytitle>crypttab
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
551 entries marked with
<option>_netdev
</option>.
</para>
555 <term><filename>remote-fs.target
</filename></term>
557 <para>Similar to
<filename>local-fs.target
</filename>, but
558 for remote mount points.
</para>
560 <para>systemd automatically adds dependencies of type
561 <varname>After=
</varname> for this target unit to all SysV
562 init script service units with an LSB header referring to
563 the
<literal>$remote_fs
</literal> facility.
</para>
567 <term><filename>rescue.target
</filename></term>
569 <para>A special target unit that pulls in the base system (including system mounts) and
570 spawns a rescue shell. Isolate to this target in order to administer the system in
571 single-user mode with all file systems mounted but with no services running, except for
572 the most basic. Compare with
<filename>emergency.target
</filename>, which is much more
573 reduced and does not provide the file systems or most basic services. Compare with
574 <filename>multi-user.target
</filename>, this target could be seen as
575 <filename>single-user.target
</filename>.
</para>
577 <para><filename>runlevel1.target
</filename> is an alias for this target unit, for
578 compatibility with SysV.
</para>
580 <para>Use the
<literal>systemd.unit=rescue.target
</literal> kernel command line option
581 to boot into this mode. A short alias for this kernel command line option is
582 <literal>1</literal>, for compatibility with SysV.
</para>
586 <term><filename>runlevel2.target
</filename></term>
587 <term><filename>runlevel3.target
</filename></term>
588 <term><filename>runlevel4.target
</filename></term>
589 <term><filename>runlevel5.target
</filename></term>
591 <para>These are targets that are called whenever the SysV
592 compatibility code asks for runlevel
2,
3,
4,
5,
593 respectively. It is a good idea to make this an alias for
594 (i.e. symlink to)
<filename>graphical.target
</filename>
595 (for runlevel
5) or
<filename>multi-user.target
</filename>
600 <term><filename>shutdown.target
</filename></term>
602 <para>A special target unit that terminates the services on
603 system shutdown.
</para>
605 <para>Services that shall be terminated on system shutdown
606 shall add
<varname>Conflicts=
</varname> and
607 <varname>Before=
</varname> dependencies to this unit for
608 their service unit, which is implicitly done when
609 <varname>DefaultDependencies=yes
</varname> is set (the
614 <term><filename>sigpwr.target
</filename></term>
616 <para>A special target that is started when systemd receives
617 the SIGPWR process signal, which is normally sent by the
618 kernel or UPS daemons when power fails.
</para>
622 <term><filename>sleep.target
</filename></term>
624 <para>A special target unit that is pulled in by
625 <filename>suspend.target
</filename>,
626 <filename>hibernate.target
</filename> and
627 <filename>hybrid-sleep.target
</filename> and may be used to
628 hook units into the sleep state logic.
</para>
632 <term><filename>slices.target
</filename></term>
634 <para>A special target unit that sets up all slice units (see
635 <citerefentry><refentrytitle>systemd.slice
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
636 for details) that shall always be active after boot. By default the generic
637 <filename>system.slice
</filename> slice unit as well as the root slice unit
638 <filename>-.slice
</filename> are pulled in and ordered before this unit (see
641 <para>Adding slice units to
<filename>slices.target
</filename> is generally not
642 necessary. Instead, when some unit that uses
<varname>Slice=
</varname> is started, the
643 specified slice will be started automatically. Adding
644 <varname>WantedBy=slices.target
</varname> lines to the
<literal>[Install]
</literal>
645 section should only be done for units that need to be always active. In that case care
646 needs to be taken to avoid creating a loop through the automatic dependencies on
647 "parent" slices.
</para>
651 <term><filename>sockets.target
</filename></term>
653 <para>A special target unit that sets up all socket
655 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
656 for details) that shall be active after boot.
</para>
658 <para>Services that can be socket-activated shall add
659 <varname>Wants=
</varname> dependencies to this unit for
660 their socket unit during installation. This is best
661 configured via a
<varname>WantedBy=sockets.target
</varname>
662 in the socket unit's
<literal>[Install]
</literal>
667 <term><filename>suspend.target
</filename></term>
669 <para>A special target unit for suspending the system. This
670 pulls in
<filename>sleep.target
</filename>.
</para>
674 <term><filename>swap.target
</filename></term>
676 <para>Similar to
<filename>local-fs.target
</filename>, but
677 for swap partitions and swap files.
</para>
681 <term><filename>sysinit.target
</filename></term>
683 <para>systemd automatically adds dependencies of the types
684 <varname>Requires=
</varname> and
<varname>After=
</varname>
685 for this target unit to all services (except for those with
686 <varname>DefaultDependencies=no
</varname>).
</para>
688 <para>This target pulls in the services required for system
689 initialization. System services pulled in by this target should
690 declare
<varname>DefaultDependencies=no
</varname> and specify
691 all their dependencies manually, including access to anything
692 more than a read only root filesystem. For details on the
693 dependencies of this target, refer to
694 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
699 <term><filename>syslog.socket
</filename></term>
701 <para>The socket unit syslog implementations should listen
702 on. All userspace log messages will be made available on
703 this socket. For more information about syslog integration,
704 please consult the
<ulink
705 url=
"https://www.freedesktop.org/wiki/Software/systemd/syslog">Syslog
706 Interface
</ulink> document.
</para>
710 <term><filename>system-update.target
</filename></term>
711 <term><filename>system-update-pre.target
</filename></term>
712 <term><filename>system-update-cleanup.service
</filename></term>
714 <para>A special target unit that is used for offline system updates.
715 <citerefentry><refentrytitle>systemd-system-update-generator
</refentrytitle><manvolnum>8</manvolnum></citerefentry>
716 will redirect the boot process to this target if
<filename>/system-update
</filename>
717 exists. For more information see
718 <citerefentry><refentrytitle>systemd.offline-updates
</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
721 <para>Updates should happen before the
<filename>system-update.target
</filename> is
722 reached, and the services which implement them should cause the machine to reboot. The
723 main units executing the update should order themselves after
724 <filename>system-update-pre.target
</filename> but not pull it in. Services which want to
725 run during system updates only, but before the actual system update is executed should
726 order themselves before this unit and pull it in. As a safety measure, if this does not
727 happen, and
<filename>/system-update
</filename> still exists after
728 <filename>system-update.target
</filename> is reached,
729 <filename>system-update-cleanup.service
</filename> will remove this symlink and reboot
734 <term><filename>timers.target
</filename></term>
736 <para>A special target unit that sets up all timer units
738 <citerefentry><refentrytitle>systemd.timer
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
739 for details) that shall be active after boot.
</para>
741 <para>It is recommended that timer units installed by
742 applications get pulled in via
<varname>Wants=
</varname>
743 dependencies from this unit. This is best configured via
744 <varname>WantedBy=timers.target
</varname> in the timer
745 unit's
<literal>[Install]
</literal> section.
</para>
749 <term><filename>umount.target
</filename></term>
751 <para>A special target unit that unmounts all mount and
752 automount points on system shutdown.
</para>
754 <para>Mounts that shall be unmounted on system shutdown
755 shall add Conflicts dependencies to this unit for their
756 mount unit, which is implicitly done when
757 <varname>DefaultDependencies=yes
</varname> is set (the
766 <title>Special System Units for Devices
</title>
768 <para>Some target units are automatically pulled in as devices of
769 certain kinds show up in the system. These may be used to
770 automatically activate various services based on the specific type
771 of the available hardware.
</para>
775 <term><filename>bluetooth.target
</filename></term>
777 <para>This target is started automatically as soon as a
778 Bluetooth controller is plugged in or becomes available at
781 <para>This may be used to pull in Bluetooth management
782 daemons dynamically when Bluetooth hardware is found.
</para>
786 <term><filename>printer.target
</filename></term>
788 <para>This target is started automatically as soon as a
789 printer is plugged in or becomes available at boot.
</para>
791 <para>This may be used to pull in printer management daemons
792 dynamically when printer hardware is found.
</para>
796 <term><filename>smartcard.target
</filename></term>
798 <para>This target is started automatically as soon as a
799 smartcard controller is plugged in or becomes available at
802 <para>This may be used to pull in smartcard management
803 daemons dynamically when smartcard hardware is found.
</para>
807 <term><filename>sound.target
</filename></term>
809 <para>This target is started automatically as soon as a
810 sound card is plugged in or becomes available at
813 <para>This may be used to pull in audio management daemons
814 dynamically when audio hardware is found.
</para>
818 <term><filename>usb-gadget.target
</filename></term>
820 <para>This target is started automatically as soon as a
821 USB Device Controller becomes available at boot.
</para>
823 <para>This may be used to pull in usb gadget
824 dynamically when UDC hardware is found.
</para>
831 <title>Special Passive System Units
</title>
833 <para>A number of special system targets are defined that can be
834 used to properly order boot-up of optional services. These targets
835 are generally not part of the initial boot transaction, unless
836 they are explicitly pulled in by one of the implementing services.
837 Note specifically that these
<emphasis>passive
</emphasis> target
838 units are generally not pulled in by the consumer of a service,
839 but by the provider of the service. This means: a consuming
840 service should order itself after these targets (as appropriate),
841 but not pull it in. A providing service should order itself before
842 these targets (as appropriate) and pull it in (via a
843 <varname>Wants=
</varname> type dependency).
</para>
845 <para>Note that these passive units cannot be started manually,
846 i.e.
<literal>systemctl start time-sync.target
</literal> will fail
847 with an error. They can only be pulled in by dependency. This is
848 enforced since they exist for ordering purposes only and thus are
849 not useful as only unit within a transaction.
</para>
853 <term><filename>blockdev@.target
</filename></term>
854 <listitem><para>This template unit is used to order mount units and other consumers of block
855 devices after services that synthesize these block devices. In particular, this is intended to be
856 used with storage services (such as
857 <citerefentry><refentrytitle>systemd-cryptsetup@.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>)
858 that allocate and manage a virtual block device. Storage services are ordered before an instance of
859 <filename>blockdev@.target
</filename>, and the consumer units after it. The ordering is
860 particularly relevant during shutdown, as it ensures that the mount is deactivated first and the
861 service backing the mount later. The
<filename>blockdev@.target
</filename> instance should be
862 pulled in via a
<option>Wants=
</option> dependency of the storage daemon and thus generally not be
863 part of any transaction unless a storage daemon is used. The instance name for instances of this
864 template unit must be a properly escaped block device node path, e.g.
865 <filename>blockdev@dev-mapper-foobar.target
</filename> for the storage device
866 <filename>/dev/mapper/foobar
</filename>.
</para></listitem>
869 <term><filename>cryptsetup-pre.target
</filename></term>
871 <para>This passive target unit may be pulled in by services
872 that want to run before any encrypted block device is set
873 up. All encrypted block devices are set up after this target
874 has been reached. Since the shutdown order is implicitly the
875 reverse start-up order between units, this target is
876 particularly useful to ensure that a service is shut down
877 only after all encrypted block devices are fully
882 <term><filename>getty-pre.target
</filename></term>
884 <para>A special passive target unit. Users of this target
885 are expected to pull it in the boot transaction via
886 a dependency (e.g.
<varname>Wants=
</varname>). Order your
887 unit before this unit if you want to make use of the console
888 just before
<filename>getty
</filename> is started.
893 <term><filename>local-fs-pre.target
</filename></term>
895 <para>This target unit is
896 automatically ordered before
897 all local mount points marked
898 with
<option>auto
</option>
899 (see above). It can be used to
900 execute certain units before
901 all local mounts.
</para>
905 <term><filename>network.target
</filename></term>
907 <para>This unit is supposed to indicate when network
908 functionality is available, but it is only very weakly
909 defined what that is supposed to mean, with one exception:
910 at shutdown, a unit that is ordered after
911 <filename>network.target
</filename> will be stopped before
912 the network — to whatever level it might be set up then —
913 is shut down. It is hence useful when writing service files
914 that require network access on shutdown, which should order
915 themselves after this target, but not pull it in. Also see
916 <ulink url=
"https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget">Running
917 Services After the Network is up
</ulink> for more
918 information. Also see
919 <filename>network-online.target
</filename> described
924 <term><filename>network-pre.target
</filename></term>
926 <para>This passive target unit may be pulled in by services
927 that want to run before any network is set up, for example
928 for the purpose of setting up a firewall. All network
929 management software orders itself after this target, but
930 does not pull it in.
</para>
934 <term><filename>nss-lookup.target
</filename></term>
936 <para>A target that should be used as synchronization point for all host/network name
937 service lookups. Note that this is independent of UNIX user/group name lookups for which
938 <filename>nss-user-lookup.target
</filename> should be used. All services for which the
939 availability of full host/network name resolution is essential should be ordered after
940 this target, but not pull it in. systemd automatically adds dependencies of type
941 <varname>After=
</varname> for this target unit to all SysV init script service units
942 with an LSB header referring to the
<literal>$named
</literal> facility.
</para>
946 <term><filename>nss-user-lookup.target
</filename></term>
948 <para>A target that should be used as synchronization point for all regular UNIX
949 user/group name service lookups. Note that this is independent of host/network name
950 lookups for which
<filename>nss-lookup.target
</filename> should be used. All services
951 for which the availability of the full user/group database is essential should be
952 ordered after this target, but not pull it in. All services which provide parts of the
953 user/group database should be ordered before this target, and pull it in. Note that this
954 unit is only relevant for regular users and groups — system users and groups are
955 required to be resolvable during earliest boot already, and hence do not need any
956 special ordering against this target.
</para>
960 <term><filename>remote-fs-pre.target
</filename></term>
962 <para>This target unit is automatically ordered before all
963 mount point units (see above) and cryptsetup devices
964 marked with the
<option>_netdev
</option>. It can be used to run
965 certain units before remote encrypted devices and mounts are established.
966 Note that this unit is generally not part of the initial
967 transaction, unless the unit that wants to be ordered before
968 all remote mounts pulls it in via a
969 <varname>Wants=
</varname> type dependency. If the unit wants
970 to be pulled in by the first remote mount showing up, it
971 should use
<filename>network-online.target
</filename> (see
976 <term><filename>rpcbind.target
</filename></term>
978 <para>The portmapper/rpcbind pulls in this target and orders
979 itself before it, to indicate its availability. systemd
980 automatically adds dependencies of type
981 <varname>After=
</varname> for this target unit to all SysV
982 init script service units with an LSB header referring to
983 the
<literal>$portmap
</literal> facility.
</para>
987 <term><filename>time-set.target
</filename></term>
989 <para>Services responsible for setting the system clock from
990 a local source (such as a maintained timestamp file or
991 imprecise real-time clock) should pull in this target and
992 order themselves before it. Services where approximate time
993 is desired should be ordered after this unit, but not pull
994 it in. This target does not provide the accuracy guarantees
995 of
<filename>time-sync.target
</filename>.
</para>
999 <term><filename>time-sync.target
</filename></term>
1001 <para>Services responsible for synchronizing the system
1002 clock from a remote source (such as NTP client
1003 implementations) should pull in this target and order
1004 themselves before it. All services where correct time is
1005 essential should be ordered after this unit, but not pull it
1006 in. systemd automatically adds dependencies of type
1007 <varname>After=
</varname> for this target unit to all SysV
1008 init script service units with an LSB header referring to
1009 the
<literal>$time
</literal> facility.
</para>
1016 <title>Special Slice Units
</title>
1018 <para>There are four
<literal>.slice
</literal> units which form the basis of the hierarchy for
1019 assignment of resources for services, users, and virtual machines or containers. See
1020 <citerefentry><refentrytitle>systemd.slice
</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1021 for details about slice units.
</para>
1025 <term><filename>-.slice
</filename></term>
1027 <para>The root slice is the root of the slice hierarchy. It usually does not contain
1028 units directly, but may be used to set defaults for the whole tree.
</para>
1033 <term><filename>system.slice
</filename></term>
1035 <para>By default, all system services started by
1036 <command>systemd
</command> are found in this slice.
</para>
1041 <term><filename>user.slice
</filename></term>
1043 <para>By default, all user processes and services started on
1044 behalf of the user, including the per-user systemd instance
1045 are found in this slice. This is pulled in by
1046 <filename>systemd-logind.service
</filename></para>
1051 <term><filename>machine.slice
</filename></term>
1053 <para>By default, all virtual machines and containers
1054 registered with
<command>systemd-machined
</command> are
1055 found in this slice. This is pulled in by
1056 <filename>systemd-machined.service
</filename></para>
1064 <title>Units managed by the user's service manager
</title>
1067 <title>Special User Units
</title>
1069 <para>When systemd runs as a user instance, the following special
1070 units are available:
</para>
1074 <term><filename>default.target
</filename></term>
1076 <para>This is the main target of the user session, started by default. Various services that
1077 compose the normal user session should be pulled into this target. In this regard,
1078 <filename>default.target
</filename> is similar to
<filename>multi-user.target
</filename> in the
1079 system instance, but it is a real unit, not an alias.
</para>
1084 <para>In addition, the following units are available which have definitions similar to their
1085 system counterparts:
1086 <filename>exit.target
</filename>,
1087 <filename>shutdown.target
</filename>,
1088 <filename>sockets.target
</filename>,
1089 <filename>timers.target
</filename>,
1090 <filename>paths.target
</filename>,
1091 <filename>bluetooth.target
</filename>,
1092 <filename>printer.target
</filename>,
1093 <filename>smartcard.target
</filename>,
1094 <filename>sound.target
</filename>.
</para>
1098 <title>Special Passive User Units
</title>
1102 <term><filename>graphical-session.target
</filename></term>
1104 <para>This target is active whenever any graphical session is running. It is used to
1105 stop user services which only apply to a graphical (X, Wayland, etc.) session when the
1106 session is terminated. Such services should have
1107 <literal>PartOf=graphical-session.target
</literal> in their
<literal>[Unit]
</literal>
1108 section. A target for a particular session (e. g.
1109 <filename>gnome-session.target
</filename>) starts and stops
1110 <literal>graphical-session.target
</literal> with
1111 <literal>BindsTo=graphical-session.target
</literal>.
</para>
1113 <para>Which services are started by a session target is determined by the
1114 <literal>Wants=
</literal> and
<literal>Requires=
</literal> dependencies. For services
1115 that can be enabled independently, symlinks in
<literal>.wants/
</literal> and
1116 <literal>.requires/
</literal> should be used, see
1117 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
1118 Those symlinks should either be shipped in packages, or should be added dynamically
1119 after installation, for example using
<literal>systemctl add-wants
</literal>, see
1120 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
1124 <title>Nautilus as part of a GNOME session
</title>
1126 <para><literal>gnome-session.target
</literal> pulls in Nautilus as top-level service:
</para>
1128 <programlisting>[Unit]
1129 Description=User systemd services for GNOME graphical session
1130 Wants=nautilus.service
1131 BindsTo=graphical-session.target
</programlisting>
1133 <para><literal>nautilus.service
</literal> gets stopped when the session stops:
</para>
1135 <programlisting>[Unit]
1136 Description=Render the desktop icons with Nautilus
1137 PartOf=graphical-session.target
1146 <term><filename>graphical-session-pre.target
</filename></term>
1148 <para>This target contains services which set up the environment or global configuration
1149 of a graphical session, such as SSH/GPG agents (which need to export an environment
1150 variable into all desktop processes) or migration of obsolete d-conf keys after an OS
1151 upgrade (which needs to happen before starting any process that might use them). This
1152 target must be started before starting a graphical session like
1153 <filename>gnome-session.target
</filename>.
</para>
1161 <title>See Also
</title>
1163 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1164 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1165 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1166 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1167 <citerefentry><refentrytitle>systemd.target
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1168 <citerefentry><refentrytitle>systemd.slice
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1169 <citerefentry><refentrytitle>bootup
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1170 <citerefentry><refentrytitle>systemd-fstab-generator
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1171 <citerefentry><refentrytitle>user@.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>