1SYSTEMD.SPECIAL(7) systemd.special SYSTEMD.SPECIAL(7)
2
3
4
6 systemd.special - Special systemd units
7
9 basic.target, bluetooth.target, cryptsetup-pre.target,
10 cryptsetup.target, veritysetup-pre.target, veritysetup.target,
11 ctrl-alt-del.target, blockdev@.target, boot-complete.target,
12 default.target, emergency.target, exit.target, final.target,
13 first-boot-complete.target, getty.target, getty-pre.target,
14 graphical.target, halt.target, hibernate.target, hybrid-sleep.target,
15 suspend-then-hibernate.target, initrd.target, initrd-fs.target,
16 initrd-root-device.target, initrd-root-fs.target, kbrequest.target,
17 kexec.target, local-fs-pre.target, local-fs.target, machines.target
18 multi-user.target, network-online.target, network-pre.target,
19 network.target, nss-lookup.target, nss-user-lookup.target,
20 paths.target, poweroff.target, printer.target, reboot.target,
21 remote-cryptsetup.target, remote-veritysetup.target,
22 remote-fs-pre.target, remote-fs.target, rescue.target, rpcbind.target,
23 runlevel2.target, runlevel3.target, runlevel4.target, runlevel5.target,
24 shutdown.target, sigpwr.target, sleep.target, slices.target,
25 smartcard.target, sockets.target, sound.target, suspend.target,
26 swap.target, sysinit.target, system-update.target,
27 system-update-pre.target, time-set.target, time-sync.target,
28 timers.target, umount.target, usb-gadget.target, -.slice, system.slice,
29 user.slice, machine.slice, -.mount, dbus.service, dbus.socket,
30 display-manager.service, init.scope, syslog.socket,
31 system-update-cleanup.service
32
34 A few units are treated specially by systemd. Many of them have special
35 internal semantics and cannot be renamed, while others simply have a
36 standard meaning and should be present on all systems.
37
39 Special System Units
40 -.mount
41 The root mount point, i.e. the mount unit for the / path. This unit
42 is unconditionally active, during the entire time the system is up,
43 as this mount point is where the basic userspace is running from.
44
45 basic.target
46 A special target unit covering basic boot-up.
47
48 systemd automatically adds dependency of the type After= for this
49 target unit to all services (except for those with
50 DefaultDependencies=no).
51
52 Usually, this should pull-in all local mount points plus /var/,
53 /tmp/ and /var/tmp/, swap devices, sockets, timers, path units and
54 other basic initialization necessary for general purpose daemons.
55 The mentioned mount points are special cased to allow them to be
56 remote.
57
58 This target usually does not pull in any non-target units directly,
59 but rather does so indirectly via other early boot targets. It is
60 instead meant as a synchronization point for late boot services.
61 Refer to bootup(7) for details on the targets involved.
62
63 boot-complete.target
64 This target is intended as generic synchronization point for
65 services that shall determine or act on whether the boot process
66 completed successfully. Order units that are required to succeed
67 for a boot process to be considered successful before this unit,
68 and add a Requires= dependency from the target unit to them. Order
69 units that shall only run when the boot process is considered
70 successful after the target unit and pull in the target from it,
71 also with Requires=. Note that by default this target unit is not
72 part of the initial boot transaction, but is supposed to be pulled
73 in only if required by units that want to run only on successful
74 boots.
75
76 See systemd-boot-check-no-failures.service(8) for a service that
77 implements a generic system health check and orders itself before
78 boot-complete.target.
79
80 See systemd-bless-boot.service(8) for a service that propagates
81 boot success information to the boot loader, and orders itself
82 after boot-complete.target.
83
84 ctrl-alt-del.target
85 systemd starts this target whenever Control+Alt+Del is pressed on
86 the console. Usually, this should be aliased (symlinked) to
87 reboot.target.
88
89 cryptsetup.target
90 A target that pulls in setup services for all encrypted block
91 devices.
92
93 veritysetup.target
94 A target that pulls in setup services for all verity integrity
95 protected block devices.
96
97 dbus.service
98 A special unit for the D-Bus bus daemon. As soon as this service is
99 fully started up systemd will connect to it and register its
100 service.
101
102 dbus.socket
103 A special unit for the D-Bus system bus socket. All units with
104 Type=dbus automatically gain a dependency on this unit.
105
106 default.target
107 The default unit systemd starts at bootup. Usually, this should be
108 aliased (symlinked) to multi-user.target or graphical.target. See
109 bootup(7) for more discussion.
110
111 The default unit systemd starts at bootup can be overridden with
112 the systemd.unit= kernel command line option, or more conveniently,
113 with the short names like single, rescue, 1, 3, 5, ...; see
114 systemd(1).
115
116 display-manager.service
117 The display manager service. Usually, this should be aliased
118 (symlinked) to gdm.service or a similar display manager service.
119
120 emergency.target
121 A special target unit that starts an emergency shell on the main
122 console. This target does not pull in other services or mounts. It
123 is the most minimal version of starting the system in order to
124 acquire an interactive shell; the only processes running are
125 usually just the system manager (PID 1) and the shell process. This
126 unit may be used by specifying emergency on the kernel command
127 line; it is also used when a file system check on a required file
128 system fails and boot-up cannot continue. Compare with
129 rescue.target, which serves a similar purpose, but also starts the
130 most basic services and mounts all file systems.
131
132 In many ways booting into emergency.target is similar to the effect
133 of booting with "init=/bin/sh" on the kernel command line, except
134 that emergency mode provides you with the full system and service
135 manager, and allows starting individual units in order to continue
136 the boot process in steps.
137
138 Note that depending on how emergency.target is reached, the root
139 file system might be mounted read-only or read-write (no remounting
140 is done specially for this target). For example, the system may
141 boot with root mounted read-only when ro is used on the kernel
142 command line and remain this way for emergency.target, or the
143 system may transition to emergency.target after the system has been
144 partially booted and disks have already been remounted read-write.
145
146 exit.target
147 A special service unit for shutting down the system or user service
148 manager. It is equivalent to poweroff.target on non-container
149 systems, and also works in containers.
150
151 systemd will start this unit when it receives the SIGTERM or SIGINT
152 signal when running as user service daemon.
153
154 Normally, this (indirectly) pulls in shutdown.target, which in turn
155 should be conflicted by all units that want to be scheduled for
156 shutdown when the service manager starts to exit.
157
158 final.target
159 A special target unit that is used during the shutdown logic and
160 may be used to pull in late services after all normal services are
161 already terminated and all mounts unmounted.
162
163 getty.target
164 A special target unit that pulls in statically configured local TTY
165 getty instances.
166
167 graphical.target
168 A special target unit for setting up a graphical login screen. This
169 pulls in multi-user.target.
170
171 Units that are needed for graphical logins shall add Wants=
172 dependencies for their unit to this unit (or multi-user.target)
173 during installation. This is best configured via
174 WantedBy=graphical.target in the unit's [Install] section.
175
176 hibernate.target
177 A special target unit for hibernating the system. This pulls in
178 sleep.target.
179
180 hybrid-sleep.target
181 A special target unit for hibernating and suspending the system at
182 the same time. This pulls in sleep.target.
183
184 suspend-then-hibernate.target
185 A special target unit for suspending the system for a period of
186 time, waking it and putting it into hibernate. This pulls in
187 sleep.target.
188
189 halt.target
190 A special target unit for shutting down and halting the system.
191 Note that this target is distinct from poweroff.target in that it
192 generally really just halts the system rather than powering it
193 down.
194
195 Applications wanting to halt the system should not start this unit
196 directly, but should instead execute systemctl halt (possibly with
197 the --no-block option) or call systemd(1)'s
198 org.freedesktop.systemd1.Manager.Halt D-Bus method directly.
199
200 init.scope
201 This scope unit is where the system and service manager (PID 1)
202 itself resides. It is active as long as the system is running.
203
204 initrd.target
205 This is the default target in the initramfs, similar to
206 default.target in the main system. It is used to mount the real
207 root and transition to it. See bootup(7) for more discussion.
208
209 initrd-fs.target
210 systemd-fstab-generator(3) automatically adds dependencies of type
211 Before= to sysroot-usr.mount and all mount points found in
212 /etc/fstab that have x-initrd.mount and not have noauto mount
213 options set.
214
215 initrd-root-device.target
216 A special initrd target unit that is reached when the root
217 filesystem device is available, but before it has been mounted.
218 systemd-fstab-generator(3) and systemd-gpt-auto-generator(3)
219 automatically setup the appropriate dependencies to make this
220 happen.
221
222 initrd-root-fs.target
223 systemd-fstab-generator(3) automatically adds dependencies of type
224 Before= to the sysroot.mount unit, which is generated from the
225 kernel command line.
226
227 kbrequest.target
228 systemd starts this target whenever Alt+ArrowUp is pressed on the
229 console. Note that any user with physical access to the machine
230 will be able to do this, without authentication, so this should be
231 used carefully.
232
233 kexec.target
234 A special target unit for shutting down and rebooting the system
235 via kexec.
236
237 Applications wanting to reboot the system should not start this
238 unit directly, but should instead execute systemctl kexec (possibly
239 with the --no-block option) or call systemd(1)'s
240 org.freedesktop.systemd1.Manager.KExec D-Bus method directly.
241
242 local-fs.target
243 systemd-fstab-generator(3) automatically adds dependencies of type
244 Before= to all mount units that refer to local mount points for
245 this target unit. In addition, it adds dependencies of type Wants=
246 to this target unit for those mounts listed in /etc/fstab that have
247 the auto mount option set.
248
249 machines.target
250 A standard target unit for starting all the containers and other
251 virtual machines. See systemd-nspawn@.service for an example.
252
253 multi-user.target
254 A special target unit for setting up a multi-user system
255 (non-graphical). This is pulled in by graphical.target.
256
257 Units that are needed for a multi-user system shall add Wants=
258 dependencies for their unit to this unit during installation. This
259 is best configured via WantedBy=multi-user.target in the unit's
260 [Install] section.
261
262 network-online.target
263 Units that strictly require a configured network connection should
264 pull in network-online.target (via a Wants= type dependency) and
265 order themselves after it. This target unit is intended to pull in
266 a service that delays further execution until the network is
267 sufficiently set up. What precisely this requires is left to the
268 implementation of the network managing service.
269
270 Note the distinction between this unit and network.target. This
271 unit is an active unit (i.e. pulled in by the consumer rather than
272 the provider of this functionality) and pulls in a service which
273 possibly adds substantial delays to further execution. In contrast,
274 network.target is a passive unit (i.e. pulled in by the provider of
275 the functionality, rather than the consumer) that usually does not
276 delay execution much. Usually, network.target is part of the boot
277 of most systems, while network-online.target is not, except when at
278 least one unit requires it. Also see Running Services After the
279 Network is up[1] for more information.
280
281 All mount units for remote network file systems automatically pull
282 in this unit, and order themselves after it. Note that networking
283 daemons that simply provide functionality to other hosts (as
284 opposed to consume functionality of other hosts) generally do not
285 need to pull this in.
286
287 systemd automatically adds dependencies of type Wants= and After=
288 for this target unit to all SysV init script service units with an
289 LSB header referring to the "$network" facility.
290
291 Note that this unit is only useful during the original system
292 start-up logic. After the system has completed booting up, it will
293 not track the online state of the system anymore. Due to this it
294 cannot be used as a network connection monitor concept, it is
295 purely a one-time system start-up concept.
296
297 paths.target
298 A special target unit that sets up all path units (see
299 systemd.path(5) for details) that shall be active after boot.
300
301 It is recommended that path units installed by applications get
302 pulled in via Wants= dependencies from this unit. This is best
303 configured via a WantedBy=paths.target in the path unit's [Install]
304 section.
305
306 poweroff.target
307 A special target unit for shutting down and powering off the
308 system.
309
310 Applications wanting to power off the system should not start this
311 unit directly, but should instead execute systemctl poweroff
312 (possibly with the --no-block option) or call systemd-logind(8)'s
313 org.freedesktop.login1.Manager.PowerOff D-Bus method directly.
314
315 runlevel0.target is an alias for this target unit, for
316 compatibility with SysV.
317
318 reboot.target
319 A special target unit for shutting down and rebooting the system.
320
321 Applications wanting to reboot the system should not start this
322 unit directly, but should instead execute systemctl reboot
323 (possibly with the --no-block option) or call systemd-logind(8)'s
324 org.freedesktop.login1.Manager.Reboot D-Bus method directly.
325
326 runlevel6.target is an alias for this target unit, for
327 compatibility with SysV.
328
329 remote-cryptsetup.target
330 Similar to cryptsetup.target, but for encrypted devices which are
331 accessed over the network. It is used for crypttab(8) entries
332 marked with _netdev.
333
334 remote-veritysetup.target
335 Similar to veritysetup.target, but for verity integrity protected
336 devices which are accessed over the network. It is used for
337 veritytab(8) entries marked with _netdev.
338
339 remote-fs.target
340 Similar to local-fs.target, but for remote mount points.
341
342 systemd automatically adds dependencies of type After= for this
343 target unit to all SysV init script service units with an LSB
344 header referring to the "$remote_fs" facility.
345
346 rescue.target
347 A special target unit that pulls in the base system (including
348 system mounts) and spawns a rescue shell. Isolate to this target in
349 order to administer the system in single-user mode with all file
350 systems mounted but with no services running, except for the most
351 basic. Compare with emergency.target, which is much more reduced
352 and does not provide the file systems or most basic services.
353 Compare with multi-user.target, this target could be seen as
354 single-user.target.
355
356 runlevel1.target is an alias for this target unit, for
357 compatibility with SysV.
358
359 Use the "systemd.unit=rescue.target" kernel command line option to
360 boot into this mode. A short alias for this kernel command line
361 option is "1", for compatibility with SysV.
362
363 runlevel2.target, runlevel3.target, runlevel4.target, runlevel5.target
364 These are targets that are called whenever the SysV compatibility
365 code asks for runlevel 2, 3, 4, 5, respectively. It is a good idea
366 to make this an alias for (i.e. symlink to) graphical.target (for
367 runlevel 5) or multi-user.target (the others).
368
369 shutdown.target
370 A special target unit that terminates the services on system
371 shutdown.
372
373 Services that shall be terminated on system shutdown shall add
374 Conflicts= and Before= dependencies to this unit for their service
375 unit, which is implicitly done when DefaultDependencies=yes is set
376 (the default).
377
378 sigpwr.target
379 A special target that is started when systemd receives the SIGPWR
380 process signal, which is normally sent by the kernel or UPS daemons
381 when power fails.
382
383 sleep.target
384 A special target unit that is pulled in by suspend.target,
385 hibernate.target and hybrid-sleep.target and may be used to hook
386 units into the sleep state logic.
387
388 slices.target
389 A special target unit that sets up all slice units (see
390 systemd.slice(5) for details) that shall always be active after
391 boot. By default the generic system.slice slice unit as well as the
392 root slice unit -.slice are pulled in and ordered before this unit
393 (see below).
394
395 Adding slice units to slices.target is generally not necessary.
396 Instead, when some unit that uses Slice= is started, the specified
397 slice will be started automatically. Adding WantedBy=slices.target
398 lines to the [Install] section should only be done for units that
399 need to be always active. In that case care needs to be taken to
400 avoid creating a loop through the automatic dependencies on
401 "parent" slices.
402
403 sockets.target
404 A special target unit that sets up all socket units (see
405 systemd.socket(5) for details) that shall be active after boot.
406
407 Services that can be socket-activated shall add Wants= dependencies
408 to this unit for their socket unit during installation. This is
409 best configured via a WantedBy=sockets.target in the socket unit's
410 [Install] section.
411
412 suspend.target
413 A special target unit for suspending the system. This pulls in
414 sleep.target.
415
416 swap.target
417 Similar to local-fs.target, but for swap partitions and swap files.
418
419 sysinit.target
420 systemd automatically adds dependencies of the types Requires= and
421 After= for this target unit to all services (except for those with
422 DefaultDependencies=no).
423
424 This target pulls in the services required for system
425 initialization. System services pulled in by this target should
426 declare DefaultDependencies=no and specify all their dependencies
427 manually, including access to anything more than a read only root
428 filesystem. For details on the dependencies of this target, refer
429 to bootup(7).
430
431 syslog.socket
432 The socket unit syslog implementations should listen on. All
433 userspace log messages will be made available on this socket. For
434 more information about syslog integration, please consult the
435 Syslog Interface[2] document.
436
437 system-update.target, system-update-pre.target,
438 system-update-cleanup.service
439 A special target unit that is used for offline system updates.
440 systemd-system-update-generator(8) will redirect the boot process
441 to this target if /system-update exists. For more information see
442 systemd.offline-updates(7).
443
444 Updates should happen before the system-update.target is reached,
445 and the services which implement them should cause the machine to
446 reboot. The main units executing the update should order themselves
447 after system-update-pre.target but not pull it in. Services which
448 want to run during system updates only, but before the actual
449 system update is executed should order themselves before this unit
450 and pull it in. As a safety measure, if this does not happen, and
451 /system-update still exists after system-update.target is reached,
452 system-update-cleanup.service will remove this symlink and reboot
453 the machine.
454
455 timers.target
456 A special target unit that sets up all timer units (see
457 systemd.timer(5) for details) that shall be active after boot.
458
459 It is recommended that timer units installed by applications get
460 pulled in via Wants= dependencies from this unit. This is best
461 configured via WantedBy=timers.target in the timer unit's [Install]
462 section.
463
464 umount.target
465 A special target unit that unmounts all mount and automount points
466 on system shutdown.
467
468 Mounts that shall be unmounted on system shutdown shall add
469 Conflicts dependencies to this unit for their mount unit, which is
470 implicitly done when DefaultDependencies=yes is set (the default).
471
472 Special System Units for Devices
473 Some target units are automatically pulled in as devices of certain
474 kinds show up in the system. These may be used to automatically
475 activate various services based on the specific type of the available
476 hardware.
477
478 bluetooth.target
479 This target is started automatically as soon as a Bluetooth
480 controller is plugged in or becomes available at boot.
481
482 This may be used to pull in Bluetooth management daemons
483 dynamically when Bluetooth hardware is found.
484
485 printer.target
486 This target is started automatically as soon as a printer is
487 plugged in or becomes available at boot.
488
489 This may be used to pull in printer management daemons dynamically
490 when printer hardware is found.
491
492 smartcard.target
493 This target is started automatically as soon as a smartcard
494 controller is plugged in or becomes available at boot.
495
496 This may be used to pull in smartcard management daemons
497 dynamically when smartcard hardware is found.
498
499 sound.target
500 This target is started automatically as soon as a sound card is
501 plugged in or becomes available at boot.
502
503 This may be used to pull in audio management daemons dynamically
504 when audio hardware is found.
505
506 usb-gadget.target
507 This target is started automatically as soon as a USB Device
508 Controller becomes available at boot.
509
510 This may be used to pull in usb gadget dynamically when UDC
511 hardware is found.
512
513 Special Passive System Units
514 A number of special system targets are defined that can be used to
515 properly order boot-up of optional services. These targets are
516 generally not part of the initial boot transaction, unless they are
517 explicitly pulled in by one of the implementing services. Note
518 specifically that these passive target units are generally not pulled
519 in by the consumer of a service, but by the provider of the service.
520 This means: a consuming service should order itself after these targets
521 (as appropriate), but not pull it in. A providing service should order
522 itself before these targets (as appropriate) and pull it in (via a
523 Wants= type dependency).
524
525 Note that these passive units cannot be started manually, i.e.
526 "systemctl start time-sync.target" will fail with an error. They can
527 only be pulled in by dependency. This is enforced since they exist for
528 ordering purposes only and thus are not useful as only unit within a
529 transaction.
530
531 blockdev@.target
532 This template unit is used to order mount units and other consumers
533 of block devices after services that synthesize these block
534 devices. In particular, this is intended to be used with storage
535 services (such as systemd-cryptsetup@.service(5)/ systemd-
536 veritysetup@.service(5)) that allocate and manage a virtual block
537 device. Storage services are ordered before an instance of
538 blockdev@.target, and the consumer units after it. The ordering is
539 particularly relevant during shutdown, as it ensures that the mount
540 is deactivated first and the service backing the mount later. The
541 blockdev@.target instance should be pulled in via a Wants=
542 dependency of the storage daemon and thus generally not be part of
543 any transaction unless a storage daemon is used. The instance name
544 for instances of this template unit must be a properly escaped
545 block device node path, e.g. blockdev@dev-mapper-foobar.target for
546 the storage device /dev/mapper/foobar.
547
548 cryptsetup-pre.target
549 This passive target unit may be pulled in by services that want to
550 run before any encrypted block device is set up. All encrypted
551 block devices are set up after this target has been reached. Since
552 the shutdown order is implicitly the reverse start-up order between
553 units, this target is particularly useful to ensure that a service
554 is shut down only after all encrypted block devices are fully
555 stopped.
556
557 veritysetup-pre.target
558 This passive target unit may be pulled in by services that want to
559 run before any verity integrity protected block device is set up.
560 All verity integrity protected block devices are set up after this
561 target has been reached. Since the shutdown order is implicitly the
562 reverse start-up order between units, this target is particularly
563 useful to ensure that a service is shut down only after all verity
564 integrity protected block devices are fully stopped.
565
566 first-boot-complete.target
567 This passive target is intended as a synchronization point for
568 units that need to run once during the first boot. Only after all
569 units ordered before this target have finished, will the machine-
570 id(5) be committed to disk, marking the first boot as completed. If
571 the boot is aborted at any time before that, the next boot will
572 re-run any units with ConditionFirstBoot=yes.
573
574 getty-pre.target
575 A special passive target unit. Users of this target are expected to
576 pull it in the boot transaction via a dependency (e.g. Wants=).
577 Order your unit before this unit if you want to make use of the
578 console just before getty is started.
579
580 local-fs-pre.target
581 This target unit is automatically ordered before all local mount
582 points marked with auto (see above). It can be used to execute
583 certain units before all local mounts.
584
585 network.target
586 This unit is supposed to indicate when network functionality is
587 available, but it is only very weakly defined what that is supposed
588 to mean. However, the following should apply at minimum:
589
590 • At start-up, any configured synthetic network devices (i.e. not
591 physical ones that require hardware to show up and be probed,
592 but virtual ones like bridge devices and similar which are
593 created programmatically) that do not depend on any underlying
594 hardware should be allocated by the time this target is
595 reached. It is not necessary for these interfaces to also have
596 completed IP level configuration by the time network.target is
597 reached.
598
599 • At shutdown, a unit that is ordered after network.target will
600 be stopped before the network — to whatever level it might be
601 set up by then — is shut down. It is hence useful when writing
602 service files that require network access on shutdown, which
603 should order themselves after this target, but not pull it in.
604 Also see Running Services After the Network is up[1] for more
605 information.
606
607 It must emphasized that at start-up there's no guarantee that
608 hardware-based devices have shown up by the time this target is
609 reached, or even acquired complete IP configuration. For that
610 purpose use network-online.target as described above.
611
612 network-pre.target
613 This passive target unit may be pulled in by services that want to
614 run before any network is set up, for example for the purpose of
615 setting up a firewall. All network management software orders
616 itself after this target, but does not pull it in.
617
618 nss-lookup.target
619 A target that should be used as synchronization point for all
620 host/network name service lookups. Note that this is independent of
621 UNIX user/group name lookups for which nss-user-lookup.target
622 should be used. All services for which the availability of full
623 host/network name resolution is essential should be ordered after
624 this target, but not pull it in. systemd automatically adds
625 dependencies of type After= for this target unit to all SysV init
626 script service units with an LSB header referring to the "$named"
627 facility.
628
629 nss-user-lookup.target
630 A target that should be used as synchronization point for all
631 regular UNIX user/group name service lookups. Note that this is
632 independent of host/network name lookups for which
633 nss-lookup.target should be used. All services for which the
634 availability of the full user/group database is essential should be
635 ordered after this target, but not pull it in. All services which
636 provide parts of the user/group database should be ordered before
637 this target, and pull it in. Note that this unit is only relevant
638 for regular users and groups — system users and groups are required
639 to be resolvable during earliest boot already, and hence do not
640 need any special ordering against this target.
641
642 remote-fs-pre.target
643 This target unit is automatically ordered before all mount point
644 units (see above) and cryptsetup/veritysetup devices marked with
645 the _netdev. It can be used to run certain units before remote
646 encrypted devices and mounts are established. Note that this unit
647 is generally not part of the initial transaction, unless the unit
648 that wants to be ordered before all remote mounts pulls it in via a
649 Wants= type dependency. If the unit wants to be pulled in by the
650 first remote mount showing up, it should use network-online.target
651 (see above).
652
653 rpcbind.target
654 The portmapper/rpcbind pulls in this target and orders itself
655 before it, to indicate its availability. systemd automatically adds
656 dependencies of type After= for this target unit to all SysV init
657 script service units with an LSB header referring to the "$portmap"
658 facility.
659
660 time-set.target
661 Services responsible for setting the system clock (CLOCK_REALTIME)
662 from a local source (such as a maintained timestamp file or
663 imprecise real-time clock) should pull in this target and order
664 themselves before it. Services where approximate, roughly monotonic
665 time is desired should be ordered after this unit, but not pull it
666 in.
667
668 This target does not provide the accuracy guarantees of
669 time-sync.target (see below), however does not depend on remote
670 clock sources to be reachable, i.e. the target is typically not
671 delayed by network problems and similar. Use of this target is
672 recommended for services where approximate clock accuracy and rough
673 monotonicity is desired but activation shall not be delayed for
674 possibly unreliable network communication.
675
676 The service manager automatically adds dependencies of type After=
677 for this target unit to all timer units with at least one
678 OnCalendar= directive.
679
680 The systemd-timesyncd.service(8) service is a simple daemon that
681 pulls in this target and orders itself before it. Besides
682 implementing the SNTP network protocol it maintains a timestamp
683 file on disk whose modification time is regularlary updated. At
684 service start-up the local system clock is set from that
685 modification time, ensuring it increases roughly monotonically.
686
687 Note that ordering a unit after time-set.target only has effect if
688 there's actually a service ordered before it that delays it until
689 the clock is adjusted for rough monotonicity. Otherwise, this
690 target might get reached before the clock is adjusted to be roughly
691 monotonic. Enable systemd-timesyncd.service(8), or an alternative
692 NTP implementation to delay the target.
693
694 time-sync.target
695 Services indicating completed synchronization of the system clock
696 (CLOCK_REALTIME) to a remote source should pull in this target and
697 order themselves before it. Services where accurate time is
698 essential should be ordered after this unit, but not pull it in.
699
700 The service manager automatically adds dependencies of type After=
701 for this target unit to all SysV init script service units with an
702 LSB header referring to the "$time" facility, as well to all timer
703 units with at least one OnCalendar= directive.
704
705 This target provides stricter clock accuracy guarantees than
706 time-set.target (see above), but likely requires network
707 communication and thus introduces unpredictable delays. Services
708 that require clock accuracy and where network communication delays
709 are acceptable should use this target. Services that require a less
710 accurate clock, and only approximate and roughly monotonic clock
711 behaviour should use time-set.target instead.
712
713 Note that ordering a unit after time-sync.target only has effect if
714 there's actually a service ordered before it that delays it until
715 clock synchronization is reached. Otherwise, this target might get
716 reached before the clock is synchronized to any remote accurate
717 reference clock. When using systemd-timesyncd.service(8), enable
718 systemd-time-wait-sync.service(8) to delay the target; or use an
719 equivalent service for other NTP implementations.
720
721 Table 1. Comparison
722 ┌───────────────────────────┬────────────────────────────────┐
723 │time-set.target │ time-sync.target │
724 ├───────────────────────────┼────────────────────────────────┤
725 │"quick" to reach │ "slow" to reach │
726 ├───────────────────────────┼────────────────────────────────┤
727 │typically uses local clock │ typically uses remote │
728 │sources, boot process not │ clock sources, inserts │
729 │affected by availability │ dependencies on remote │
730 │of external resources │ resources into boot │
731 │ │ process │
732 ├───────────────────────────┼────────────────────────────────┤
733 │reliable, because local │ unreliable, because │
734 │ │ typically network involved │
735 ├───────────────────────────┼────────────────────────────────┤
736 │typically guarantees an │ typically guarantees an │
737 │approximate and roughly │ accurate clock │
738 │monotonic clock only │ │
739 ├───────────────────────────┼────────────────────────────────┤
740 │implemented by │ implemented by │
741 │systemd-timesyncd.service │ systemd-time-wait-sync.service │
742 └───────────────────────────┴────────────────────────────────┘
743
744 Special Slice Units
745 There are four ".slice" units which form the basis of the hierarchy for
746 assignment of resources for services, users, and virtual machines or
747 containers. See systemd.slice(7) for details about slice units.
748
749 -.slice
750 The root slice is the root of the slice hierarchy. It usually does
751 not contain units directly, but may be used to set defaults for the
752 whole tree.
753
754 system.slice
755 By default, all system services started by systemd are found in
756 this slice.
757
758 user.slice
759 By default, all user processes and services started on behalf of
760 the user, including the per-user systemd instance are found in this
761 slice. This is pulled in by systemd-logind.service.
762
763 machine.slice
764 By default, all virtual machines and containers registered with
765 systemd-machined are found in this slice. This is pulled in by
766 systemd-machined.service.
767
769 Special User Units
770 When systemd runs as a user instance, the following special units are
771 available:
772
773 default.target
774 This is the main target of the user session, started by default.
775 Various services that compose the normal user session should be
776 pulled into this target. In this regard, default.target is similar
777 to multi-user.target in the system instance, but it is a real unit,
778 not an alias.
779
780 In addition, the following units are available which have definitions
781 similar to their system counterparts: exit.target, shutdown.target,
782 sockets.target, timers.target, paths.target, bluetooth.target,
783 printer.target, smartcard.target, sound.target.
784
785 Special Passive User Units
786 graphical-session.target
787 This target is active whenever any graphical session is running. It
788 is used to stop user services which only apply to a graphical (X,
789 Wayland, etc.) session when the session is terminated. Such
790 services should have "PartOf=graphical-session.target" in their
791 [Unit] section. A target for a particular session (e. g.
792 gnome-session.target) starts and stops "graphical-session.target"
793 with "BindsTo=graphical-session.target".
794
795 Which services are started by a session target is determined by the
796 "Wants=" and "Requires=" dependencies. For services that can be
797 enabled independently, symlinks in ".wants/" and ".requires/"
798 should be used, see systemd.unit(5). Those symlinks should either
799 be shipped in packages, or should be added dynamically after
800 installation, for example using "systemctl add-wants", see
801 systemctl(1).
802
803 Example 1. Nautilus as part of a GNOME session
804 "gnome-session.target" pulls in Nautilus as top-level service:
805
806 [Unit]
807 Description=User systemd services for GNOME graphical session
808 Wants=nautilus.service
809 BindsTo=graphical-session.target
810
811 "nautilus.service" gets stopped when the session stops:
812
813 [Unit]
814 Description=Render the desktop icons with Nautilus
815 PartOf=graphical-session.target
816
817 [Service]
818 ...
819
820 graphical-session-pre.target
821 This target contains services which set up the environment or
822 global configuration of a graphical session, such as SSH/GPG agents
823 (which need to export an environment variable into all desktop
824 processes) or migration of obsolete d-conf keys after an OS upgrade
825 (which needs to happen before starting any process that might use
826 them). This target must be started before starting a graphical
827 session like gnome-session.target.
828
829 xdg-desktop-autostart.target
830 The XDG specification defines a way to autostart applications using
831 XDG desktop files. systemd ships systemd-xdg-autostart-generator(8)
832 for the XDG desktop files in autostart directories. Desktop
833 Environments can opt-in to use this service by adding a Wants=
834 dependency on xdg-desktop-autostart.target.
835
836 Special User Slice Units
837 There are four ".slice" units which form the basis of the user
838 hierarchy for assignment of resources for user applications and
839 services. See systemd.slice(7) for details about slice units and the
840 documentation about Desktop Environments[3] for further information.
841
842 -.slice
843 The root slice is the root of the user's slice hierarchy. It
844 usually does not contain units directly, but may be used to set
845 defaults for the whole tree.
846
847 app.slice
848 By default, all user services and applications managed by systemd
849 are found in this slice. All interactively launched applications
850 like web browsers and text editors as well as non-critical services
851 should be placed into this slice.
852
853 session.slice
854 All essential services and applications required for the session
855 should use this slice. These are services that either cannot be
856 restarted easily or where latency issues may affect the
857 interactivity of the system and applications. This includes the
858 display server, screen readers and other services such as DBus or
859 XDG portals. Such services should be configured to be part of this
860 slice by adding Slice=session.slice to their unit files.
861
862 background.slice
863 All services running low-priority background tasks should use this
864 slice. This permits resources to be preferentially assigned to the
865 other slices. Examples include non-interactive tasks like file
866 indexing or backup operations where latency is not important.
867
869 systemd(1), systemd.unit(5), systemd.service(5), systemd.socket(5),
870 systemd.target(5), systemd.slice(5), bootup(7), systemd-fstab-
871 generator(8), user@.service(5)
872
874 1. Running Services After the Network is up
875 https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget
876
877 2. Syslog Interface
878 https://www.freedesktop.org/wiki/Software/systemd/syslog
879
880 3. Desktop Environments
881 https://systemd.io/DESKTOP_ENVIRONMENTS
882
883
884
885systemd 248 SYSTEMD.SPECIAL(7)