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