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