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