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