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