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