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