Debian Codegraph @

upstream/debian-unstable/man7/systemd.special.7

raw
1 '\" t
2 .TH "SYSTEMD\&.SPECIAL" "7" "" "systemd 261~rc3" "systemd.special"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.special \- Special systemd units
24 .SH "SYNOPSIS"
25 .PP
26 basic\&.target,
27 bluetooth\&.target,
28 cryptsetup\-pre\&.target,
29 cryptsetup\&.target,
30 veritysetup\-pre\&.target,
31 veritysetup\&.target,
32 ctrl\-alt\-del\&.target,
33 blockdev@\&.target,
34 boot\-complete\&.target,
35 default\&.target,
36 emergency\&.target,
37 exit\&.target,
38 factory\-reset\&.target,
39 factory\-reset\-now\&.target,
40 final\&.target,
41 first\-boot\-complete\&.target,
42 getty\&.target,
43 getty\-pre\&.target,
44 graphical\&.target,
45 halt\&.target,
46 hibernate\&.target,
47 hybrid\-sleep\&.target,
48 suspend\-then\-hibernate\&.target,
49 initrd\&.target,
50 initrd\-fs\&.target,
51 initrd\-root\-device\&.target,
52 initrd\-root\-fs\&.target,
53 initrd\-usr\-fs\&.target,
54 integritysetup\-pre\&.target,
55 integritysetup\&.target,
56 kbrequest\&.target,
57 kexec\&.target,
58 local\-fs\-pre\&.target,
59 local\-fs\&.target,
60 machines\&.target,
61 multi\-user\&.target,
62 network\-online\&.target,
63 network\-pre\&.target,
64 network\&.target,
65 nss\-lookup\&.target,
66 nss\-user\-lookup\&.target,
67 paths\&.target,
68 poweroff\&.target,
69 printer\&.target,
70 reboot\&.target,
71 remote\-cryptsetup\&.target,
72 remote\-integritysetup\&.target,
73 remote\-veritysetup\&.target,
74 remote\-fs\-pre\&.target,
75 remote\-fs\&.target,
76 rescue\&.target,
77 rpcbind\&.target,
78 shutdown\&.target,
79 sigpwr\&.target,
80 sleep\&.target,
81 slices\&.target,
82 smartcard\&.target,
83 sockets\&.target,
84 soft\-reboot\&.target,
85 sound\&.target,
86 ssh\-access\&.target,
87 storage\-target\-mode\&.target,
88 suspend\&.target,
89 swap\&.target,
90 sysinit\&.target,
91 system\-update\&.target,
92 system\-update\-pre\&.target,
93 time\-set\&.target,
94 time\-sync\&.target,
95 timers\&.target,
96 tpm2\&.target,
97 umount\&.target,
98 usb\-gadget\&.target,
99 \-\&.slice,
100 capsule\&.slice,
101 machine\&.slice,
102 system\&.slice,
103 user\&.slice,
104 \-\&.mount,
105 dbus\&.service,
106 dbus\&.socket,
107 display\-manager\&.service,
108 init\&.scope,
109 syslog\&.socket,
110 system\-update\-cleanup\&.service
111 .SH "DESCRIPTION"
112 .PP
113 A few units are treated specially by systemd\&. Many of them have special internal semantics and cannot be renamed, while others simply have a standard meaning and should be present on all systems\&.
114 .SH "UNITS MANAGED BY THE SYSTEM SERVICE MANAGER"
115 .SS "Special System Units"
116 .PP
117 \-\&.mount
118 .RS 4
119 The root mount point, i\&.e\&. the mount unit for the
120 /
121 path\&. This unit is unconditionally active, during the entire time the system is up, as this mount point is where the basic userspace is running from\&.
122 .sp
123 Added in version 235\&.
124 .RE
125 .PP
126 basic\&.target
127 .RS 4
128 A special target unit covering basic boot\-up\&.
129 .sp
130 systemd automatically adds dependency of the type
131 \fIAfter=\fR
132 for this target unit to all services (except for those with
133 \fIDefaultDependencies=no\fR)\&.
134 .sp
135 Usually, this should pull\-in all local mount points plus
136 /var/,
137 /tmp/
138 and
139 /var/tmp/, swap devices, sockets, timers, path units and other basic initialization necessary for general purpose daemons\&. The mentioned mount points are special cased to allow them to be remote\&.
140 .sp
141 This target usually does not pull in any non\-target units directly, but rather does so indirectly via other early boot targets\&. It is instead meant as a synchronization point for late boot services\&. Refer to
142 \fBbootup\fR(7)
143 for details on the targets involved\&.
144 .RE
145 .PP
146 boot\-complete\&.target
147 .RS 4
148 This target is intended as generic synchronization point for services that shall determine or act on whether the boot process completed successfully\&. Order units that are required to succeed for a boot process to be considered successful before this unit, and add a
149 \fIRequires=\fR
150 dependency from the target unit to them\&. Order units that shall only run when the boot process is considered successful after the target unit and pull in the target from it, also with
151 \fIRequires=\fR\&. Note that by default this target unit is not part of the initial boot transaction, but is supposed to be pulled in only if required by units that want to run only on successful boots\&.
152 .sp
153 See
154 \fBsystemd-boot-check-no-failures.service\fR(8)
155 for a service that implements a generic system health check and orders itself before
156 boot\-complete\&.target\&.
157 .sp
158 See
159 \fBsystemd-bless-boot.service\fR(8)
160 for a service that propagates boot success information to the boot loader, and orders itself after
161 boot\-complete\&.target\&.
162 .sp
163 Added in version 240\&.
164 .RE
165 .PP
166 ctrl\-alt\-del\&.target
167 .RS 4
168 systemd starts this target whenever Control+Alt+Del is pressed on the console\&. Usually, this should be aliased (symlinked) to
169 reboot\&.target\&.
170 .RE
171 .PP
172 cryptsetup\&.target
173 .RS 4
174 A target that pulls in setup services for all encrypted block devices\&.
175 .RE
176 .PP
177 veritysetup\&.target
178 .RS 4
179 A target that pulls in setup services for all verity integrity protected block devices\&.
180 .sp
181 Added in version 248\&.
182 .RE
183 .PP
184 dbus\&.service
185 .RS 4
186 A special unit for the D\-Bus bus daemon\&. As soon as this service is fully started up systemd will connect to it and register its service\&.
187 .RE
188 .PP
189 dbus\&.socket
190 .RS 4
191 A special unit for the D\-Bus system bus socket\&. All units with
192 \fIType=dbus\fR
193 automatically gain a dependency on this unit\&.
194 .RE
195 .PP
196 default\&.target
197 .RS 4
198 The default unit systemd starts at bootup\&. Usually, this should be aliased (symlinked) to
199 multi\-user\&.target
200 or
201 graphical\&.target\&. See
202 \fBbootup\fR(7)
203 for more discussion\&.
204 .sp
205 The default unit systemd starts at bootup can be overridden with the
206 \fIsystemd\&.unit=\fR
207 kernel command line option, or more conveniently, with the short names like
208 \fIsingle\fR,
209 \fIrescue\fR,
210 \fI1\fR,
211 \fI3\fR,
212 \fI5\fR, \&...; see
213 \fBsystemd\fR(1)\&.
214 .sp
215 For typical unit files please set
216 "WantedBy="
217 to a regular target (like
218 multi\-user\&.target
219 or
220 graphical\&.target), instead of
221 default\&.target, since such a service will also be run on special boots like on system update, emergency boot\&...
222 .RE
223 .PP
224 display\-manager\&.service
225 .RS 4
226 The display manager service\&. Usually, this should be aliased (symlinked) to
227 gdm\&.service
228 or a similar display manager service\&.
229 .RE
230 .PP
231 emergency\&.target
232 .RS 4
233 A special target unit that starts an emergency shell on the main console\&. This target does not pull in other services or mounts\&. It is the most minimal version of starting the system in order to acquire an interactive shell; the only processes running are usually just the system manager (PID 1) and the shell process\&. This unit may be used by specifying
234 \fIemergency\fR
235 on the kernel command line; it is also used when a file system check on a required file system fails and boot\-up cannot continue\&. Compare with
236 rescue\&.target, which serves a similar purpose, but also starts the most basic services and mounts all file systems\&.
237 .sp
238 In many ways booting into
239 emergency\&.target
240 is similar to the effect of booting with
241 "init=/bin/sh"
242 on the kernel command line, except that emergency mode provides you with the full system and service manager, and allows starting individual units in order to continue the boot process in steps\&.
243 .sp
244 Note that depending on how
245 emergency\&.target
246 is reached, the root file system might be mounted read\-only or read\-write (no remounting is done specially for this target)\&. For example, the system may boot with root mounted read\-only when
247 \fIro\fR
248 is used on the kernel command line and remain this way for
249 emergency\&.target, or the system may transition to
250 emergency\&.target
251 after the system has been partially booted and disks have already been remounted read\-write\&.
252 .RE
253 .PP
254 exit\&.target
255 .RS 4
256 A special service unit for shutting down the system or user service manager\&. It is equivalent to
257 poweroff\&.target
258 on non\-container systems, and also works in containers\&.
259 .sp
260 systemd will start this unit when it receives the
261 \fBSIGTERM\fR
262 or
263 \fBSIGINT\fR
264 signal when running as user service daemon\&.
265 .sp
266 Normally, this (indirectly) pulls in
267 shutdown\&.target, which in turn should be conflicted by all units that want to be scheduled for shutdown when the service manager starts to exit\&.
268 .sp
269 Added in version 186\&.
270 .RE
271 .PP
272 factory\-reset\&.target
273 .RS 4
274 A special target to request a factory reset operation\&. This will typically persistently store a request flag for the next boot and then reboot in order to reset the system to factory state\&.
275 .sp
276 See
277 \m[blue]\fBFactory Reset\fR\m[]\&\s-2\u[1]\d\s+2
278 for more information\&.
279 .sp
280 Added in version 250\&.
281 .RE
282 .PP
283 factory\-reset\-now\&.target
284 .RS 4
285 A special target that is started on boots that shall execute a factory reset\&. It may be used to pull in additional services that shall be invoked during a factory reset operation\&. It also acts as ordering barrier: once the target is reached the factory reset state is marked as "completed"\&.
286 .sp
287 See
288 \m[blue]\fBFactory Reset\fR\m[]\&\s-2\u[1]\d\s+2
289 for more information\&.
290 .sp
291 Added in version 258\&.
292 .RE
293 .PP
294 final\&.target
295 .RS 4
296 A special target unit that is used during the shutdown logic and may be used to pull in late services after all normal services are already terminated and all mounts unmounted\&.
297 .RE
298 .PP
299 getty\&.target
300 .RS 4
301 A special target unit that pulls in statically configured local TTY
302 getty
303 instances\&.
304 .RE
305 .PP
306 graphical\&.target
307 .RS 4
308 A special target unit for setting up a graphical login screen\&. This pulls in
309 multi\-user\&.target\&.
310 .sp
311 Units that are needed for graphical logins shall add
312 \fIWants=\fR
313 dependencies for their unit to this unit (or
314 multi\-user\&.target) during installation\&. This is best configured via
315 \fIWantedBy=graphical\&.target\fR
316 in the unit\*(Aqs [Install] section\&.
317 .RE
318 .PP
319 hibernate\&.target
320 .RS 4
321 A special target unit for hibernating the system\&. This pulls in
322 sleep\&.target\&.
323 .RE
324 .PP
325 hybrid\-sleep\&.target
326 .RS 4
327 A special target unit for hibernating and suspending the system at the same time\&. This pulls in
328 sleep\&.target\&.
329 .sp
330 Added in version 196\&.
331 .RE
332 .PP
333 suspend\-then\-hibernate\&.target
334 .RS 4
335 A special target unit for suspending the system for a period of time, waking it and putting it into hibernate\&. This pulls in
336 sleep\&.target\&.
337 .sp
338 Added in version 239\&.
339 .RE
340 .PP
341 halt\&.target
342 .RS 4
343 A special target unit for shutting down and halting the system\&. Note that this target is distinct from
344 poweroff\&.target
345 in that it generally really just halts the system rather than powering it down\&.
346 .sp
347 Applications wanting to halt the system should not start this unit directly, but should instead execute
348 \fBsystemctl halt\fR
349 (possibly with the
350 \fB\-\-no\-block\fR
351 option) or call
352 \fBsystemd\fR(1)\*(Aqs
353 \fBorg\&.freedesktop\&.systemd1\&.Manager\&.Halt\fR
354 D\-Bus method directly\&.
355 .RE
356 .PP
357 imports\&.target
358 .RS 4
359 A target unit that pulls in all disk image download jobs to execute on system boot\&. This is used by
360 \fBsystemd-import-generator\fR(8)\&.
361 .sp
362 Added in version 258\&.
363 .RE
364 .PP
365 init\&.scope
366 .RS 4
367 This scope unit is where the system and service manager (PID 1) itself resides\&. It is active as long as the system is running\&.
368 .sp
369 Added in version 235\&.
370 .RE
371 .PP
372 initrd\&.target
373 .RS 4
374 This is the default target in the initrd, similar to
375 default\&.target
376 in the main system\&. It is used to mount the real root and transition to it\&. See
377 \fBbootup\fR(7)
378 for more discussion\&.
379 .sp
380 Added in version 245\&.
381 .RE
382 .PP
383 initrd\-fs\&.target
384 .RS 4
385 \fBsystemd-fstab-generator\fR(8)
386 automatically adds dependencies of type
387 \fIBefore=\fR
388 to
389 sysroot\-usr\&.mount
390 and all mount points found in
391 /etc/fstab
392 that have the
393 \fBx\-initrd\&.mount\fR
394 mount option set and do not have the
395 \fBnoauto\fR
396 mount option set\&. It is also indirectly ordered after
397 sysroot\&.mount\&. Thus, once this target is reached the
398 /sysroot/
399 hierarchy is fully set up, in preparation for the transition to the host OS\&.
400 .sp
401 Added in version 199\&.
402 .RE
403 .PP
404 initrd\-root\-device\&.target
405 .RS 4
406 A special initrd target unit that is reached when the root filesystem device is available, but before it has been mounted\&.
407 \fBsystemd-fstab-generator\fR(8)
408 and
409 \fBsystemd-gpt-auto-generator\fR(8)
410 automatically set up the appropriate dependencies to make this happen\&.
411 .sp
412 Added in version 230\&.
413 .RE
414 .PP
415 initrd\-root\-fs\&.target
416 .RS 4
417 \fBsystemd-fstab-generator\fR(8)
418 automatically adds dependencies of type
419 \fIBefore=\fR
420 to the
421 sysroot\&.mount
422 unit, which is generated from the kernel command line\*(Aqs
423 \fIroot=\fR
424 setting (or equivalent)\&.
425 .sp
426 Added in version 199\&.
427 .RE
428 .PP
429 initrd\-usr\-fs\&.target
430 .RS 4
431 \fBsystemd-fstab-generator\fR(8)
432 automatically adds dependencies of type
433 \fIBefore=\fR
434 to the
435 sysusr\-usr\&.mount
436 unit, which is generated from the kernel command line\*(Aqs
437 \fIusr=\fR
438 switch\&. Services may order themselves after this target unit in order to run once the
439 /sysusr/
440 hierarchy becomes available, on systems that come up initially without a root file system, but with an initialized
441 /usr/
442 and need to access that before setting up the root file system to ultimately switch to\&. On systems where
443 \fIusr=\fR
444 is not used this target is ordered after
445 sysroot\&.mount
446 and thus mostly equivalent to
447 initrd\-root\-fs\&.target\&. In effect on any system once this target is reached the file system backing
448 /usr/
449 is mounted, though possibly at two different locations, either below the
450 /sysusr/
451 or the
452 /sysroot/
453 hierarchies\&.
454 .sp
455 Added in version 249\&.
456 .RE
457 .PP
458 kbrequest\&.target
459 .RS 4
460 systemd starts this target whenever Alt+ArrowUp is pressed on the console\&. Note that any user with physical access to the machine will be able to do this, without authentication, so this should be used carefully\&.
461 .RE
462 .PP
463 kexec\&.target
464 .RS 4
465 A special target unit for shutting down and rebooting the system via kexec\&.
466 .sp
467 Applications wanting to reboot the system should not start this unit directly, but should instead execute
468 \fBsystemctl kexec\fR
469 (possibly with the
470 \fB\-\-no\-block\fR
471 option) or call
472 \fBsystemd-logind\fR(8)\*(Aqs
473 \fBorg\&.freedesktop\&.login1\&.Manager\&.RebootWithFlags()\fR
474 D\-Bus method directly\&.
475 .sp
476 See
477 \fBsystemd-kexec.service\fR(8)
478 for further details of the operation this target pulls in\&.
479 .RE
480 .PP
481 local\-fs\&.target
482 .RS 4
483 \fBsystemd-fstab-generator\fR(8)
484 automatically adds dependencies of type
485 \fIBefore=\fR
486 to all mount units that refer to local mount points for this target unit\&. In addition, it adds dependencies of type
487 \fIWants=\fR
488 to this target unit for those mounts listed in
489 /etc/fstab
490 that have the
491 \fBauto\fR
492 mount option set\&.
493 .RE
494 .PP
495 machines\&.target
496 .RS 4
497 A standard target unit for starting all the containers and other virtual machines\&. See
498 systemd\-nspawn@\&.service
499 for an example\&.
500 .sp
501 Added in version 233\&.
502 .RE
503 .PP
504 multi\-user\&.target
505 .RS 4
506 A special target unit for setting up a multi\-user system (non\-graphical)\&. This is pulled in by
507 graphical\&.target\&.
508 .sp
509 Units that are needed for a multi\-user system shall add
510 \fIWants=\fR
511 dependencies for their unit to this unit during installation\&. This is best configured via
512 \fIWantedBy=multi\-user\&.target\fR
513 in the unit\*(Aqs [Install] section\&.
514 .RE
515 .PP
516 network\-online\&.target
517 .RS 4
518 Units that strictly require a configured network connection should pull in
519 network\-online\&.target
520 (via a
521 \fIWants=\fR
522 type dependency) and order themselves after it\&. This target unit is intended to pull in a service that delays further execution until the network is sufficiently set up\&. What precisely this requires is left to the implementation of the network managing service\&.
523 .sp
524 Note the distinction between this unit and
525 network\&.target\&. This unit is an active unit (i\&.e\&. pulled in by the consumer rather than the provider of this functionality) and pulls in a service which possibly adds substantial delays to further execution\&. In contrast,
526 network\&.target
527 is a passive unit (i\&.e\&. pulled in by the provider of the functionality, rather than the consumer) that usually does not delay execution much\&. Usually,
528 network\&.target
529 is part of the boot of most systems, while
530 network\-online\&.target
531 is not, except when at least one unit requires it\&. Also see
532 \m[blue]\fBRunning Services After the Network Is Up\fR\m[]\&\s-2\u[2]\d\s+2
533 for more information\&.
534 .sp
535 All mount units for remote network file systems automatically pull in this unit, and order themselves after it\&. Note that networking daemons that simply
536 \fIprovide\fR
537 functionality to other hosts (as opposed to
538 \fIconsume\fR
539 functionality of other hosts) generally do not need to pull this in\&.
540 .sp
541 Note that this unit is only useful during the original system start\-up logic\&. After the system has completed booting up, it will not track the online state of the system anymore\&. Due to this it cannot be used as a network connection monitor concept, it is purely a one\-time system start\-up concept\&.
542 .sp
543 Added in version 200\&.
544 .RE
545 .PP
546 paths\&.target
547 .RS 4
548 A special target unit that sets up all path units (see
549 \fBsystemd.path\fR(5)
550 for details) that shall be active after boot\&.
551 .sp
552 It is recommended that path units installed by applications get pulled in via
553 \fIWants=\fR
554 dependencies from this unit\&. This is best configured via a
555 \fIWantedBy=paths\&.target\fR
556 in the path unit\*(Aqs [Install] section\&.
557 .sp
558 Added in version 199\&.
559 .RE
560 .PP
561 poweroff\&.target
562 .RS 4
563 A special target unit for shutting down and powering off the system\&.
564 .sp
565 Applications wanting to power off the system should not start this unit directly, but should instead execute
566 \fBsystemctl poweroff\fR
567 (possibly with the
568 \fB\-\-no\-block\fR
569 option) or call
570 \fBsystemd-logind\fR(8)\*(Aqs
571 \fBorg\&.freedesktop\&.login1\&.Manager\&.PowerOff\fR
572 D\-Bus method directly\&.
573 .RE
574 .PP
575 reboot\&.target
576 .RS 4
577 A special target unit for shutting down and rebooting the system\&.
578 .sp
579 Applications wanting to reboot the system should not start this unit directly, but should instead execute
580 \fBsystemctl reboot\fR
581 (possibly with the
582 \fB\-\-no\-block\fR
583 option) or call
584 \fBsystemd-logind\fR(8)\*(Aqs
585 \fBorg\&.freedesktop\&.login1\&.Manager\&.Reboot()\fR
586 D\-Bus method directly\&.
587 .sp
588 See
589 \fBsystemd-reboot.service\fR(8)
590 for further details of the operation this target pulls in\&.
591 .RE
592 .PP
593 remote\-cryptsetup\&.target
594 .RS 4
595 Similar to
596 cryptsetup\&.target, but for encrypted devices which are accessed over the network\&. It is used for
597 \fBcrypttab\fR(5)
598 entries marked with
599 \fB_netdev\fR\&.
600 .sp
601 Added in version 235\&.
602 .RE
603 .PP
604 remote\-integritysetup\&.target
605 .RS 4
606 Similar to
607 integritysetup\&.target, but for integrity protected devices which are accessed over the network\&. It is used for
608 \fBintegritytab\fR(5)
609 entries marked with
610 \fB_netdev\fR\&.
611 .sp
612 Added in version 258\&.
613 .RE
614 .PP
615 remote\-veritysetup\&.target
616 .RS 4
617 Similar to
618 veritysetup\&.target, but for verity protected devices which are accessed over the network\&. It is used for
619 \fBveritytab\fR(5)
620 entries marked with
621 \fB_netdev\fR\&.
622 .sp
623 Added in version 248\&.
624 .RE
625 .PP
626 remote\-fs\&.target
627 .RS 4
628 Similar to
629 local\-fs\&.target, but for remote mount points\&.
630 .RE
631 .PP
632 rescue\&.target
633 .RS 4
634 A special target unit that pulls in the base system (including system mounts) and spawns a rescue shell\&. Isolate to this target in order to administer the system in single\-user mode with all file systems mounted but with no services running, except for the most basic\&. Compare with
635 emergency\&.target, which is much more reduced and does not provide the file systems or most basic services\&. Compare with
636 multi\-user\&.target, this target could be seen as
637 single\-user\&.target\&.
638 .sp
639 Use the
640 "systemd\&.unit=rescue\&.target"
641 kernel command line option to boot into this mode\&. A short alias for this kernel command line option is
642 "1", for compatibility with SysV\&.
643 .RE
644 .PP
645 shutdown\&.target
646 .RS 4
647 A special target unit that terminates the services on system shutdown\&.
648 .sp
649 Services that shall be terminated on system shutdown shall add
650 \fIConflicts=\fR
651 and
652 \fIBefore=\fR
653 dependencies to this unit for their service unit, which is implicitly done when
654 \fIDefaultDependencies=yes\fR
655 is set (the default)\&.
656 .RE
657 .PP
658 sigpwr\&.target
659 .RS 4
660 A special target that is started when systemd receives the SIGPWR process signal, which is normally sent by the kernel or UPS daemons when power fails\&.
661 .RE
662 .PP
663 sleep\&.target
664 .RS 4
665 A special target unit that is pulled in by
666 suspend\&.target,
667 hibernate\&.target,
668 suspend\-then\-hibernate\&.target, and
669 hybrid\-sleep\&.target
670 and may be used to hook units into the sleep state logic\&.
671 .sp
672 In order to hook external programs
673 \fIbefore\fR
674 the actual system sleep operation, place their command line in a service unit file\*(Aqs
675 \fIExecStart=\fR
676 line (use
677 \fIType=oneshot\fR), and ensure the unit is pulled in by
678 sleep\&.target
679 and ordered before it\&. In order to hook program code
680 \fIafter\fR
681 the actual system sleep operation (i\&.e\&. to be run after the system woke up again), place the command in
682 \fIExecStop=\fR
683 instead, and make sure to enable
684 \fIStopWhenUnneeded=\fR
685 and
686 \fIRemainAfterExit=\fR\&. Both approaches can be combined into one unit file in order to run programs both before and after the sleep operation\&.
687 .PP
688 \fBExample\ \&1.\ \&Combined Example\fR
689 .sp
690 .if n \{\
691 .RS 4
692 .\}
693 .nf
694 [Unit]
695 DefaultDependencies=no
696 StopWhenUnneeded=yes
697 Before=sleep\&.target
698
699 [Service]
700 Type=oneshot
701 RemainAfterExit=yes
702 ExecStart=/usr/bin/some\-before\-command
703 ExecStop=/usr/bin/some\-after\-command
704
705 [Install]
706 WantedBy=sleep\&.target
707 .fi
708 .if n \{\
709 .RE
710 .\}
711 .RE
712 .PP
713 slices\&.target
714 .RS 4
715 A special target unit that sets up all slice units (see
716 \fBsystemd.slice\fR(5)
717 for details) that shall always be active after boot\&. By default, the generic
718 system\&.slice
719 slice unit as well as the root slice unit
720 \-\&.slice
721 are pulled in and ordered before this unit (see below)\&.
722 .sp
723 Adding slice units to
724 slices\&.target
725 is generally not necessary\&. Instead, when some unit that uses
726 \fISlice=\fR
727 is started, the specified slice will be started automatically\&. Adding
728 \fIWantedBy=slices\&.target\fR
729 lines to the [Install] section should only be done for units that need to be always active\&. In that case care needs to be taken to avoid creating a loop through the automatic dependencies on "parent" slices\&.
730 .sp
731 Added in version 229\&.
732 .RE
733 .PP
734 sockets\&.target
735 .RS 4
736 A special target unit that sets up all socket units (see
737 \fBsystemd.socket\fR(5)
738 for details) that shall be active after boot\&.
739 .sp
740 Services that can be socket\-activated shall add
741 \fIWants=\fR
742 dependencies to this unit for their socket unit during installation\&. This is best configured via a
743 \fIWantedBy=sockets\&.target\fR
744 in the socket unit\*(Aqs [Install] section\&.
745 .RE
746 .PP
747 soft\-reboot\&.target
748 .RS 4
749 A special target unit for shutting down and rebooting the userspace of the system (leaving the kernel running)\&.
750 .sp
751 Applications wanting to reboot the system should not start this unit directly, but should instead execute
752 \fBsystemctl soft\-reboot\fR
753 (possibly with the
754 \fB\-\-no\-block\fR
755 option) or call
756 \fBsystemd-logind\fR(8)\*(Aqs
757 \fBorg\&.freedesktop\&.login1\&.Manager\&.RebootWithFlags()\fR
758 D\-Bus method directly\&.
759 .sp
760 See
761 \fBsystemd-soft-reboot.service\fR(8)
762 for further details of the operation this target pulls in\&.
763 .sp
764 Added in version 254\&.
765 .RE
766 .PP
767 storage\-target\-mode\&.target
768 .RS 4
769 A special target unit that can be booted into that selects the "Storage Target Mode" for the OS\&. In this mode all local storage disks are exposed to external systems as block devices\&. This invokes
770 \fBsystemd-storagetm.service\fR(8)
771 which exposes all local disks as NVMe\-TCP devices for access over the network\&. It might as well invoke other services too that make local disks available via other mechanisms\&.
772 .sp
773 Added in version 255\&.
774 .RE
775 .PP
776 suspend\&.target
777 .RS 4
778 A special target unit for suspending the system\&. This pulls in
779 sleep\&.target\&.
780 .RE
781 .PP
782 swap\&.target
783 .RS 4
784 Similar to
785 local\-fs\&.target, but for swap partitions and swap files\&.
786 .RE
787 .PP
788 sysinit\&.target
789 .RS 4
790 systemd automatically adds dependencies of the types
791 \fIRequires=\fR
792 and
793 \fIAfter=\fR
794 for this target unit to all services (except for those with
795 \fIDefaultDependencies=no\fR)\&.
796 .sp
797 This target pulls in the services required for system initialization\&. System services pulled in by this target should declare
798 \fIDefaultDependencies=no\fR
799 and specify all their dependencies manually, including access to anything more than a read only root filesystem\&. For details on the dependencies of this target, refer to
800 \fBbootup\fR(7)\&.
801 .RE
802 .PP
803 syslog\&.socket
804 .RS 4
805 The socket unit syslog implementations should listen on\&. All userspace log messages will be made available on this socket\&. For more information about syslog integration, please consult the
806 \m[blue]\fBSyslog Interface\fR\m[]\&\s-2\u[3]\d\s+2
807 document\&.
808 .RE
809 .PP
810 system\-update\&.target, system\-update\-pre\&.target, system\-update\-cleanup\&.service
811 .RS 4
812 A special target unit that is used for offline system updates\&.
813 \fBsystemd-system-update-generator\fR(8)
814 will redirect the boot process to this target if
815 /system\-update
816 or
817 /etc/system\-update
818 exists\&. For more information see
819 \fBsystemd.offline-updates\fR(7)\&.
820 .sp
821 Updates should happen before the
822 system\-update\&.target
823 is reached, and the services which implement them should cause the machine to reboot\&. The main units executing the update should order themselves after
824 system\-update\-pre\&.target
825 but not pull it in\&. Services which want to run during system updates only, but before the actual system update is executed should order themselves before this unit and pull it in\&. As a safety measure, if this does not happen, and
826 /system\-update
827 or
828 /etc/system\-update
829 still exists after
830 system\-update\&.target
831 is reached,
832 system\-update\-cleanup\&.service
833 will remove the symlinks and reboot the machine\&.
834 .sp
835 Added in version 186\&.
836 .RE
837 .PP
838 timers\&.target
839 .RS 4
840 A special target unit that sets up all timer units (see
841 \fBsystemd.timer\fR(5)
842 for details) that shall be active after boot\&.
843 .sp
844 It is recommended that timer units installed by applications get pulled in via
845 \fIWants=\fR
846 dependencies from this unit\&. This is best configured via
847 \fIWantedBy=timers\&.target\fR
848 in the timer unit\*(Aqs [Install] section\&.
849 .sp
850 Added in version 199\&.
851 .RE
852 .PP
853 umount\&.target
854 .RS 4
855 A special target unit that unmounts all mount and automount points on system shutdown\&.
856 .sp
857 Mounts that shall be unmounted on system shutdown shall add Conflicts dependencies to this unit for their mount unit, which is implicitly done when
858 \fIDefaultDependencies=yes\fR
859 is set (the default)\&.
860 .RE
861 .SS "Special System Units for Devices"
862 .PP
863 Some target units are automatically pulled in as devices of certain kinds show up in the system\&. These may be used to automatically activate various services based on the specific type of the available hardware\&.
864 .PP
865 bluetooth\&.target
866 .RS 4
867 This target is started automatically as soon as a Bluetooth controller is plugged in or becomes available at boot\&.
868 .sp
869 This may be used to pull in Bluetooth management daemons dynamically when Bluetooth hardware is found\&.
870 .RE
871 .PP
872 printer\&.target
873 .RS 4
874 This target is started automatically as soon as a printer is plugged in or becomes available at boot\&.
875 .sp
876 This may be used to pull in printer management daemons dynamically when printer hardware is found\&.
877 .RE
878 .PP
879 smartcard\&.target
880 .RS 4
881 This target is started automatically as soon as a smartcard controller is plugged in or becomes available at boot\&.
882 .sp
883 This may be used to pull in smartcard management daemons dynamically when smartcard hardware is found\&.
884 .RE
885 .PP
886 sound\&.target
887 .RS 4
888 This target is started automatically as soon as a sound card is plugged in or becomes available at boot\&.
889 .sp
890 This may be used to pull in audio management daemons dynamically when audio hardware is found\&.
891 .RE
892 .PP
893 usb\-gadget\&.target
894 .RS 4
895 This target is started automatically as soon as a USB Device Controller becomes available at boot\&.
896 .sp
897 This may be used to pull in usb gadget dynamically when UDC hardware is found\&.
898 .sp
899 Added in version 242\&.
900 .RE
901 .PP
902 tpm2\&.target
903 .RS 4
904 This target is started automatically if a TPM2 device is discovered, either by the OS or by the firmware\&. It acts as synchronization point for services that require TPM2 device access\&. The target unit is enqueued by
905 \fBsystemd-tpm2-generator\fR(8)
906 if it detects that the firmware has discovered a TPM2 device but the OS kernel has not activated a driver for it yet\&. It is also pulled in whenever
907 \fBsystemd-udevd.service\fR(8)
908 discovers a TPM2 device\&. The target unit is ordered after the
909 /dev/tpmrm0
910 device node, so that it only becomes active once the TPM2 device is actually accessible\&. Early boot programs that intend to access the TPM2 device should hence order themselves after this target unit, but not pull it in\&.
911 .sp
912 Added in version 256\&.
913 .RE
914 .SS "Special Passive System Units"
915 .PP
916 A number of special system targets are defined that can be used to properly order boot\-up of optional services\&. These targets are generally not part of the initial boot transaction, unless they are explicitly pulled in by one of the implementing services\&. Note specifically that these
917 \fIpassive\fR
918 target units are generally not pulled in by the consumer of a service, but by the provider of the service\&. This means: a consuming service should order itself after these targets (as appropriate), but not pull it in\&. A providing service should order itself before these targets (as appropriate) and pull it in (via a
919 \fIWants=\fR
920 type dependency)\&.
921 .PP
922 Note that these passive units cannot be started manually, i\&.e\&.
923 "systemctl start time\-sync\&.target"
924 will fail with an error\&. They can only be pulled in by dependency\&. This is enforced since they exist for ordering purposes only and thus are not useful as only unit within a transaction\&.
925 .PP
926 blockdev@\&.target
927 .RS 4
928 This template unit is used to order mount units and other consumers of block devices after services that synthesize these block devices\&. In particular, this is intended to be used with storage services (such as
929 \[email protected]\fR(5)/
930 \[email protected]\fR(8)) that allocate and manage a virtual block device\&. Storage services are ordered before an instance of
931 blockdev@\&.target, and the consumer units after it\&. The ordering is particularly relevant during shutdown, as it ensures that the mount is deactivated first and the service backing the mount later\&. The
932 blockdev@\&.target
933 instance should be pulled in via a
934 \fBWants=\fR
935 dependency of the storage daemon and thus generally not be part of any transaction unless a storage daemon is used\&. The instance name for instances of this template unit must be a properly escaped block device node path, e\&.g\&.
936 blockdev@dev\-mapper\-foobar\&.target
937 for the storage device
938 /dev/mapper/foobar\&.
939 .sp
940 Added in version 245\&.
941 .RE
942 .PP
943 cryptsetup\-pre\&.target
944 .RS 4
945 This passive target unit may be pulled in by services that want to run before any encrypted block device is set up\&. All encrypted block devices are set up after this target has been reached\&. Since the shutdown order is implicitly the reverse start\-up order between units, this target is particularly useful to ensure that a service is shut down only after all encrypted block devices are fully stopped\&.
946 .sp
947 Added in version 215\&.
948 .RE
949 .PP
950 veritysetup\-pre\&.target
951 .RS 4
952 This passive target unit may be pulled in by services that want to run before any verity integrity protected block device is set up\&. All verity integrity protected block devices are set up after this target has been reached\&. Since the shutdown order is implicitly the reverse start\-up order between units, this target is particularly useful to ensure that a service is shut down only after all verity integrity protected block devices are fully stopped\&.
953 .sp
954 Added in version 248\&.
955 .RE
956 .PP
957 first\-boot\-complete\&.target
958 .RS 4
959 This passive target is intended as a synchronization point for units that need to run once during the first boot\&. Only after all units ordered before this target have finished, will the
960 \fBmachine-id\fR(5)
961 be committed to disk, marking the first boot as completed\&. If the boot is aborted at any time before that, the next boot will re\-run any units with
962 \fIConditionFirstBoot=yes\fR\&.
963 .sp
964 Added in version 247\&.
965 .RE
966 .PP
967 getty\-pre\&.target
968 .RS 4
969 A special passive target unit\&. Users of this target are expected to pull it in the boot transaction via a dependency (e\&.g\&.
970 \fIWants=\fR)\&. Order your unit before this unit if you want to make use of the console just before
971 getty
972 is started\&.
973 .sp
974 Added in version 235\&.
975 .RE
976 .PP
977 imports\-pre\&.target
978 .RS 4
979 A passive unit that is ordered before all disk image download jobs to execute on system boot\&. This is used by
980 \fBsystemd-import-generator\fR(8)\&.
981 .sp
982 Added in version 258\&.
983 .RE
984 .PP
985 local\-fs\-pre\&.target
986 .RS 4
987 This target unit is automatically ordered before all local mount points marked with
988 \fBauto\fR
989 (see above)\&. It can be used to execute certain units before all local mounts\&.
990 .RE
991 .PP
992 network\&.target
993 .RS 4
994 This unit is supposed to indicate when network functionality is available, but it is only very weakly defined what that is supposed to mean\&. However, the following should apply at minimum:
995 .sp
996 .RS 4
997 .ie n \{\
998 \h'-04'\(bu\h'+03'\c
999 .\}
1000 .el \{\
1001 .sp -1
1002 .IP \(bu 2.3
1003 .\}
1004 At start\-up, any configured synthetic network devices (i\&.e\&. not physical ones that require hardware to show up and be probed, but virtual ones like bridge devices and similar which are created programmatically) that do not depend on any underlying hardware should be allocated by the time this target is reached\&. It is not necessary for these interfaces to also have completed IP level configuration by the time
1005 network\&.target
1006 is reached\&.
1007 .RE
1008 .sp
1009 .RS 4
1010 .ie n \{\
1011 \h'-04'\(bu\h'+03'\c
1012 .\}
1013 .el \{\
1014 .sp -1
1015 .IP \(bu 2.3
1016 .\}
1017 At shutdown, a unit that is ordered after
1018 network\&.target
1019 will be stopped before the network \(em to whatever level it might be set up by then \(em is shut down\&. It is hence useful when writing service files that require network access on shutdown, which should order themselves after this target, but not pull it in\&. Also see
1020 \m[blue]\fBRunning Services After the Network Is Up\fR\m[]\&\s-2\u[2]\d\s+2
1021 for more information\&.
1022 .RE
1023 .sp
1024 It must emphasized that at start\-up there\*(Aqs no guarantee that hardware\-based devices have shown up by the time this target is reached, or even acquired complete IP configuration\&. For that purpose use
1025 network\-online\&.target
1026 as described above\&.
1027 .RE
1028 .PP
1029 network\-pre\&.target
1030 .RS 4
1031 This passive target unit may be pulled in by services that want to run before any network is set up, for example for the purpose of setting up a firewall\&. All network management software orders itself after this target, but does not pull it in\&. Also see
1032 \m[blue]\fBRunning Services After the Network Is Up\fR\m[]\&\s-2\u[2]\d\s+2
1033 for more information\&.
1034 .sp
1035 Added in version 214\&.
1036 .RE
1037 .PP
1038 nss\-lookup\&.target
1039 .RS 4
1040 A target that should be used as synchronization point for all host/network name service lookups\&. Note that this is independent of UNIX user/group name lookups for which
1041 nss\-user\-lookup\&.target
1042 should be used\&. All services for which the availability of full host/network name resolution is essential should be ordered after this target, but not pull it in\&.
1043 .RE
1044 .PP
1045 nss\-user\-lookup\&.target
1046 .RS 4
1047 A target that should be used as synchronization point for all regular UNIX user/group name service lookups\&. Note that this is independent of host/network name lookups for which
1048 nss\-lookup\&.target
1049 should be used\&. All services for which the availability of the full user/group database is essential should be ordered after this target, but not pull it in\&. All services which provide parts of the user/group database should be ordered before this target, and pull it in\&. Note that this unit is only relevant for regular users and groups \(em system users and groups are required to be resolvable during earliest boot already, and hence do not need any special ordering against this target\&.
1050 .RE
1051 .PP
1052 remote\-fs\-pre\&.target
1053 .RS 4
1054 This target unit is automatically ordered before all mount point units (see above) and cryptsetup/veritysetup devices marked with the
1055 \fB_netdev\fR\&. It can be used to run certain units before remote encrypted devices and mounts are established\&. Note that this unit is generally not part of the initial transaction, unless the unit that wants to be ordered before all remote mounts pulls it in via a
1056 \fIWants=\fR
1057 type dependency\&. If the unit wants to be pulled in by the first remote mount showing up, it should use
1058 network\-online\&.target
1059 (see above)\&.
1060 .RE
1061 .PP
1062 rpcbind\&.target
1063 .RS 4
1064 The portmapper/rpcbind pulls in this target and orders itself before it, to indicate its availability\&.
1065 .RE
1066 .PP
1067 ssh\-access\&.target
1068 .RS 4
1069 Service and socket units that provide remote SSH secure shell access to the local system should pull in this unit and order themselves before this unit\&. It\*(Aqs supposed to act as a milestone indicating if and when SSH access into the system is available\&. It should only become active when an SSH port is bound for remote clients (i\&.e\&. if SSH is used as a local privilege escalation mechanism, it should
1070 \fInot\fR
1071 involve this target unit), regardless of the protocol choices, i\&.e\&. regardless of whether IPv4, IPv6 or
1072 \fBAF_VSOCK\fR
1073 is used\&.
1074 .sp
1075 Added in version 256\&.
1076 .RE
1077 .PP
1078 time\-set\&.target
1079 .RS 4
1080 Services responsible for setting the system clock (\fBCLOCK_REALTIME\fR) from a local source (such as a maintained timestamp file or imprecise real\-time clock) should pull in this target and order themselves before it\&. Services where approximate, roughly monotonic time is desired should be ordered after this unit, but not pull it in\&.
1081 .sp
1082 This target does not provide the accuracy guarantees of
1083 time\-sync\&.target
1084 (see below), however does not depend on remote clock sources to be reachable, i\&.e\&. the target is typically not delayed by network problems and similar\&. Use of this target is recommended for services where approximate clock accuracy and rough monotonicity is desired but activation shall not be delayed for possibly unreliable network communication\&.
1085 .sp
1086 The service manager automatically adds dependencies of type
1087 \fIAfter=\fR
1088 for this target unit to all timer units with at least one
1089 \fIOnCalendar=\fR
1090 directive\&.
1091 .sp
1092 The
1093 \fBsystemd-timesyncd.service\fR(8)
1094 service is a simple daemon that pulls in this target and orders itself before it\&. Besides implementing the SNTP network protocol it maintains a timestamp file on disk whose modification time is regularly updated\&. At service start\-up the local system clock is set from that modification time, ensuring it increases roughly monotonically\&.
1095 .sp
1096 Note that ordering a unit after
1097 time\-set\&.target
1098 only has effect if there\*(Aqs actually a service ordered before it that delays it until the clock is adjusted for rough monotonicity\&. Otherwise, this target might get reached before the clock is adjusted to be roughly monotonic\&. Enable
1099 \fBsystemd-timesyncd.service\fR(8), or an alternative NTP implementation to delay the target\&.
1100 .sp
1101 Added in version 242\&.
1102 .RE
1103 .PP
1104 time\-sync\&.target
1105 .RS 4
1106 Services indicating completed synchronization of the system clock (\fBCLOCK_REALTIME\fR) to a remote source should pull in this target and order themselves before it\&. Services where accurate time is essential should be ordered after this unit, but not pull it in\&.
1107 .sp
1108 The service manager automatically adds dependencies of type
1109 \fIAfter=\fR
1110 for this target unit to all timer units with at least one
1111 \fIOnCalendar=\fR
1112 directive\&.
1113 .sp
1114 This target provides stricter clock accuracy guarantees than
1115 time\-set\&.target
1116 (see above), but likely requires network communication and thus introduces unpredictable delays\&. Services that require clock accuracy and where network communication delays are acceptable should use this target\&. Services that require a less accurate clock, and only approximate and roughly monotonic clock behaviour should use
1117 time\-set\&.target
1118 instead\&.
1119 .sp
1120 Note that ordering a unit after
1121 time\-sync\&.target
1122 only has effect if there\*(Aqs actually a service ordered before it that delays it until clock synchronization is reached\&. Otherwise, this target might get reached before the clock is synchronized to any remote accurate reference clock\&. When using
1123 \fBsystemd-timesyncd.service\fR(8), enable
1124 \fBsystemd-time-wait-sync.service\fR(8)
1125 to delay the target; or use an equivalent service for other NTP implementations\&.
1126 .sp
1127 .it 1 an-trap
1128 .nr an-no-space-flag 1
1129 .nr an-break-flag 1
1130 .br
1131 .B Table\ \&1.\ \&Comparison
1132 .TS
1133 allbox tab(:);
1134 lB lB.
1135 T{
1136 time\-set\&.target
1137 T}:T{
1138 time\-sync\&.target
1139 T}
1140 .T&
1141 l l
1142 l l
1143 l l
1144 l l
1145 l l.
1146 T{
1147 "quick" to reach
1148 T}:T{
1149 "slow" to reach
1150 T}
1151 T{
1152 typically uses local clock sources, boot process not affected by availability of external resources
1153 T}:T{
1154 typically uses remote clock sources, inserts dependencies on remote resources into boot process
1155 T}
1156 T{
1157 reliable, because local
1158 T}:T{
1159 unreliable, because typically network involved
1160 T}
1161 T{
1162 typically guarantees an approximate and roughly monotonic clock only
1163 T}:T{
1164 typically guarantees an accurate clock
1165 T}
1166 T{
1167 implemented by systemd\-timesyncd\&.service
1168 T}:T{
1169 implemented by systemd\-time\-wait\-sync\&.service
1170 T}
1171 .TE
1172 .sp 1
1173 .RE
1174 .SS "Special Slice Units"
1175 .PP
1176 There are four
1177 "\&.slice"
1178 units which form the basis of the hierarchy for assignment of resources for services, users, and virtual machines or containers\&. See
1179 \fBsystemd.slice\fR(5)
1180 for details about slice units\&.
1181 .PP
1182 \-\&.slice
1183 .RS 4
1184 The root slice is the root of the slice hierarchy\&. It usually does not contain units directly, but may be used to set defaults for the whole tree\&.
1185 .sp
1186 Added in version 206\&.
1187 .RE
1188 .PP
1189 machine\&.slice
1190 .RS 4
1191 By default, all virtual machines and containers registered with
1192 \fBsystemd\-machined\fR
1193 are found in this slice\&. This is pulled in by
1194 systemd\-machined\&.service\&.
1195 .sp
1196 Added in version 206\&.
1197 .RE
1198 .PP
1199 capsule\&.slice
1200 .RS 4
1201 By default, all capsules encapsulated in
1202 capsule@\&.service
1203 are found in this slice\&.
1204 .sp
1205 Added in version 255\&.
1206 .RE
1207 .PP
1208 system\&.slice
1209 .RS 4
1210 By default, all system services started by
1211 \fBsystemd\fR
1212 are found in this slice\&.
1213 .sp
1214 Added in version 206\&.
1215 .RE
1216 .PP
1217 user\&.slice
1218 .RS 4
1219 By default, all user processes and services started on behalf of the user, including the per\-user systemd instance are found in this slice\&. This is pulled in by
1220 systemd\-logind\&.service\&.
1221 .sp
1222 Added in version 206\&.
1223 .RE
1224 .SH "UNITS MANAGED BY THE USER SERVICE MANAGER"
1225 .SS "Special User Units"
1226 .PP
1227 When systemd runs as a user instance, the following special units are available:
1228 .PP
1229 default\&.target
1230 .RS 4
1231 This is the main target of the user service manager, started by default when the service manager is invoked\&. Various services that compose the normal user session should be pulled into this target\&. In this regard,
1232 default\&.target
1233 is similar to
1234 multi\-user\&.target
1235 in the system instance, but it is a real unit, not an alias\&.
1236 .sp
1237 Added in version 242\&.
1238 .RE
1239 .PP
1240 capsule@\&.target
1241 .RS 4
1242 This is the main target of capsule service managers, started by default, instantiated with the capsule name\&. This may be used to define different sets of units that are started for different capsules via generic unit definitions\&. For details about capsules see
1243 \[email protected]\fR(5)\&.
1244 .sp
1245 Added in version 255\&.
1246 .RE
1247 .PP
1248 In addition, the following units are available which have definitions similar to their system counterparts:
1249 exit\&.target,
1250 shutdown\&.target,
1251 sockets\&.target,
1252 timers\&.target,
1253 paths\&.target,
1254 bluetooth\&.target,
1255 printer\&.target,
1256 smartcard\&.target,
1257 sound\&.target\&.
1258 .SS "Special Passive User Units"
1259 .PP
1260 graphical\-session\&.target
1261 .RS 4
1262 This target is active whenever any graphical session is running\&. It is used to stop user services which only apply to a graphical (X, Wayland, etc\&.) session when the session is terminated\&. Such services should have
1263 "PartOf=graphical\-session\&.target"
1264 in their [Unit] section\&. A target for a particular session (e\&. g\&.
1265 gnome\-session\&.target) starts and stops
1266 "graphical\-session\&.target"
1267 with
1268 "BindsTo=graphical\-session\&.target"\&.
1269 .sp
1270 Which services are started by a session target is determined by the
1271 "Wants="
1272 and
1273 "Requires="
1274 dependencies\&. For services that can be enabled independently, symlinks in
1275 "\&.wants/"
1276 and
1277 "\&.requires/"
1278 should be used, see
1279 \fBsystemd.unit\fR(5)\&. Those symlinks should either be shipped in packages, or should be added dynamically after installation, for example using
1280 "systemctl add\-wants", see
1281 \fBsystemctl\fR(1)\&.
1282 .PP
1283 \fBExample\ \&2.\ \&Nautilus as part of a GNOME session\fR
1284 "gnome\-session\&.target"
1285 pulls in Nautilus as top\-level service:
1286 .sp
1287 .if n \{\
1288 .RS 4
1289 .\}
1290 .nf
1291 [Unit]
1292 Description=User systemd services for GNOME graphical session
1293 Wants=nautilus\&.service
1294 BindsTo=graphical\-session\&.target
1295 .fi
1296 .if n \{\
1297 .RE
1298 .\}
1299 .sp
1300 "nautilus\&.service"
1301 gets stopped when the session stops:
1302 .sp
1303 .if n \{\
1304 .RS 4
1305 .\}
1306 .nf
1307 [Unit]
1308 Description=Render the desktop icons with Nautilus
1309 PartOf=graphical\-session\&.target
1310
1311 [Service]
1312 \&...
1313 .fi
1314 .if n \{\
1315 .RE
1316 .\}
1317
1318 Added in version 234\&.
1319 .RE
1320 .PP
1321 graphical\-session\-pre\&.target
1322 .RS 4
1323 This target contains services which set up the environment or global configuration of a graphical session, such as SSH/GPG agents (which need to export an environment variable into all desktop processes) or migration of obsolete d\-conf keys after an OS upgrade (which needs to happen before starting any process that might use them)\&. This target must be started before starting a graphical session like
1324 gnome\-session\&.target\&.
1325 .sp
1326 Added in version 234\&.
1327 .RE
1328 .PP
1329 xdg\-desktop\-autostart\&.target
1330 .RS 4
1331 The XDG specification defines a way to autostart applications using XDG desktop files\&. systemd ships
1332 \fBsystemd-xdg-autostart-generator\fR(8)
1333 for the XDG desktop files in autostart directories\&. Desktop Environments can opt\-in to use this service by adding a
1334 \fIWants=\fR
1335 dependency on
1336 xdg\-desktop\-autostart\&.target\&.
1337 .sp
1338 Added in version 246\&.
1339 .RE
1340 .SS "Special User Slice Units"
1341 .PP
1342 There are four
1343 "\&.slice"
1344 units which form the basis of the user hierarchy for assignment of resources for user applications and services\&. See
1345 \fBsystemd.slice\fR(5)
1346 for details about slice units and the documentation about
1347 \m[blue]\fBDesktop Environments\fR\m[]\&\s-2\u[4]\d\s+2
1348 for further information\&.
1349 .PP
1350 \-\&.slice
1351 .RS 4
1352 The root slice is the root of the user\*(Aqs slice hierarchy\&. It usually does not contain units directly, but may be used to set defaults for the whole tree\&.
1353 .sp
1354 Added in version 247\&.
1355 .RE
1356 .PP
1357 app\&.slice
1358 .RS 4
1359 By default, all user services and applications managed by
1360 \fBsystemd\fR
1361 are found in this slice\&. All interactively launched applications like web browsers and text editors as well as non\-critical services should be placed into this slice\&.
1362 .sp
1363 Added in version 247\&.
1364 .RE
1365 .PP
1366 session\&.slice
1367 .RS 4
1368 All essential services and applications required for the session should use this slice\&. These are services that either cannot be restarted easily or where latency issues may affect the interactivity of the system and applications\&. This includes the display server, screen readers and other services such as DBus or XDG portals\&. Such services should be configured to be part of this slice by adding
1369 \fISlice=session\&.slice\fR
1370 to their unit files\&.
1371 .sp
1372 Added in version 247\&.
1373 .RE
1374 .PP
1375 background\&.slice
1376 .RS 4
1377 All services running low\-priority background tasks should use this slice\&. This permits resources to be preferentially assigned to the other slices\&. Examples include non\-interactive tasks like file indexing or backup operations where latency is not important\&.
1378 .sp
1379 Added in version 247\&.
1380 .RE
1381 .SH "SEE ALSO"
1382 .PP
1383 \fBsystemd\fR(1), \fBsystemd.unit\fR(5), \fBsystemd.service\fR(5), \fBsystemd.socket\fR(5), \fBsystemd.target\fR(5), \fBsystemd.slice\fR(5), \fBbootup\fR(7), \fBsystemd-fstab-generator\fR(8), \[email protected]\fR(5)
1384 .SH "NOTES"
1385 .IP " 1." 4
1386 Factory Reset
1387 .RS 4
1388 \%https://systemd.io/FACTORY_RESET
1389 .RE
1390 .IP " 2." 4
1391 Running Services After the Network Is Up
1392 .RS 4
1393 \%https://systemd.io/NETWORK_ONLINE
1394 .RE
1395 .IP " 3." 4
1396 Syslog Interface
1397 .RS 4
1398 \%https://systemd.io/SYSLOG
1399 .RE
1400 .IP " 4." 4
1401 Desktop Environments
1402 .RS 4
1403 \%https://systemd.io/DESKTOP_ENVIRONMENTS
1404 .RE