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