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