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