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