]> git.ipfire.org Git - thirdparty/systemd.git/blame_incremental - man/systemd.special.xml
tree-wide: remove Lennart's copyright lines
[thirdparty/systemd.git] / man / systemd.special.xml
... / ...
CommitLineData
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5<!--
6 SPDX-License-Identifier: LGPL-2.1+
7-->
8
9<refentry id="systemd.special">
10
11 <refentryinfo>
12 <title>systemd.special</title>
13 <productname>systemd</productname>
14
15 <authorgroup>
16 <author>
17 <contrib>Developer</contrib>
18 <firstname>Lennart</firstname>
19 <surname>Poettering</surname>
20 <email>lennart@poettering.net</email>
21 </author>
22 </authorgroup>
23 </refentryinfo>
24
25 <refmeta>
26 <refentrytitle>systemd.special</refentrytitle>
27 <manvolnum>7</manvolnum>
28 </refmeta>
29
30 <refnamediv>
31 <refname>systemd.special</refname>
32 <refpurpose>Special systemd units</refpurpose>
33 </refnamediv>
34
35 <refsynopsisdiv><para>
36 <!-- sort alphabetically, targets first --><filename>basic.target</filename>,
37 <filename>bluetooth.target</filename>,
38 <filename>cryptsetup-pre.target</filename>,
39 <filename>cryptsetup.target</filename>,
40 <filename>ctrl-alt-del.target</filename>,
41 <filename>default.target</filename>,
42 <filename>emergency.target</filename>,
43 <filename>exit.target</filename>,
44 <filename>final.target</filename>,
45 <filename>getty.target</filename>,
46 <filename>getty-pre.target</filename>,
47 <filename>graphical.target</filename>,
48 <filename>halt.target</filename>,
49 <filename>hibernate.target</filename>,
50 <filename>hybrid-sleep.target</filename>,
51 <filename>suspend-then-hibernate.target</filename>,
52 <filename>initrd-fs.target</filename>,
53 <filename>initrd-root-device.target</filename>,
54 <filename>initrd-root-fs.target</filename>,
55 <filename>kbrequest.target</filename>,
56 <filename>kexec.target</filename>,
57 <filename>local-fs-pre.target</filename>,
58 <filename>local-fs.target</filename>,
59 <filename>machines.target</filename>
60 <filename>multi-user.target</filename>,
61 <filename>network-online.target</filename>,
62 <filename>network-pre.target</filename>,
63 <filename>network.target</filename>,
64 <filename>nss-lookup.target</filename>,
65 <filename>nss-user-lookup.target</filename>,
66 <filename>paths.target</filename>,
67 <filename>poweroff.target</filename>,
68 <filename>printer.target</filename>,
69 <filename>reboot.target</filename>,
70 <filename>remote-cryptsetup.target</filename>,
71 <filename>remote-fs-pre.target</filename>,
72 <filename>remote-fs.target</filename>,
73 <filename>rescue.target</filename>,
74 <filename>rpcbind.target</filename>,
75 <filename>runlevel2.target</filename>,
76 <filename>runlevel3.target</filename>,
77 <filename>runlevel4.target</filename>,
78 <filename>runlevel5.target</filename>,
79 <filename>shutdown.target</filename>,
80 <filename>sigpwr.target</filename>,
81 <filename>sleep.target</filename>,
82 <filename>slices.target</filename>,
83 <filename>smartcard.target</filename>,
84 <filename>sockets.target</filename>,
85 <filename>sound.target</filename>,
86 <filename>suspend.target</filename>,
87 <filename>swap.target</filename>,
88 <filename>sysinit.target</filename>,
89 <filename>system-update.target</filename>,
90 <filename>time-sync.target</filename>,
91 <filename>timers.target</filename>,
92 <filename>umount.target</filename>,
93 <!-- slices --><filename>-.slice</filename>,
94 <filename>system.slice</filename>,
95 <filename>user.slice</filename>,
96 <filename>machine.slice</filename>,
97 <!-- the rest --><filename>-.mount</filename>,
98 <filename>dbus.service</filename>,
99 <filename>dbus.socket</filename>,
100 <filename>display-manager.service</filename>,
101 <filename>init.scope</filename>,
102 <filename>syslog.socket</filename>,
103 <filename>system-update-cleanup.service</filename>
104 </para></refsynopsisdiv>
105
106 <refsect1>
107 <title>Description</title>
108
109 <para>A few units are treated specially by systemd. Many of them have
110 special internal semantics and cannot be renamed, while others simply
111 have a standard meaning and should be present on all systems.</para>
112 </refsect1>
113
114 <refsect1>
115 <title>Special System Units</title>
116
117 <variablelist>
118 <varlistentry>
119 <term><filename>-.mount</filename></term>
120 <listitem>
121 <para>The root mount point, i.e. the mount unit for the <filename>/</filename> path. This unit is
122 unconditionally active, during the entire time the system is up, as this mount point is where the basic
123 userspace is running from.</para>
124 </listitem>
125 </varlistentry>
126
127 <varlistentry>
128 <term><filename>basic.target</filename></term>
129 <listitem>
130 <para>A special target unit covering basic boot-up.</para>
131
132 <para>systemd automatically adds dependency of the type
133 <varname>After=</varname> for this target unit to all
134 services (except for those with
135 <varname>DefaultDependencies=no</varname>).</para>
136
137 <para>Usually, this should pull-in all local mount points plus
138 <filename>/var</filename>, <filename>/tmp</filename> and
139 <filename>/var/tmp</filename>, swap devices, sockets, timers,
140 path units and other basic initialization necessary for general
141 purpose daemons. The mentioned mount points are special cased
142 to allow them to be remote.
143 </para>
144
145 <para>This target usually does not pull in any non-target units
146 directly, but rather does so indirectly via other early boot targets.
147 It is instead meant as a synchronization point for late boot
148 services. Refer to
149 <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>
150 for details on the targets involved.
151 </para>
152
153 </listitem>
154 </varlistentry>
155 <varlistentry>
156 <term><filename>ctrl-alt-del.target</filename></term>
157 <listitem>
158 <para>systemd starts this target whenever Control+Alt+Del is
159 pressed on the console. Usually, this should be aliased
160 (symlinked) to <filename>reboot.target</filename>.</para>
161 </listitem>
162 </varlistentry>
163 <varlistentry>
164 <term><filename>cryptsetup.target</filename></term>
165 <listitem>
166 <para>A target that pulls in setup services for all
167 encrypted block devices.</para>
168 </listitem>
169 </varlistentry>
170 <varlistentry>
171 <term><filename>dbus.service</filename></term>
172 <listitem>
173 <para>A special unit for the D-Bus bus daemon. As soon as
174 this service is fully started up systemd will connect to it
175 and register its service.</para>
176 </listitem>
177 </varlistentry>
178 <varlistentry>
179 <term><filename>dbus.socket</filename></term>
180 <listitem>
181 <para>A special unit for the D-Bus system bus socket. All
182 units with <varname>Type=dbus</varname> automatically gain a
183 dependency on this unit.</para>
184 </listitem>
185 </varlistentry>
186 <varlistentry>
187 <term><filename>default.target</filename></term>
188 <listitem>
189 <para>The default unit systemd starts at bootup. Usually,
190 this should be aliased (symlinked) to
191 <filename>multi-user.target</filename> or
192 <filename>graphical.target</filename>.</para>
193
194 <para>The default unit systemd starts at bootup can be
195 overridden with the <varname>systemd.unit=</varname> kernel
196 command line option.</para>
197 </listitem>
198 </varlistentry>
199 <varlistentry>
200 <term><filename>display-manager.service</filename></term>
201 <listitem>
202 <para>The display manager service. Usually, this should be
203 aliased (symlinked) to <filename>gdm.service</filename> or a
204 similar display manager service.</para>
205 </listitem>
206 </varlistentry>
207 <varlistentry>
208 <term><filename>emergency.target</filename></term>
209 <listitem>
210 <para>A special target unit that starts an emergency shell on the main console. This target does not pull in
211 any services or mounts. It is the most minimal version of starting the system in order to acquire an
212 interactive shell; the only processes running are usually just the system manager (PID 1) and the shell
213 process. This unit is supposed to be used with the kernel command line option
214 <varname>systemd.unit=</varname>; it is also used when a file system check on a required file system fails,
215 and boot-up cannot continue. Compare with <filename>rescue.target</filename>, which serves a similar purpose,
216 but also starts the most basic services and mounts all file systems.</para>
217
218 <para>Use the <literal>systemd.unit=emergency.target</literal> kernel command line option to boot into this
219 mode. A short alias for this kernel command line option is <literal>emergency</literal>, for compatibility
220 with SysV.</para>
221
222 <para>In many ways booting into <filename>emergency.target</filename> is similar to the effect of booting
223 with <literal>init=/bin/sh</literal> on the kernel command line, except that emergency mode provides you with
224 the full system and service manager, and allows starting individual units in order to continue the boot
225 process in steps.</para>
226 </listitem>
227 </varlistentry>
228 <varlistentry>
229 <term><filename>exit.target</filename></term>
230 <listitem>
231 <para>A special service unit for shutting down the system or
232 user service manager. It is equivalent to
233 <filename>poweroff.target</filename> on non-container
234 systems, and also works in containers.</para>
235
236 <para>systemd will start this unit when it receives the
237 <constant>SIGTERM</constant> or <constant>SIGINT</constant>
238 signal when running as user service daemon.</para>
239
240 <para>Normally, this (indirectly) pulls in
241 <filename>shutdown.target</filename>, which in turn should be
242 conflicted by all units that want to be scheduled for
243 shutdown when the service manager starts to exit.</para>
244 </listitem>
245 </varlistentry>
246 <varlistentry>
247 <term><filename>final.target</filename></term>
248 <listitem>
249 <para>A special target unit that is used during the shutdown
250 logic and may be used to pull in late services after all
251 normal services are already terminated and all mounts
252 unmounted.
253 </para>
254 </listitem>
255 </varlistentry>
256 <varlistentry>
257 <term><filename>getty.target</filename></term>
258 <listitem>
259 <para>A special target unit that pulls in statically
260 configured local TTY <filename>getty</filename> instances.
261 </para>
262 </listitem>
263 </varlistentry>
264 <varlistentry>
265 <term><filename>graphical.target</filename></term>
266 <listitem>
267 <para>A special target unit for setting up a graphical login
268 screen. This pulls in
269 <filename>multi-user.target</filename>.</para>
270
271 <para>Units that are needed for graphical logins shall add
272 <varname>Wants=</varname> dependencies for their unit to
273 this unit (or <filename>multi-user.target</filename>) during
274 installation. This is best configured via
275 <varname>WantedBy=graphical.target</varname> in the unit's
276 <literal>[Install]</literal> section.</para>
277 </listitem>
278 </varlistentry>
279 <varlistentry>
280 <term><filename>hibernate.target</filename></term>
281 <listitem>
282 <para>A special target unit for hibernating the system. This
283 pulls in <filename>sleep.target</filename>.</para>
284 </listitem>
285 </varlistentry>
286 <varlistentry>
287 <term><filename>hybrid-sleep.target</filename></term>
288 <listitem>
289 <para>A special target unit for hibernating and suspending
290 the system at the same time. This pulls in
291 <filename>sleep.target</filename>.</para>
292 </listitem>
293 </varlistentry>
294 <varlistentry>
295 <term><filename>suspend-then-hibernate.target</filename></term>
296 <listitem>
297 <para>A special target unit for suspending the system for a period
298 of time, waking it and putting it into hibernate. This pulls in
299 <filename>sleep.target</filename>.</para>
300 </listitem>
301 </varlistentry>
302
303 <varlistentry>
304 <term><filename>halt.target</filename></term>
305 <listitem>
306 <para>A special target unit for shutting down and halting
307 the system. Note that this target is distinct from
308 <filename>poweroff.target</filename> in that it generally
309 really just halts the system rather than powering it
310 down.</para>
311
312 <para>Applications wanting to halt the system should not start this unit
313 directly, but should instead execute <command>systemctl halt</command>
314 (possibly with the <option>--no-block</option> option) or call
315 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
316 <command>org.freedesktop.systemd1.Manager.Halt</command> D-Bus method
317 directly.</para>
318 </listitem>
319 </varlistentry>
320 <varlistentry>
321 <term><filename>init.scope</filename></term>
322 <listitem>
323 <para>This scope unit is where the system and service manager (PID 1) itself resides. It is active as long as
324 the system is running.</para>
325 </listitem>
326 </varlistentry>
327 <varlistentry>
328 <term><filename>initrd-fs.target</filename></term>
329 <listitem>
330 <para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry>
331 automatically adds dependencies of type
332 <varname>Before=</varname> to
333 <filename>sysroot-usr.mount</filename> and all mount points
334 found in <filename>/etc/fstab</filename> that have
335 <option>x-initrd.mount</option> and not have
336 <option>noauto</option> mount options set.</para>
337 </listitem>
338 </varlistentry>
339 <varlistentry>
340 <term><filename>initrd-root-device.target</filename></term>
341 <listitem>
342 <para>A special initrd target unit that is reached when the root filesystem device is available, but before
343 it has been mounted.
344 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry>
345 and
346 <citerefentry><refentrytitle>systemd-gpt-auto-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry>
347 automatically setup the appropriate dependencies to make this happen.
348 </para>
349 </listitem>
350 </varlistentry>
351 <varlistentry>
352 <term><filename>initrd-root-fs.target</filename></term>
353 <listitem>
354 <para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry>
355 automatically adds dependencies of type
356 <varname>Before=</varname> to the
357 <filename>sysroot.mount</filename> unit, which is generated
358 from the kernel command line.
359 </para>
360 </listitem>
361 </varlistentry>
362 <varlistentry>
363 <term><filename>kbrequest.target</filename></term>
364 <listitem>
365 <para>systemd starts this target whenever Alt+ArrowUp is
366 pressed on the console. Note that any user with physical access
367 to the machine will be able to do this, without authentication,
368 so this should be used carefully.</para>
369 </listitem>
370 </varlistentry>
371 <varlistentry>
372 <term><filename>kexec.target</filename></term>
373 <listitem>
374 <para>A special target unit for shutting down and rebooting
375 the system via kexec.</para>
376
377 <para>Applications wanting to reboot the system should not start this unit
378 directly, but should instead execute <command>systemctl kexec</command>
379 (possibly with the <option>--no-block</option> option) or call
380 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
381 <command>org.freedesktop.systemd1.Manager.KExec</command> D-Bus method
382 directly.</para>
383 </listitem>
384 </varlistentry>
385 <varlistentry>
386 <term><filename>local-fs.target</filename></term>
387 <listitem>
388 <para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry>
389 automatically adds dependencies of type
390 <varname>Before=</varname> to all mount units that refer to
391 local mount points for this target unit. In addition, it
392 adds dependencies of type <varname>Wants=</varname> to this
393 target unit for those mounts listed in
394 <filename>/etc/fstab</filename> that have the
395 <option>auto</option> mount option set.</para>
396 </listitem>
397 </varlistentry>
398 <varlistentry>
399 <term><filename>machines.target</filename></term>
400 <listitem>
401 <para>A standard target unit for starting all the containers
402 and other virtual machines. See <filename>systemd-nspawn@.service</filename>
403 for an example.</para>
404 </listitem>
405 </varlistentry>
406 <varlistentry>
407 <term><filename>multi-user.target</filename></term>
408 <listitem>
409 <para>A special target unit for setting up a multi-user
410 system (non-graphical). This is pulled in by
411 <filename>graphical.target</filename>.</para>
412
413 <para>Units that are needed for a multi-user system shall
414 add <varname>Wants=</varname> dependencies for their unit to
415 this unit during installation. This is best configured via
416 <varname>WantedBy=multi-user.target</varname> in the unit's
417 <literal>[Install]</literal> section.</para>
418 </listitem>
419 </varlistentry>
420 <varlistentry>
421 <term><filename>network-online.target</filename></term>
422 <listitem>
423 <para>Units that strictly require a configured network
424 connection should pull in
425 <filename>network-online.target</filename> (via a
426 <varname>Wants=</varname> type dependency) and order
427 themselves after it. This target unit is intended to pull in
428 a service that delays further execution until the network is
429 sufficiently set up. What precisely this requires is left to
430 the implementation of the network managing service.</para>
431
432 <para>Note the distinction between this unit and
433 <filename>network.target</filename>. This unit is an active
434 unit (i.e. pulled in by the consumer rather than the
435 provider of this functionality) and pulls in a service which
436 possibly adds substantial delays to further execution. In
437 contrast, <filename>network.target</filename> is a passive
438 unit (i.e. pulled in by the provider of the functionality,
439 rather than the consumer) that usually does not delay
440 execution much. Usually, <filename>network.target</filename>
441 is part of the boot of most systems, while
442 <filename>network-online.target</filename> is not, except
443 when at least one unit requires it. Also see <ulink
444 url="https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget">Running
445 Services After the Network is up</ulink> for more
446 information.</para>
447
448 <para>All mount units for remote network file systems
449 automatically pull in this unit, and order themselves after
450 it. Note that networking daemons that simply provide
451 functionality to other hosts generally do not need to pull
452 this in.</para>
453
454 <para>systemd automatically adds dependencies of type <varname>Wants=</varname> and <varname>After=</varname>
455 for this target unit to all SysV init script service units with an LSB header referring to the
456 <literal>$network</literal> facility.</para>
457
458 <para>Note that this unit is only useful during the original system start-up logic. After the system has
459 completed booting up, it will not track the online state of the system anymore. Due to this it cannot be used
460 as a network connection monitor concept, it is purely a one-time system start-up concept.</para>
461 </listitem>
462 </varlistentry>
463 <varlistentry>
464 <term><filename>paths.target</filename></term>
465 <listitem>
466 <para>A special target unit that sets up all path units (see
467 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>
468 for details) that shall be active after boot.</para>
469
470 <para>It is recommended that path units installed by
471 applications get pulled in via <varname>Wants=</varname>
472 dependencies from this unit. This is best configured via a
473 <varname>WantedBy=paths.target</varname> in the path unit's
474 <literal>[Install]</literal> section.</para>
475 </listitem>
476 </varlistentry>
477 <varlistentry>
478 <term><filename>poweroff.target</filename></term>
479 <listitem>
480 <para>A special target unit for shutting down and powering
481 off the system.</para>
482
483 <para>Applications wanting to power off the system should not start this unit
484 directly, but should instead execute <command>systemctl poweroff</command>
485 (possibly with the <option>--no-block</option> option) or call
486 <citerefentry><refentrytitle>systemd-logind</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
487 <command>org.freedesktop.login1.Manager.PowerOff</command> D-Bus method
488 directly.</para>
489
490 <para><filename>runlevel0.target</filename> is an alias for
491 this target unit, for compatibility with SysV.</para>
492 </listitem>
493 </varlistentry>
494 <varlistentry>
495 <term><filename>reboot.target</filename></term>
496 <listitem>
497 <para>A special target unit for shutting down and rebooting
498 the system.</para>
499
500 <para>Applications wanting to reboot the system should not start this unit
501 directly, but should instead execute <command>systemctl reboot</command>
502 (possibly with the <option>--no-block</option> option) or call
503 <citerefentry><refentrytitle>systemd-logind</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
504 <command>org.freedesktop.login1.Manager.Reboot</command> D-Bus method
505 directly.</para>
506
507 <para><filename>runlevel6.target</filename> is an alias for
508 this target unit, for compatibility with SysV.</para>
509 </listitem>
510 </varlistentry>
511 <varlistentry>
512 <term><filename>remote-cryptsetup.target</filename></term>
513 <listitem>
514 <para>Similar to <filename>cryptsetup.target</filename>, but for encrypted
515 devices which are accessed over the network. It is used for
516 <citerefentry><refentrytitle>crypttab</refentrytitle><manvolnum>8</manvolnum></citerefentry>
517 entries marked with <option>_netdev</option>.</para>
518 </listitem>
519 </varlistentry>
520 <varlistentry>
521 <term><filename>remote-fs.target</filename></term>
522 <listitem>
523 <para>Similar to <filename>local-fs.target</filename>, but
524 for remote mount points.</para>
525
526 <para>systemd automatically adds dependencies of type
527 <varname>After=</varname> for this target unit to all SysV
528 init script service units with an LSB header referring to
529 the <literal>$remote_fs</literal> facility.</para>
530 </listitem>
531 </varlistentry>
532 <varlistentry>
533 <term><filename>rescue.target</filename></term>
534 <listitem>
535 <para>A special target unit that pulls in the base system (including system mounts) and spawns a rescue
536 shell. Isolate to this target in order to administer the system in single-user mode with all file systems
537 mounted but with no services running, except for the most basic. Compare with
538 <filename>emergency.target</filename>, which is much more reduced and does not provide the file systems or
539 most basic services. Compare with <filename>multi-user.target</filename>, this target could be seen as
540 <filename>single-user.target</filename>.</para>
541
542 <para><filename>runlevel1.target</filename> is an alias for this target unit, for compatibility with
543 SysV.</para>
544
545 <para>Use the <literal>systemd.unit=rescue.target</literal> kernel command line option to boot into this
546 mode. A short alias for this kernel command line option is <literal>1</literal>, for compatibility with
547 SysV.</para>
548 </listitem>
549 </varlistentry>
550 <varlistentry>
551 <term><filename>runlevel2.target</filename></term>
552 <term><filename>runlevel3.target</filename></term>
553 <term><filename>runlevel4.target</filename></term>
554 <term><filename>runlevel5.target</filename></term>
555 <listitem>
556 <para>These are targets that are called whenever the SysV
557 compatibility code asks for runlevel 2, 3, 4, 5,
558 respectively. It is a good idea to make this an alias for
559 (i.e. symlink to) <filename>graphical.target</filename>
560 (for runlevel 5) or <filename>multi-user.target</filename>
561 (the others).</para>
562 </listitem>
563 </varlistentry>
564 <varlistentry>
565 <term><filename>shutdown.target</filename></term>
566 <listitem>
567 <para>A special target unit that terminates the services on
568 system shutdown.</para>
569
570 <para>Services that shall be terminated on system shutdown
571 shall add <varname>Conflicts=</varname> and
572 <varname>Before=</varname> dependencies to this unit for
573 their service unit, which is implicitly done when
574 <varname>DefaultDependencies=yes</varname> is set (the
575 default).</para>
576 </listitem>
577 </varlistentry>
578 <varlistentry>
579 <term><filename>sigpwr.target</filename></term>
580 <listitem>
581 <para>A special target that is started when systemd receives
582 the SIGPWR process signal, which is normally sent by the
583 kernel or UPS daemons when power fails.</para>
584 </listitem>
585 </varlistentry>
586 <varlistentry>
587 <term><filename>sleep.target</filename></term>
588 <listitem>
589 <para>A special target unit that is pulled in by
590 <filename>suspend.target</filename>,
591 <filename>hibernate.target</filename> and
592 <filename>hybrid-sleep.target</filename> and may be used to
593 hook units into the sleep state logic.</para>
594 </listitem>
595 </varlistentry>
596 <varlistentry>
597 <term><filename>slices.target</filename></term>
598 <listitem>
599 <para>A special target unit that sets up all slice units (see
600 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
601 details) that shall be active after boot. By default the generic <filename>system.slice</filename>
602 slice unit, as well as the root slice unit <filename>-.slice</filename>, is pulled in and ordered before
603 this unit (see below).</para>
604
605 <para>It's a good idea to add <varname>WantedBy=slices.target</varname> lines to the <literal>[Install]</literal>
606 section of all slices units that may be installed dynamically.</para>
607 </listitem>
608 </varlistentry>
609 <varlistentry>
610 <term><filename>sockets.target</filename></term>
611 <listitem>
612 <para>A special target unit that sets up all socket
613 units (see
614 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>
615 for details) that shall be active after boot.</para>
616
617 <para>Services that can be socket-activated shall add
618 <varname>Wants=</varname> dependencies to this unit for
619 their socket unit during installation. This is best
620 configured via a <varname>WantedBy=sockets.target</varname>
621 in the socket unit's <literal>[Install]</literal>
622 section.</para>
623 </listitem>
624 </varlistentry>
625 <varlistentry>
626 <term><filename>suspend.target</filename></term>
627 <listitem>
628 <para>A special target unit for suspending the system. This
629 pulls in <filename>sleep.target</filename>.</para>
630 </listitem>
631 </varlistentry>
632 <varlistentry>
633 <term><filename>swap.target</filename></term>
634 <listitem>
635 <para>Similar to <filename>local-fs.target</filename>, but
636 for swap partitions and swap files.</para>
637 </listitem>
638 </varlistentry>
639 <varlistentry>
640 <term><filename>sysinit.target</filename></term>
641 <listitem>
642 <para>systemd automatically adds dependencies of the types
643 <varname>Requires=</varname> and <varname>After=</varname>
644 for this target unit to all services (except for those with
645 <varname>DefaultDependencies=no</varname>).</para>
646
647 <para>This target pulls in the services required for system
648 initialization. System services pulled in by this target should
649 declare <varname>DefaultDependencies=no</varname> and specify
650 all their dependencies manually, including access to anything
651 more than a read only root filesystem. For details on the
652 dependencies of this target, refer to
653 <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
654 </para>
655 </listitem>
656 </varlistentry>
657 <varlistentry>
658 <term><filename>syslog.socket</filename></term>
659 <listitem>
660 <para>The socket unit syslog implementations should listen
661 on. All userspace log messages will be made available on
662 this socket. For more information about syslog integration,
663 please consult the <ulink
664 url="https://www.freedesktop.org/wiki/Software/systemd/syslog">Syslog
665 Interface</ulink> document.</para>
666 </listitem>
667 </varlistentry>
668 <varlistentry>
669 <term><filename>system-update.target</filename></term>
670 <term><filename>system-update-cleanup.service</filename></term>
671 <listitem>
672 <para>A special target unit that is used for offline system updates.
673 <citerefentry><refentrytitle>systemd-system-update-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
674 will redirect the boot process to this target if <filename>/system-update</filename>
675 exists. For more information see
676 <citerefentry><refentrytitle>systemd.offline-updates</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
677 </para>
678
679 <para>Updates should happen before the <filename>system-update.target</filename> is
680 reached, and the services which implement them should cause the machine to reboot. As
681 a safety measure, if this does not happen, and <filename>/system-update</filename>
682 still exists after <filename>system-update.target</filename> is reached,
683 <filename>system-update-cleanup.service</filename> will remove this symlink and
684 reboot the machine.</para>
685 </listitem>
686 </varlistentry>
687 <varlistentry>
688 <term><filename>timers.target</filename></term>
689 <listitem>
690 <para>A special target unit that sets up all timer units
691 (see
692 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>
693 for details) that shall be active after boot.</para>
694
695 <para>It is recommended that timer units installed by
696 applications get pulled in via <varname>Wants=</varname>
697 dependencies from this unit. This is best configured via
698 <varname>WantedBy=timers.target</varname> in the timer
699 unit's <literal>[Install]</literal> section.</para>
700 </listitem>
701 </varlistentry>
702 <varlistentry>
703 <term><filename>umount.target</filename></term>
704 <listitem>
705 <para>A special target unit that unmounts all mount and
706 automount points on system shutdown.</para>
707
708 <para>Mounts that shall be unmounted on system shutdown
709 shall add Conflicts dependencies to this unit for their
710 mount unit, which is implicitly done when
711 <varname>DefaultDependencies=yes</varname> is set (the
712 default).</para>
713 </listitem>
714 </varlistentry>
715
716 </variablelist>
717 </refsect1>
718
719 <refsect1>
720 <title>Special System Units for Devices</title>
721
722 <para>Some target units are automatically pulled in as devices of
723 certain kinds show up in the system. These may be used to
724 automatically activate various services based on the specific type
725 of the available hardware.</para>
726
727 <variablelist>
728 <varlistentry>
729 <term><filename>bluetooth.target</filename></term>
730 <listitem>
731 <para>This target is started automatically as soon as a
732 Bluetooth controller is plugged in or becomes available at
733 boot.</para>
734
735 <para>This may be used to pull in Bluetooth management
736 daemons dynamically when Bluetooth hardware is found.</para>
737 </listitem>
738 </varlistentry>
739 <varlistentry>
740 <term><filename>printer.target</filename></term>
741 <listitem>
742 <para>This target is started automatically as soon as a
743 printer is plugged in or becomes available at boot.</para>
744
745 <para>This may be used to pull in printer management daemons
746 dynamically when printer hardware is found.</para>
747 </listitem>
748 </varlistentry>
749 <varlistentry>
750 <term><filename>smartcard.target</filename></term>
751 <listitem>
752 <para>This target is started automatically as soon as a
753 smartcard controller is plugged in or becomes available at
754 boot.</para>
755
756 <para>This may be used to pull in smartcard management
757 daemons dynamically when smartcard hardware is found.</para>
758 </listitem>
759 </varlistentry>
760 <varlistentry>
761 <term><filename>sound.target</filename></term>
762 <listitem>
763 <para>This target is started automatically as soon as a
764 sound card is plugged in or becomes available at
765 boot.</para>
766
767 <para>This may be used to pull in audio management daemons
768 dynamically when audio hardware is found.</para>
769 </listitem>
770 </varlistentry>
771 </variablelist>
772 </refsect1>
773
774 <refsect1>
775 <title>Special Passive System Units </title>
776
777 <para>A number of special system targets are defined that can be
778 used to properly order boot-up of optional services. These targets
779 are generally not part of the initial boot transaction, unless
780 they are explicitly pulled in by one of the implementing services.
781 Note specifically that these <emphasis>passive</emphasis> target
782 units are generally not pulled in by the consumer of a service,
783 but by the provider of the service. This means: a consuming
784 service should order itself after these targets (as appropriate),
785 but not pull it in. A providing service should order itself before
786 these targets (as appropriate) and pull it in (via a
787 <varname>Wants=</varname> type dependency).</para>
788
789 <para>Note that these passive units cannot be started manually,
790 i.e. <literal>systemctl start time-sync.target</literal> will fail
791 with an error. They can only be pulled in by dependency. This is
792 enforced since they exist for ordering purposes only and thus are
793 not useful as only unit within a transaction.</para>
794
795 <variablelist>
796 <varlistentry>
797 <term><filename>cryptsetup-pre.target</filename></term>
798 <listitem>
799 <para>This passive target unit may be pulled in by services
800 that want to run before any encrypted block device is set
801 up. All encrypted block devices are set up after this target
802 has been reached. Since the shutdown order is implicitly the
803 reverse start-up order between units, this target is
804 particularly useful to ensure that a service is shut down
805 only after all encrypted block devices are fully
806 stopped.</para>
807 </listitem>
808 </varlistentry>
809 <varlistentry>
810 <term><filename>getty-pre.target</filename></term>
811 <listitem>
812 <para>A special passive target unit. Users of this target
813 are expected to pull it in the boot transaction via
814 a dependency (e.g. <varname>Wants=</varname>). Order your
815 unit before this unit if you want to make use of the console
816 just before <filename>getty</filename> is started.
817 </para>
818 </listitem>
819 </varlistentry>
820 <varlistentry>
821 <term><filename>local-fs-pre.target</filename></term>
822 <listitem>
823 <para>This target unit is
824 automatically ordered before
825 all local mount points marked
826 with <option>auto</option>
827 (see above). It can be used to
828 execute certain units before
829 all local mounts.</para>
830 </listitem>
831 </varlistentry>
832 <varlistentry>
833 <term><filename>network.target</filename></term>
834 <listitem>
835 <para>This unit is supposed to indicate when network
836 functionality is available, but it is only very weakly
837 defined what that is supposed to mean, with one exception:
838 at shutdown, a unit that is ordered after
839 <filename>network.target</filename> will be stopped before
840 the network — to whatever level it might be set up then —
841 is shut down. It is hence useful when writing service files
842 that require network access on shutdown, which should order
843 themselves after this target, but not pull it in. Also see
844 <ulink url="https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget">Running
845 Services After the Network is up</ulink> for more
846 information. Also see
847 <filename>network-online.target</filename> described
848 above.</para>
849 </listitem>
850 </varlistentry>
851 <varlistentry>
852 <term><filename>network-pre.target</filename></term>
853 <listitem>
854 <para>This passive target unit may be pulled in by services
855 that want to run before any network is set up, for example
856 for the purpose of setting up a firewall. All network
857 management software orders itself after this target, but
858 does not pull it in.</para>
859 </listitem>
860 </varlistentry>
861 <varlistentry>
862 <term><filename>nss-lookup.target</filename></term>
863 <listitem>
864 <para>A target that should be used as synchronization point for all host/network name service lookups. Note
865 that this is independent of UNIX user/group name lookups for which <filename>nss-user-lookup.target</filename>
866 should be used. All services for which the availability of full host/network name resolution is essential
867 should be ordered after this target, but not pull it in. systemd automatically adds dependencies of type
868 <varname>After=</varname> for this target unit to all SysV init script service units with an LSB header
869 referring to the <literal>$named</literal> facility.</para>
870 </listitem>
871 </varlistentry>
872 <varlistentry>
873 <term><filename>nss-user-lookup.target</filename></term>
874 <listitem>
875 <para>A target that should be used as synchronization point for all regular UNIX user/group name service
876 lookups. Note that this is independent of host/network name lookups for which
877 <filename>nss-lookup.target</filename> should be used. All services for which the availability of the full
878 user/group database is essential should be ordered after this target, but not pull it in. All services which
879 provide parts of the user/group database should be ordered before this target, and pull it in. Note that this
880 unit is only relevant for regular users and groups — system users and groups are required to be resolvable
881 during earliest boot already, and hence do not need any special ordering against this target.</para>
882 </listitem>
883 </varlistentry>
884 <varlistentry>
885 <term><filename>remote-fs-pre.target</filename></term>
886 <listitem>
887 <para>This target unit is automatically ordered before all
888 mount point units (see above) and cryptsetup devices
889 marked with the <option>_netdev</option>. It can be used to run
890 certain units before remote encrypted devices and mounts are established.
891 Note that this unit is generally not part of the initial
892 transaction, unless the unit that wants to be ordered before
893 all remote mounts pulls it in via a
894 <varname>Wants=</varname> type dependency. If the unit wants
895 to be pulled in by the first remote mount showing up, it
896 should use <filename>network-online.target</filename> (see
897 above).</para>
898 </listitem>
899 </varlistentry>
900 <varlistentry>
901 <term><filename>rpcbind.target</filename></term>
902 <listitem>
903 <para>The portmapper/rpcbind pulls in this target and orders
904 itself before it, to indicate its availability. systemd
905 automatically adds dependencies of type
906 <varname>After=</varname> for this target unit to all SysV
907 init script service units with an LSB header referring to
908 the <literal>$portmap</literal> facility.</para>
909 </listitem>
910 </varlistentry>
911 <varlistentry>
912 <term><filename>time-sync.target</filename></term>
913 <listitem>
914 <para>Services responsible for synchronizing the system
915 clock from a remote source (such as NTP client
916 implementations) should pull in this target and order
917 themselves before it. All services where correct time is
918 essential should be ordered after this unit, but not pull it
919 in. systemd automatically adds dependencies of type
920 <varname>After=</varname> for this target unit to all SysV
921 init script service units with an LSB header referring to
922 the <literal>$time</literal> facility. </para>
923 </listitem>
924 </varlistentry>
925 </variablelist>
926 </refsect1>
927
928 <refsect1>
929 <title>Special User Units</title>
930
931 <para>When systemd runs as a user instance, the following special
932 units are available, which have similar definitions as their
933 system counterparts:
934 <filename>exit.target</filename>,
935 <filename>default.target</filename>,
936 <filename>shutdown.target</filename>,
937 <filename>sockets.target</filename>,
938 <filename>timers.target</filename>,
939 <filename>paths.target</filename>,
940 <filename>bluetooth.target</filename>,
941 <filename>printer.target</filename>,
942 <filename>smartcard.target</filename>,
943 <filename>sound.target</filename>.</para>
944 </refsect1>
945
946 <refsect1>
947 <title>Special Passive User Units</title>
948
949 <variablelist>
950 <varlistentry>
951 <term><filename>graphical-session.target</filename></term>
952 <listitem>
953 <para>This target is active whenever any graphical session is running. It is used to stop user services which
954 only apply to a graphical (X, Wayland, etc.) session when the session is terminated. Such services should
955 have <literal>PartOf=graphical-session.target</literal> in their <literal>[Unit]</literal> section. A target
956 for a particular session (e. g. <filename>gnome-session.target</filename>) starts and stops
957 <literal>graphical-session.target</literal> with <literal>BindsTo=graphical-session.target</literal>.</para>
958
959 <para>Which services are started by a session target is determined by the <literal>Wants=</literal> and
960 <literal>Requires=</literal> dependencies. For services that can be enabled independently, symlinks in
961 <literal>.wants/</literal> and <literal>.requires/</literal> should be used, see
962 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. Those
963 symlinks should either be shipped in packages, or should be added dynamically after installation, for example
964 using <literal>systemctl add-wants</literal>, see
965 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
966 </para>
967
968 <example>
969 <title>Nautilus as part of a GNOME session</title>
970
971 <para><literal>gnome-session.target</literal> pulls in Nautilus as top-level service:</para>
972
973 <programlisting>[Unit]
974Description=User systemd services for GNOME graphical session
975Wants=nautilus.service
976BindsTo=graphical-session.target</programlisting>
977
978 <para><literal>nautilus.service</literal> gets stopped when the session stops:</para>
979
980 <programlisting>[Unit]
981Description=Render the desktop icons with Nautilus
982PartOf=graphical-session.target
983
984[Service]
985…</programlisting>
986 </example>
987 </listitem>
988 </varlistentry>
989
990 <varlistentry>
991 <term><filename>graphical-session-pre.target</filename></term>
992 <listitem>
993 <para>This target contains services which set up the environment or global configuration of a graphical
994 session, such as SSH/GPG agents (which need to export an environment variable into all desktop processes) or
995 migration of obsolete d-conf keys after an OS upgrade (which needs to happen before starting any process that
996 might use them). This target must be started before starting a graphical session like
997 <filename>gnome-session.target</filename>.</para>
998 </listitem>
999 </varlistentry>
1000 </variablelist>
1001
1002 </refsect1>
1003
1004 <refsect1>
1005 <title>Special Slice Units</title>
1006
1007 <para>There are four <literal>.slice</literal> units which form the basis of the hierarchy for assignment of
1008 resources for services, users, and virtual machines or containers. See
1009 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>7</manvolnum></citerefentry> for details about slice
1010 units.</para>
1011
1012 <variablelist>
1013 <varlistentry>
1014 <term><filename>-.slice</filename></term>
1015 <listitem>
1016 <para>The root slice is the root of the slice hierarchy. It usually does not contain units directly, but may
1017 be used to set defaults for the whole tree.</para>
1018 </listitem>
1019 </varlistentry>
1020
1021 <varlistentry>
1022 <term><filename>system.slice</filename></term>
1023 <listitem>
1024 <para>By default, all system services started by
1025 <command>systemd</command> are found in this slice.</para>
1026 </listitem>
1027 </varlistentry>
1028
1029 <varlistentry>
1030 <term><filename>user.slice</filename></term>
1031 <listitem>
1032 <para>By default, all user processes and services started on
1033 behalf of the user, including the per-user systemd instance
1034 are found in this slice. This is pulled in by
1035 <filename>systemd-logind.service</filename></para>
1036 </listitem>
1037 </varlistentry>
1038
1039 <varlistentry>
1040 <term><filename>machine.slice</filename></term>
1041 <listitem>
1042 <para>By default, all virtual machines and containers
1043 registered with <command>systemd-machined</command> are
1044 found in this slice. This is pulled in by
1045 <filename>systemd-machined.service</filename></para>
1046 </listitem>
1047 </varlistentry>
1048 </variablelist>
1049 </refsect1>
1050
1051 <refsect1>
1052 <title>See Also</title>
1053 <para>
1054 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1055 <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1056 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1057 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1058 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1059 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1060 <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1061 <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
1062 </para>
1063 </refsect1>
1064
1065</refentry>