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