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