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