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