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