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