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