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