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