]>
Commit | Line | Data |
---|---|---|
9f235308 | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
3a54a157 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" |
eea10b26 | 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
9f235308 | 5 | |
4623eecb | 6 | <refentry id="systemd.special" xmlns:xi="http://www.w3.org/2001/XInclude"> |
9f235308 | 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 | 27 | <filename>cryptsetup.target</filename>, |
08b04ec7 GP |
28 | <filename>veritysetup-pre.target</filename>, |
29 | <filename>veritysetup.target</filename>, | |
2ba7627e | 30 | <filename>ctrl-alt-del.target</filename>, |
68bda079 | 31 | <filename>blockdev@.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>, | |
836fb00f | 36 | <filename>factory-reset.target</filename>, |
798d3a52 | 37 | <filename>final.target</filename>, |
f4466bdb | 38 | <filename>first-boot-complete.target</filename>, |
798d3a52 | 39 | <filename>getty.target</filename>, |
17590254 | 40 | <filename>getty-pre.target</filename>, |
798d3a52 ZJS |
41 | <filename>graphical.target</filename>, |
42 | <filename>halt.target</filename>, | |
43 | <filename>hibernate.target</filename>, | |
44 | <filename>hybrid-sleep.target</filename>, | |
e68c79db | 45 | <filename>suspend-then-hibernate.target</filename>, |
2b1daf24 | 46 | <filename>initrd.target</filename>, |
798d3a52 | 47 | <filename>initrd-fs.target</filename>, |
2ba7627e ZJS |
48 | <filename>initrd-root-device.target</filename>, |
49 | <filename>initrd-root-fs.target</filename>, | |
34645144 | 50 | <filename>initrd-usr-fs.target</filename>, |
1f1a2243 TA |
51 | <filename>integritysetup-pre.target</filename>, |
52 | <filename>integritysetup.target</filename>, | |
798d3a52 ZJS |
53 | <filename>kbrequest.target</filename>, |
54 | <filename>kexec.target</filename>, | |
798d3a52 | 55 | <filename>local-fs-pre.target</filename>, |
2ba7627e ZJS |
56 | <filename>local-fs.target</filename>, |
57 | <filename>machines.target</filename> | |
798d3a52 | 58 | <filename>multi-user.target</filename>, |
798d3a52 ZJS |
59 | <filename>network-online.target</filename>, |
60 | <filename>network-pre.target</filename>, | |
2ba7627e | 61 | <filename>network.target</filename>, |
798d3a52 ZJS |
62 | <filename>nss-lookup.target</filename>, |
63 | <filename>nss-user-lookup.target</filename>, | |
64 | <filename>paths.target</filename>, | |
65 | <filename>poweroff.target</filename>, | |
66 | <filename>printer.target</filename>, | |
67 | <filename>reboot.target</filename>, | |
889128b8 | 68 | <filename>remote-cryptsetup.target</filename>, |
08b04ec7 | 69 | <filename>remote-veritysetup.target</filename>, |
798d3a52 | 70 | <filename>remote-fs-pre.target</filename>, |
2ba7627e | 71 | <filename>remote-fs.target</filename>, |
798d3a52 | 72 | <filename>rescue.target</filename>, |
798d3a52 ZJS |
73 | <filename>rpcbind.target</filename>, |
74 | <filename>runlevel2.target</filename>, | |
75 | <filename>runlevel3.target</filename>, | |
76 | <filename>runlevel4.target</filename>, | |
77 | <filename>runlevel5.target</filename>, | |
78 | <filename>shutdown.target</filename>, | |
79 | <filename>sigpwr.target</filename>, | |
80 | <filename>sleep.target</filename>, | |
fccd4b67 | 81 | <filename>slices.target</filename>, |
798d3a52 ZJS |
82 | <filename>smartcard.target</filename>, |
83 | <filename>sockets.target</filename>, | |
4de66581 | 84 | <filename>soft-reboot.target</filename>, |
798d3a52 | 85 | <filename>sound.target</filename>, |
95be59f9 | 86 | <filename>ssh-access.target</filename>, |
eae4943a | 87 | <filename>storage-target-mode.target</filename>, |
798d3a52 ZJS |
88 | <filename>suspend.target</filename>, |
89 | <filename>swap.target</filename>, | |
90 | <filename>sysinit.target</filename>, | |
798d3a52 | 91 | <filename>system-update.target</filename>, |
c7668c1c | 92 | <filename>system-update-pre.target</filename>, |
4ea0f675 | 93 | <filename>time-set.target</filename>, |
798d3a52 ZJS |
94 | <filename>time-sync.target</filename>, |
95 | <filename>timers.target</filename>, | |
4e1f0037 | 96 | <filename>tpm2.target</filename>, |
798d3a52 | 97 | <filename>umount.target</filename>, |
2c633a82 | 98 | <filename>usb-gadget.target</filename>, |
1180181a | 99 | <!-- slices --><filename>-.slice</filename>, |
e8fd5554 LP |
100 | <filename>capsule.slice</filename>, |
101 | <filename>machine.slice</filename>, | |
798d3a52 ZJS |
102 | <filename>system.slice</filename>, |
103 | <filename>user.slice</filename>, | |
1c382774 LP |
104 | <!-- the rest --><filename>-.mount</filename>, |
105 | <filename>dbus.service</filename>, | |
2ba7627e ZJS |
106 | <filename>dbus.socket</filename>, |
107 | <filename>display-manager.service</filename>, | |
1c382774 | 108 | <filename>init.scope</filename>, |
01a65d41 | 109 | <filename>syslog.socket</filename>, |
2ba7627e ZJS |
110 | <filename>system-update-cleanup.service</filename> |
111 | </para></refsynopsisdiv> | |
798d3a52 ZJS |
112 | |
113 | <refsect1> | |
114 | <title>Description</title> | |
115 | ||
2ba7627e ZJS |
116 | <para>A few units are treated specially by systemd. Many of them have |
117 | special internal semantics and cannot be renamed, while others simply | |
118 | have a standard meaning and should be present on all systems.</para> | |
798d3a52 ZJS |
119 | </refsect1> |
120 | ||
121 | <refsect1> | |
bb288a2c | 122 | <title>Units managed by the system service manager</title> |
96719f15 ZJS |
123 | |
124 | <refsect2> | |
125 | <title>Special System Units</title> | |
126 | ||
127 | <variablelist> | |
128 | <varlistentry> | |
129 | <term><filename>-.mount</filename></term> | |
130 | <listitem> | |
131 | <para>The root mount point, i.e. the mount unit for the <filename>/</filename> | |
132 | path. This unit is unconditionally active, during the entire time the system is up, as | |
133 | this mount point is where the basic userspace is running from.</para> | |
aefdc112 AK |
134 | |
135 | <xi:include href="version-info.xml" xpointer="v235"/> | |
96719f15 ZJS |
136 | </listitem> |
137 | </varlistentry> | |
138 | ||
139 | <varlistentry> | |
140 | <term><filename>basic.target</filename></term> | |
141 | <listitem> | |
142 | <para>A special target unit covering basic boot-up.</para> | |
143 | ||
144 | <para>systemd automatically adds dependency of the type | |
145 | <varname>After=</varname> for this target unit to all | |
146 | services (except for those with | |
147 | <varname>DefaultDependencies=no</varname>).</para> | |
148 | ||
149 | <para>Usually, this should pull-in all local mount points plus | |
3b121157 ZJS |
150 | <filename>/var/</filename>, <filename>/tmp/</filename> and |
151 | <filename>/var/tmp/</filename>, swap devices, sockets, timers, | |
96719f15 ZJS |
152 | path units and other basic initialization necessary for general |
153 | purpose daemons. The mentioned mount points are special cased | |
154 | to allow them to be remote. | |
155 | </para> | |
156 | ||
157 | <para>This target usually does not pull in any non-target units | |
158 | directly, but rather does so indirectly via other early boot targets. | |
159 | It is instead meant as a synchronization point for late boot | |
160 | services. Refer to | |
161 | <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
162 | for details on the targets involved. | |
163 | </para> | |
82ea3825 LP |
164 | </listitem> |
165 | </varlistentry> | |
166 | <varlistentry> | |
167 | <term><filename>boot-complete.target</filename></term> | |
168 | <listitem> | |
169 | <para>This target is intended as generic synchronization point for services that shall determine or act on | |
170 | whether the boot process completed successfully. Order units that are required to succeed for a boot process | |
171 | to be considered successful before this unit, and add a <varname>Requires=</varname> dependency from the | |
172 | target unit to them. Order units that shall only run when the boot process is considered successful after the | |
173 | target unit and pull in the target from it, also with <varname>Requires=</varname>. Note that by default this | |
174 | target unit is not part of the initial boot transaction, but is supposed to be pulled in only if required by | |
175 | units that want to run only on successful boots.</para> | |
176 | ||
177 | <para>See | |
178 | <citerefentry><refentrytitle>systemd-boot-check-no-failures.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
179 | for a service that implements a generic system health check and orders itself before | |
180 | <filename>boot-complete.target</filename>.</para> | |
181 | ||
182 | <para>See | |
183 | <citerefentry><refentrytitle>systemd-bless-boot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
184 | for a service that propagates boot success information to the boot loader, and orders itself after | |
185 | <filename>boot-complete.target</filename>.</para> | |
aefdc112 AK |
186 | |
187 | <xi:include href="version-info.xml" xpointer="v240"/> | |
96719f15 ZJS |
188 | </listitem> |
189 | </varlistentry> | |
190 | <varlistentry> | |
191 | <term><filename>ctrl-alt-del.target</filename></term> | |
192 | <listitem> | |
193 | <para>systemd starts this target whenever Control+Alt+Del is | |
194 | pressed on the console. Usually, this should be aliased | |
195 | (symlinked) to <filename>reboot.target</filename>.</para> | |
196 | </listitem> | |
197 | </varlistentry> | |
198 | <varlistentry> | |
199 | <term><filename>cryptsetup.target</filename></term> | |
200 | <listitem> | |
6bdcb720 ZJS |
201 | <para>A target that pulls in setup services for all |
202 | encrypted block devices.</para> | |
96719f15 ZJS |
203 | </listitem> |
204 | </varlistentry> | |
08b04ec7 GP |
205 | <varlistentry> |
206 | <term><filename>veritysetup.target</filename></term> | |
207 | <listitem> | |
208 | <para>A target that pulls in setup services for all | |
209 | verity integrity protected block devices.</para> | |
ec07c3c8 AK |
210 | |
211 | <xi:include href="version-info.xml" xpointer="v248"/> | |
08b04ec7 GP |
212 | </listitem> |
213 | </varlistentry> | |
96719f15 ZJS |
214 | <varlistentry> |
215 | <term><filename>dbus.service</filename></term> | |
216 | <listitem> | |
217 | <para>A special unit for the D-Bus bus daemon. As soon as | |
218 | this service is fully started up systemd will connect to it | |
219 | and register its service.</para> | |
220 | </listitem> | |
221 | </varlistentry> | |
222 | <varlistentry> | |
223 | <term><filename>dbus.socket</filename></term> | |
224 | <listitem> | |
225 | <para>A special unit for the D-Bus system bus socket. All | |
226 | units with <varname>Type=dbus</varname> automatically gain a | |
227 | dependency on this unit.</para> | |
228 | </listitem> | |
229 | </varlistentry> | |
230 | <varlistentry> | |
231 | <term><filename>default.target</filename></term> | |
232 | <listitem> | |
2b1daf24 ZJS |
233 | <para>The default unit systemd starts at bootup. Usually, this should be aliased (symlinked) to |
234 | <filename>multi-user.target</filename> or <filename>graphical.target</filename>. See | |
235 | <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry> for | |
236 | more discussion.</para> | |
96719f15 | 237 | |
2b1daf24 ZJS |
238 | <para>The default unit systemd starts at bootup can be overridden with the |
239 | <varname>systemd.unit=</varname> kernel command line option, or more conveniently, with the short | |
240 | names like <varname>single</varname>, <varname>rescue</varname>, <varname>1</varname>, | |
241 | <varname>3</varname>, <varname>5</varname>, …; see | |
242 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para> | |
96719f15 ZJS |
243 | </listitem> |
244 | </varlistentry> | |
245 | <varlistentry> | |
246 | <term><filename>display-manager.service</filename></term> | |
247 | <listitem> | |
248 | <para>The display manager service. Usually, this should be | |
249 | aliased (symlinked) to <filename>gdm.service</filename> or a | |
250 | similar display manager service.</para> | |
251 | </listitem> | |
252 | </varlistentry> | |
253 | <varlistentry> | |
254 | <term><filename>emergency.target</filename></term> | |
255 | <listitem> | |
256 | <para>A special target unit that starts an emergency shell on the main console. This | |
927b9b8f | 257 | target does not pull in other services or mounts. It is the most minimal version of |
96719f15 | 258 | starting the system in order to acquire an interactive shell; the only processes running |
927b9b8f ZJS |
259 | are usually just the system manager (PID 1) and the shell process. This unit may be used |
260 | by specifying <varname>emergency</varname> on the kernel command line; it is | |
261 | also used when a file system check on a required file system fails and boot-up cannot | |
96719f15 ZJS |
262 | continue. Compare with <filename>rescue.target</filename>, which serves a similar |
263 | purpose, but also starts the most basic services and mounts all file systems.</para> | |
264 | ||
96719f15 ZJS |
265 | <para>In many ways booting into <filename>emergency.target</filename> is similar to the |
266 | effect of booting with <literal>init=/bin/sh</literal> on the kernel command line, | |
267 | except that emergency mode provides you with the full system and service manager, and | |
268 | allows starting individual units in order to continue the boot process in steps.</para> | |
927b9b8f ZJS |
269 | |
270 | <para>Note that depending on how <filename>emergency.target</filename> is reached, the root file | |
271 | system might be mounted read-only or read-write (no remounting is done specially for this | |
272 | target). For example, the system may boot with root mounted read-only when <varname>ro</varname> | |
273 | is used on the kernel command line and remain this way for <filename>emergency.target</filename>, | |
274 | or the system may transition to <filename>emergency.target</filename> after the system has been | |
275 | partially booted and disks have already been remounted read-write.</para> | |
96719f15 ZJS |
276 | </listitem> |
277 | </varlistentry> | |
278 | <varlistentry> | |
279 | <term><filename>exit.target</filename></term> | |
280 | <listitem> | |
281 | <para>A special service unit for shutting down the system or | |
282 | user service manager. It is equivalent to | |
283 | <filename>poweroff.target</filename> on non-container | |
284 | systems, and also works in containers.</para> | |
285 | ||
286 | <para>systemd will start this unit when it receives the | |
287 | <constant>SIGTERM</constant> or <constant>SIGINT</constant> | |
288 | signal when running as user service daemon.</para> | |
289 | ||
290 | <para>Normally, this (indirectly) pulls in | |
291 | <filename>shutdown.target</filename>, which in turn should be | |
292 | conflicted by all units that want to be scheduled for | |
293 | shutdown when the service manager starts to exit.</para> | |
aefdc112 AK |
294 | |
295 | <xi:include href="version-info.xml" xpointer="v186"/> | |
96719f15 ZJS |
296 | </listitem> |
297 | </varlistentry> | |
836fb00f YA |
298 | <varlistentry> |
299 | <term><filename>factory-reset.target</filename></term> | |
300 | <listitem> | |
301 | <para>A special target to trigger a factory reset.</para> | |
ec07c3c8 AK |
302 | |
303 | <xi:include href="version-info.xml" xpointer="v250"/> | |
836fb00f YA |
304 | </listitem> |
305 | </varlistentry> | |
96719f15 ZJS |
306 | <varlistentry> |
307 | <term><filename>final.target</filename></term> | |
308 | <listitem> | |
309 | <para>A special target unit that is used during the shutdown | |
310 | logic and may be used to pull in late services after all | |
311 | normal services are already terminated and all mounts | |
312 | unmounted. | |
313 | </para> | |
314 | </listitem> | |
315 | </varlistentry> | |
316 | <varlistentry> | |
317 | <term><filename>getty.target</filename></term> | |
318 | <listitem> | |
319 | <para>A special target unit that pulls in statically | |
320 | configured local TTY <filename>getty</filename> instances. | |
321 | </para> | |
322 | </listitem> | |
323 | </varlistentry> | |
324 | <varlistentry> | |
325 | <term><filename>graphical.target</filename></term> | |
326 | <listitem> | |
327 | <para>A special target unit for setting up a graphical login | |
328 | screen. This pulls in | |
329 | <filename>multi-user.target</filename>.</para> | |
330 | ||
331 | <para>Units that are needed for graphical logins shall add | |
332 | <varname>Wants=</varname> dependencies for their unit to | |
333 | this unit (or <filename>multi-user.target</filename>) during | |
334 | installation. This is best configured via | |
335 | <varname>WantedBy=graphical.target</varname> in the unit's | |
bdac5608 | 336 | [Install] section.</para> |
96719f15 ZJS |
337 | </listitem> |
338 | </varlistentry> | |
339 | <varlistentry> | |
340 | <term><filename>hibernate.target</filename></term> | |
341 | <listitem> | |
342 | <para>A special target unit for hibernating the system. This | |
343 | pulls in <filename>sleep.target</filename>.</para> | |
344 | </listitem> | |
345 | </varlistentry> | |
346 | <varlistentry> | |
347 | <term><filename>hybrid-sleep.target</filename></term> | |
348 | <listitem> | |
349 | <para>A special target unit for hibernating and suspending | |
350 | the system at the same time. This pulls in | |
351 | <filename>sleep.target</filename>.</para> | |
aefdc112 AK |
352 | |
353 | <xi:include href="version-info.xml" xpointer="v196"/> | |
96719f15 ZJS |
354 | </listitem> |
355 | </varlistentry> | |
356 | <varlistentry> | |
357 | <term><filename>suspend-then-hibernate.target</filename></term> | |
358 | <listitem> | |
359 | <para>A special target unit for suspending the system for a period | |
360 | of time, waking it and putting it into hibernate. This pulls in | |
361 | <filename>sleep.target</filename>.</para> | |
aefdc112 AK |
362 | |
363 | <xi:include href="version-info.xml" xpointer="v239"/> | |
96719f15 ZJS |
364 | </listitem> |
365 | </varlistentry> | |
366 | ||
367 | <varlistentry> | |
368 | <term><filename>halt.target</filename></term> | |
369 | <listitem> | |
370 | <para>A special target unit for shutting down and halting | |
371 | the system. Note that this target is distinct from | |
372 | <filename>poweroff.target</filename> in that it generally | |
373 | really just halts the system rather than powering it | |
374 | down.</para> | |
375 | ||
376 | <para>Applications wanting to halt the system should not start this unit | |
377 | directly, but should instead execute <command>systemctl halt</command> | |
378 | (possibly with the <option>--no-block</option> option) or call | |
379 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s | |
380 | <command>org.freedesktop.systemd1.Manager.Halt</command> D-Bus method | |
381 | directly.</para> | |
382 | </listitem> | |
383 | </varlistentry> | |
384 | <varlistentry> | |
385 | <term><filename>init.scope</filename></term> | |
386 | <listitem> | |
387 | <para>This scope unit is where the system and service manager (PID 1) itself resides. It | |
388 | is active as long as the system is running.</para> | |
aefdc112 AK |
389 | |
390 | <xi:include href="version-info.xml" xpointer="v235"/> | |
96719f15 ZJS |
391 | </listitem> |
392 | </varlistentry> | |
2b1daf24 ZJS |
393 | <varlistentry> |
394 | <term><filename>initrd.target</filename></term> | |
395 | <listitem> | |
32e27670 LP |
396 | <para>This is the default target in the initrd, similar to <filename>default.target</filename> in |
397 | the main system. It is used to mount the real root and transition to it. See | |
2b1daf24 ZJS |
398 | <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry> for |
399 | more discussion.</para> | |
aefdc112 AK |
400 | |
401 | <xi:include href="version-info.xml" xpointer="v245"/> | |
2b1daf24 ZJS |
402 | </listitem> |
403 | </varlistentry> | |
96719f15 ZJS |
404 | <varlistentry> |
405 | <term><filename>initrd-fs.target</filename></term> | |
406 | <listitem> | |
407 | <para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
34645144 LP |
408 | automatically adds dependencies of type <varname>Before=</varname> to |
409 | <filename>sysroot-usr.mount</filename> and all mount points found in | |
410 | <filename>/etc/fstab</filename> that have the <option>x-initrd.mount</option> mount option set | |
411 | and do not have the <option>noauto</option> mount option set. It is also indirectly ordered after | |
412 | <filename>sysroot.mount</filename>. Thus, once this target is reached the | |
413 | <filename>/sysroot/</filename> hierarchy is fully set up, in preparation for the transition to | |
414 | the host OS.</para> | |
aefdc112 AK |
415 | |
416 | <xi:include href="version-info.xml" xpointer="v199"/> | |
96719f15 ZJS |
417 | </listitem> |
418 | </varlistentry> | |
419 | <varlistentry> | |
420 | <term><filename>initrd-root-device.target</filename></term> | |
421 | <listitem> | |
422 | <para>A special initrd target unit that is reached when the root filesystem device is available, but before | |
423 | it has been mounted. | |
424 | <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
425 | and | |
426 | <citerefentry><refentrytitle>systemd-gpt-auto-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
427 | automatically setup the appropriate dependencies to make this happen. | |
428 | </para> | |
aefdc112 AK |
429 | |
430 | <xi:include href="version-info.xml" xpointer="v230"/> | |
96719f15 ZJS |
431 | </listitem> |
432 | </varlistentry> | |
433 | <varlistentry> | |
434 | <term><filename>initrd-root-fs.target</filename></term> | |
435 | <listitem> | |
436 | <para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
34645144 LP |
437 | automatically adds dependencies of type <varname>Before=</varname> to the |
438 | <filename>sysroot.mount</filename> unit, which is generated from the kernel command line's | |
439 | <varname>root=</varname> setting (or equivalent).</para> | |
aefdc112 AK |
440 | |
441 | <xi:include href="version-info.xml" xpointer="v199"/> | |
34645144 LP |
442 | </listitem> |
443 | </varlistentry> | |
444 | <varlistentry> | |
445 | <term><filename>initrd-usr-fs.target</filename></term> | |
446 | <listitem> | |
447 | <para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
448 | automatically adds dependencies of type <varname>Before=</varname> to the | |
449 | <filename>sysusr-usr.mount</filename> unit, which is generated from the kernel command line's | |
450 | <varname>usr=</varname> switch. Services may order themselves after this target unit in order to | |
451 | run once the <filename>/sysusr/</filename> hierarchy becomes available, on systems that come up | |
452 | initially without a root file system, but with an initialized <filename>/usr/</filename> and need | |
453 | to access that before setting up the root file system to ultimately switch to. On systems where | |
ea846e45 | 454 | <varname>usr=</varname> is not used this target is ordered after |
34645144 LP |
455 | <filename>sysroot.mount</filename> and thus mostly equivalent to |
456 | <filename>initrd-root-fs.target</filename>. In effect on any system once this target is reached | |
457 | the file system backing <filename>/usr/</filename> is mounted, though possibly at two different | |
458 | locations, either below the <filename>/sysusr/</filename> or the <filename>/sysroot/</filename> | |
459 | hierarchies.</para> | |
ec07c3c8 AK |
460 | |
461 | <xi:include href="version-info.xml" xpointer="v249"/> | |
96719f15 ZJS |
462 | </listitem> |
463 | </varlistentry> | |
464 | <varlistentry> | |
465 | <term><filename>kbrequest.target</filename></term> | |
466 | <listitem> | |
467 | <para>systemd starts this target whenever Alt+ArrowUp is | |
468 | pressed on the console. Note that any user with physical access | |
469 | to the machine will be able to do this, without authentication, | |
470 | so this should be used carefully.</para> | |
471 | </listitem> | |
472 | </varlistentry> | |
473 | <varlistentry> | |
474 | <term><filename>kexec.target</filename></term> | |
475 | <listitem> | |
4de66581 | 476 | <para>A special target unit for shutting down and rebooting the system via kexec.</para> |
96719f15 | 477 | |
4de66581 LP |
478 | <para>Applications wanting to reboot the system should not start this unit directly, but should |
479 | instead execute <command>systemctl kexec</command> (possibly with the | |
480 | <option>--no-block</option> option) or call | |
481 | <citerefentry><refentrytitle>systemd-logind</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s | |
482 | <function>org.freedesktop.login1.Manager.RebootWithFlags()</function> D-Bus method | |
96719f15 | 483 | directly.</para> |
4de66581 LP |
484 | |
485 | <para>See | |
486 | <citerefentry><refentrytitle>systemd-kexec.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
487 | for further details of the operation this target pulls in.</para> | |
96719f15 ZJS |
488 | </listitem> |
489 | </varlistentry> | |
490 | <varlistentry> | |
491 | <term><filename>local-fs.target</filename></term> | |
492 | <listitem> | |
493 | <para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
494 | automatically adds dependencies of type | |
495 | <varname>Before=</varname> to all mount units that refer to | |
496 | local mount points for this target unit. In addition, it | |
497 | adds dependencies of type <varname>Wants=</varname> to this | |
498 | target unit for those mounts listed in | |
499 | <filename>/etc/fstab</filename> that have the | |
500 | <option>auto</option> mount option set.</para> | |
501 | </listitem> | |
502 | </varlistentry> | |
503 | <varlistentry> | |
504 | <term><filename>machines.target</filename></term> | |
505 | <listitem> | |
506 | <para>A standard target unit for starting all the containers | |
507 | and other virtual machines. See <filename>systemd-nspawn@.service</filename> | |
508 | for an example.</para> | |
aefdc112 AK |
509 | |
510 | <xi:include href="version-info.xml" xpointer="v233"/> | |
96719f15 ZJS |
511 | </listitem> |
512 | </varlistentry> | |
513 | <varlistentry> | |
514 | <term><filename>multi-user.target</filename></term> | |
515 | <listitem> | |
516 | <para>A special target unit for setting up a multi-user | |
517 | system (non-graphical). This is pulled in by | |
518 | <filename>graphical.target</filename>.</para> | |
519 | ||
520 | <para>Units that are needed for a multi-user system shall | |
521 | add <varname>Wants=</varname> dependencies for their unit to | |
522 | this unit during installation. This is best configured via | |
523 | <varname>WantedBy=multi-user.target</varname> in the unit's | |
bdac5608 | 524 | [Install] section.</para> |
96719f15 ZJS |
525 | </listitem> |
526 | </varlistentry> | |
527 | <varlistentry> | |
528 | <term><filename>network-online.target</filename></term> | |
529 | <listitem> | |
530 | <para>Units that strictly require a configured network | |
531 | connection should pull in | |
532 | <filename>network-online.target</filename> (via a | |
533 | <varname>Wants=</varname> type dependency) and order | |
534 | themselves after it. This target unit is intended to pull in | |
535 | a service that delays further execution until the network is | |
536 | sufficiently set up. What precisely this requires is left to | |
537 | the implementation of the network managing service.</para> | |
538 | ||
e07ed99d LP |
539 | <para>Note the distinction between this unit and <filename>network.target</filename>. This unit |
540 | is an active unit (i.e. pulled in by the consumer rather than the provider of this functionality) | |
541 | and pulls in a service which possibly adds substantial delays to further execution. In contrast, | |
542 | <filename>network.target</filename> is a passive unit (i.e. pulled in by the provider of the | |
543 | functionality, rather than the consumer) that usually does not delay execution much. Usually, | |
544 | <filename>network.target</filename> is part of the boot of most systems, while | |
545 | <filename>network-online.target</filename> is not, except when at least one unit requires | |
546 | it. Also see <ulink url="https://systemd.io/NETWORK_ONLINE">Running Services After the Network Is | |
547 | Up</ulink> for more information.</para> | |
96719f15 | 548 | |
26ac511a LP |
549 | <para>All mount units for remote network file systems automatically pull in this unit, and order |
550 | themselves after it. Note that networking daemons that simply <emphasis>provide</emphasis> | |
551 | functionality to other hosts (as opposed to <emphasis>consume</emphasis> functionality of other | |
552 | hosts) generally do not need to pull this in.</para> | |
96719f15 ZJS |
553 | |
554 | <para>systemd automatically adds dependencies of type <varname>Wants=</varname> and | |
555 | <varname>After=</varname> for this target unit to all SysV init script service units | |
556 | with an LSB header referring to the <literal>$network</literal> facility.</para> | |
557 | ||
558 | <para>Note that this unit is only useful during the original system start-up | |
559 | logic. After the system has completed booting up, it will not track the online state of | |
560 | the system anymore. Due to this it cannot be used as a network connection monitor | |
561 | concept, it is purely a one-time system start-up concept.</para> | |
aefdc112 AK |
562 | |
563 | <xi:include href="version-info.xml" xpointer="v200"/> | |
96719f15 ZJS |
564 | </listitem> |
565 | </varlistentry> | |
566 | <varlistentry> | |
567 | <term><filename>paths.target</filename></term> | |
568 | <listitem> | |
569 | <para>A special target unit that sets up all path units (see | |
570 | <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
571 | for details) that shall be active after boot.</para> | |
572 | ||
573 | <para>It is recommended that path units installed by | |
574 | applications get pulled in via <varname>Wants=</varname> | |
575 | dependencies from this unit. This is best configured via a | |
576 | <varname>WantedBy=paths.target</varname> in the path unit's | |
bdac5608 | 577 | [Install] section.</para> |
aefdc112 AK |
578 | |
579 | <xi:include href="version-info.xml" xpointer="v199"/> | |
96719f15 ZJS |
580 | </listitem> |
581 | </varlistentry> | |
582 | <varlistentry> | |
583 | <term><filename>poweroff.target</filename></term> | |
584 | <listitem> | |
585 | <para>A special target unit for shutting down and powering | |
586 | off the system.</para> | |
587 | ||
588 | <para>Applications wanting to power off the system should not start this unit | |
589 | directly, but should instead execute <command>systemctl poweroff</command> | |
590 | (possibly with the <option>--no-block</option> option) or call | |
591 | <citerefentry><refentrytitle>systemd-logind</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s | |
592 | <command>org.freedesktop.login1.Manager.PowerOff</command> D-Bus method | |
593 | directly.</para> | |
594 | ||
595 | <para><filename>runlevel0.target</filename> is an alias for | |
596 | this target unit, for compatibility with SysV.</para> | |
597 | </listitem> | |
598 | </varlistentry> | |
599 | <varlistentry> | |
600 | <term><filename>reboot.target</filename></term> | |
601 | <listitem> | |
4de66581 | 602 | <para>A special target unit for shutting down and rebooting the system.</para> |
96719f15 | 603 | |
4de66581 LP |
604 | <para>Applications wanting to reboot the system should not start this unit directly, but should |
605 | instead execute <command>systemctl reboot</command> (possibly with the | |
606 | <option>--no-block</option> option) or call | |
96719f15 | 607 | <citerefentry><refentrytitle>systemd-logind</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s |
4de66581 | 608 | <function>org.freedesktop.login1.Manager.Reboot()</function> D-Bus method directly.</para> |
96719f15 | 609 | |
4de66581 LP |
610 | <para>See |
611 | <citerefentry><refentrytitle>systemd-reboot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
612 | for further details of the operation this target pulls in.</para> | |
613 | ||
614 | <para><filename>runlevel6.target</filename> is an alias for this target unit, for compatibility | |
615 | with SysV.</para> | |
96719f15 ZJS |
616 | </listitem> |
617 | </varlistentry> | |
618 | <varlistentry> | |
619 | <term><filename>remote-cryptsetup.target</filename></term> | |
620 | <listitem> | |
621 | <para>Similar to <filename>cryptsetup.target</filename>, but for encrypted | |
622 | devices which are accessed over the network. It is used for | |
623 | <citerefentry><refentrytitle>crypttab</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
6bdcb720 | 624 | entries marked with <option>_netdev</option>.</para> |
aefdc112 AK |
625 | |
626 | <xi:include href="version-info.xml" xpointer="v235"/> | |
96719f15 ZJS |
627 | </listitem> |
628 | </varlistentry> | |
08b04ec7 GP |
629 | <varlistentry> |
630 | <term><filename>remote-veritysetup.target</filename></term> | |
631 | <listitem> | |
632 | <para>Similar to <filename>veritysetup.target</filename>, but for verity | |
633 | integrity protected devices which are accessed over the network. It is used for | |
634 | <citerefentry><refentrytitle>veritytab</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
635 | entries marked with <option>_netdev</option>.</para> | |
ec07c3c8 AK |
636 | |
637 | <xi:include href="version-info.xml" xpointer="v248"/> | |
08b04ec7 GP |
638 | </listitem> |
639 | </varlistentry> | |
96719f15 ZJS |
640 | <varlistentry> |
641 | <term><filename>remote-fs.target</filename></term> | |
642 | <listitem> | |
643 | <para>Similar to <filename>local-fs.target</filename>, but | |
644 | for remote mount points.</para> | |
645 | ||
646 | <para>systemd automatically adds dependencies of type | |
647 | <varname>After=</varname> for this target unit to all SysV | |
648 | init script service units with an LSB header referring to | |
649 | the <literal>$remote_fs</literal> facility.</para> | |
650 | </listitem> | |
651 | </varlistentry> | |
652 | <varlistentry> | |
653 | <term><filename>rescue.target</filename></term> | |
654 | <listitem> | |
655 | <para>A special target unit that pulls in the base system (including system mounts) and | |
656 | spawns a rescue shell. Isolate to this target in order to administer the system in | |
657 | single-user mode with all file systems mounted but with no services running, except for | |
658 | the most basic. Compare with <filename>emergency.target</filename>, which is much more | |
659 | reduced and does not provide the file systems or most basic services. Compare with | |
660 | <filename>multi-user.target</filename>, this target could be seen as | |
661 | <filename>single-user.target</filename>.</para> | |
662 | ||
663 | <para><filename>runlevel1.target</filename> is an alias for this target unit, for | |
664 | compatibility with SysV.</para> | |
665 | ||
666 | <para>Use the <literal>systemd.unit=rescue.target</literal> kernel command line option | |
667 | to boot into this mode. A short alias for this kernel command line option is | |
668 | <literal>1</literal>, for compatibility with SysV.</para> | |
669 | </listitem> | |
670 | </varlistentry> | |
671 | <varlistentry> | |
672 | <term><filename>runlevel2.target</filename></term> | |
673 | <term><filename>runlevel3.target</filename></term> | |
674 | <term><filename>runlevel4.target</filename></term> | |
675 | <term><filename>runlevel5.target</filename></term> | |
676 | <listitem> | |
677 | <para>These are targets that are called whenever the SysV | |
678 | compatibility code asks for runlevel 2, 3, 4, 5, | |
679 | respectively. It is a good idea to make this an alias for | |
680 | (i.e. symlink to) <filename>graphical.target</filename> | |
681 | (for runlevel 5) or <filename>multi-user.target</filename> | |
682 | (the others).</para> | |
683 | </listitem> | |
684 | </varlistentry> | |
685 | <varlistentry> | |
686 | <term><filename>shutdown.target</filename></term> | |
687 | <listitem> | |
688 | <para>A special target unit that terminates the services on | |
689 | system shutdown.</para> | |
690 | ||
691 | <para>Services that shall be terminated on system shutdown | |
692 | shall add <varname>Conflicts=</varname> and | |
693 | <varname>Before=</varname> dependencies to this unit for | |
694 | their service unit, which is implicitly done when | |
695 | <varname>DefaultDependencies=yes</varname> is set (the | |
696 | default).</para> | |
697 | </listitem> | |
698 | </varlistentry> | |
699 | <varlistentry> | |
700 | <term><filename>sigpwr.target</filename></term> | |
701 | <listitem> | |
702 | <para>A special target that is started when systemd receives | |
703 | the SIGPWR process signal, which is normally sent by the | |
704 | kernel or UPS daemons when power fails.</para> | |
705 | </listitem> | |
706 | </varlistentry> | |
707 | <varlistentry> | |
708 | <term><filename>sleep.target</filename></term> | |
709 | <listitem> | |
710 | <para>A special target unit that is pulled in by | |
711 | <filename>suspend.target</filename>, | |
712 | <filename>hibernate.target</filename> and | |
713 | <filename>hybrid-sleep.target</filename> and may be used to | |
714 | hook units into the sleep state logic.</para> | |
715 | </listitem> | |
716 | </varlistentry> | |
717 | <varlistentry> | |
718 | <term><filename>slices.target</filename></term> | |
719 | <listitem> | |
720 | <para>A special target unit that sets up all slice units (see | |
721 | <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
4aabca00 ZJS |
722 | for details) that shall always be active after boot. By default the generic |
723 | <filename>system.slice</filename> slice unit as well as the root slice unit | |
724 | <filename>-.slice</filename> are pulled in and ordered before this unit (see | |
96719f15 ZJS |
725 | below).</para> |
726 | ||
4aabca00 ZJS |
727 | <para>Adding slice units to <filename>slices.target</filename> is generally not |
728 | necessary. Instead, when some unit that uses <varname>Slice=</varname> is started, the | |
729 | specified slice will be started automatically. Adding | |
bdac5608 | 730 | <varname>WantedBy=slices.target</varname> lines to the [Install] |
4aabca00 ZJS |
731 | section should only be done for units that need to be always active. In that case care |
732 | needs to be taken to avoid creating a loop through the automatic dependencies on | |
733 | "parent" slices.</para> | |
aefdc112 AK |
734 | |
735 | <xi:include href="version-info.xml" xpointer="v229"/> | |
96719f15 ZJS |
736 | </listitem> |
737 | </varlistentry> | |
738 | <varlistentry> | |
739 | <term><filename>sockets.target</filename></term> | |
740 | <listitem> | |
741 | <para>A special target unit that sets up all socket | |
742 | units (see | |
743 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
744 | for details) that shall be active after boot.</para> | |
745 | ||
746 | <para>Services that can be socket-activated shall add | |
747 | <varname>Wants=</varname> dependencies to this unit for | |
748 | their socket unit during installation. This is best | |
749 | configured via a <varname>WantedBy=sockets.target</varname> | |
bdac5608 | 750 | in the socket unit's [Install] |
96719f15 ZJS |
751 | section.</para> |
752 | </listitem> | |
753 | </varlistentry> | |
4de66581 LP |
754 | <varlistentry> |
755 | <term><filename>soft-reboot.target</filename></term> | |
756 | <listitem> | |
757 | <para>A special target unit for shutting down and rebooting the userspace of the system (leaving | |
758 | the kernel running).</para> | |
759 | ||
760 | <para>Applications wanting to reboot the system should not start this unit directly, but should | |
761 | instead execute <command>systemctl soft-reboot</command> (possibly with the | |
762 | <option>--no-block</option> option) or call | |
763 | <citerefentry><refentrytitle>systemd-logind</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s | |
764 | <function>org.freedesktop.login1.Manager.RebootWithFlags()</function> D-Bus method | |
765 | directly.</para> | |
766 | ||
767 | <para>See | |
768 | <citerefentry><refentrytitle>systemd-soft-reboot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
769 | for further details of the operation this target pulls in.</para> | |
ec07c3c8 AK |
770 | |
771 | <xi:include href="version-info.xml" xpointer="v254"/> | |
4de66581 LP |
772 | </listitem> |
773 | </varlistentry> | |
eae4943a LP |
774 | <varlistentry> |
775 | <term><filename>storage-target-mode.target</filename></term> | |
776 | <listitem> | |
777 | <para>A special target unit that can be booted into that selects the "Storage Target Mode" for | |
778 | the OS. In this mode all local storage disks are exposed to external systems as block | |
779 | devices. This invokes | |
780 | <citerefentry><refentrytitle>systemd-storagetm.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
781 | which exposes all local disks as NVMe-TCP devices for access over the network. It might as well | |
782 | invoke other services too that make local disks available via other mechanisms.</para> | |
783 | <xi:include href="version-info.xml" xpointer="v255"/> | |
784 | </listitem> | |
785 | </varlistentry> | |
96719f15 ZJS |
786 | <varlistentry> |
787 | <term><filename>suspend.target</filename></term> | |
788 | <listitem> | |
789 | <para>A special target unit for suspending the system. This | |
790 | pulls in <filename>sleep.target</filename>.</para> | |
791 | </listitem> | |
792 | </varlistentry> | |
793 | <varlistentry> | |
794 | <term><filename>swap.target</filename></term> | |
795 | <listitem> | |
796 | <para>Similar to <filename>local-fs.target</filename>, but | |
797 | for swap partitions and swap files.</para> | |
798 | </listitem> | |
799 | </varlistentry> | |
800 | <varlistentry> | |
801 | <term><filename>sysinit.target</filename></term> | |
802 | <listitem> | |
803 | <para>systemd automatically adds dependencies of the types | |
804 | <varname>Requires=</varname> and <varname>After=</varname> | |
805 | for this target unit to all services (except for those with | |
806 | <varname>DefaultDependencies=no</varname>).</para> | |
807 | ||
808 | <para>This target pulls in the services required for system | |
809 | initialization. System services pulled in by this target should | |
810 | declare <varname>DefaultDependencies=no</varname> and specify | |
811 | all their dependencies manually, including access to anything | |
812 | more than a read only root filesystem. For details on the | |
813 | dependencies of this target, refer to | |
814 | <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>. | |
815 | </para> | |
816 | </listitem> | |
817 | </varlistentry> | |
818 | <varlistentry> | |
819 | <term><filename>syslog.socket</filename></term> | |
820 | <listitem> | |
821 | <para>The socket unit syslog implementations should listen | |
822 | on. All userspace log messages will be made available on | |
823 | this socket. For more information about syslog integration, | |
824 | please consult the <ulink | |
825 | url="https://www.freedesktop.org/wiki/Software/systemd/syslog">Syslog | |
826 | Interface</ulink> document.</para> | |
827 | </listitem> | |
828 | </varlistentry> | |
829 | <varlistentry> | |
830 | <term><filename>system-update.target</filename></term> | |
831 | <term><filename>system-update-pre.target</filename></term> | |
832 | <term><filename>system-update-cleanup.service</filename></term> | |
833 | <listitem> | |
834 | <para>A special target unit that is used for offline system updates. | |
835 | <citerefentry><refentrytitle>systemd-system-update-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
b9dac418 EC |
836 | will redirect the boot process to this target if <filename>/system-update</filename> or |
837 | <filename>/etc/system-update</filename> exists. For more information see | |
96719f15 ZJS |
838 | <citerefentry><refentrytitle>systemd.offline-updates</refentrytitle><manvolnum>7</manvolnum></citerefentry>. |
839 | </para> | |
840 | ||
841 | <para>Updates should happen before the <filename>system-update.target</filename> is | |
842 | reached, and the services which implement them should cause the machine to reboot. The | |
843 | main units executing the update should order themselves after | |
844 | <filename>system-update-pre.target</filename> but not pull it in. Services which want to | |
845 | run during system updates only, but before the actual system update is executed should | |
846 | order themselves before this unit and pull it in. As a safety measure, if this does not | |
b9dac418 EC |
847 | happen, and <filename>/system-update</filename> or |
848 | <filename>/etc/system-update</filename> still exists after | |
96719f15 | 849 | <filename>system-update.target</filename> is reached, |
b9dac418 | 850 | <filename>system-update-cleanup.service</filename> will remove the symlinks and reboot |
96719f15 | 851 | the machine.</para> |
aefdc112 AK |
852 | |
853 | <xi:include href="version-info.xml" xpointer="v186"/> | |
96719f15 ZJS |
854 | </listitem> |
855 | </varlistentry> | |
856 | <varlistentry> | |
857 | <term><filename>timers.target</filename></term> | |
858 | <listitem> | |
859 | <para>A special target unit that sets up all timer units | |
860 | (see | |
861 | <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
862 | for details) that shall be active after boot.</para> | |
863 | ||
864 | <para>It is recommended that timer units installed by | |
865 | applications get pulled in via <varname>Wants=</varname> | |
866 | dependencies from this unit. This is best configured via | |
867 | <varname>WantedBy=timers.target</varname> in the timer | |
bdac5608 | 868 | unit's [Install] section.</para> |
aefdc112 AK |
869 | |
870 | <xi:include href="version-info.xml" xpointer="v199"/> | |
96719f15 ZJS |
871 | </listitem> |
872 | </varlistentry> | |
873 | <varlistentry> | |
874 | <term><filename>umount.target</filename></term> | |
875 | <listitem> | |
876 | <para>A special target unit that unmounts all mount and | |
877 | automount points on system shutdown.</para> | |
878 | ||
879 | <para>Mounts that shall be unmounted on system shutdown | |
880 | shall add Conflicts dependencies to this unit for their | |
881 | mount unit, which is implicitly done when | |
882 | <varname>DefaultDependencies=yes</varname> is set (the | |
883 | default).</para> | |
884 | </listitem> | |
885 | </varlistentry> | |
798d3a52 | 886 | |
96719f15 ZJS |
887 | </variablelist> |
888 | </refsect2> | |
798d3a52 | 889 | |
96719f15 ZJS |
890 | <refsect2> |
891 | <title>Special System Units for Devices</title> | |
798d3a52 | 892 | |
96719f15 ZJS |
893 | <para>Some target units are automatically pulled in as devices of |
894 | certain kinds show up in the system. These may be used to | |
895 | automatically activate various services based on the specific type | |
896 | of the available hardware.</para> | |
798d3a52 | 897 | |
96719f15 ZJS |
898 | <variablelist> |
899 | <varlistentry> | |
900 | <term><filename>bluetooth.target</filename></term> | |
901 | <listitem> | |
902 | <para>This target is started automatically as soon as a | |
903 | Bluetooth controller is plugged in or becomes available at | |
904 | boot.</para> | |
98d2d468 | 905 | |
96719f15 ZJS |
906 | <para>This may be used to pull in Bluetooth management |
907 | daemons dynamically when Bluetooth hardware is found.</para> | |
908 | </listitem> | |
909 | </varlistentry> | |
910 | <varlistentry> | |
911 | <term><filename>printer.target</filename></term> | |
912 | <listitem> | |
913 | <para>This target is started automatically as soon as a | |
914 | printer is plugged in or becomes available at boot.</para> | |
915 | ||
916 | <para>This may be used to pull in printer management daemons | |
917 | dynamically when printer hardware is found.</para> | |
918 | </listitem> | |
919 | </varlistentry> | |
920 | <varlistentry> | |
921 | <term><filename>smartcard.target</filename></term> | |
922 | <listitem> | |
923 | <para>This target is started automatically as soon as a | |
924 | smartcard controller is plugged in or becomes available at | |
925 | boot.</para> | |
926 | ||
927 | <para>This may be used to pull in smartcard management | |
928 | daemons dynamically when smartcard hardware is found.</para> | |
929 | </listitem> | |
930 | </varlistentry> | |
931 | <varlistentry> | |
932 | <term><filename>sound.target</filename></term> | |
933 | <listitem> | |
934 | <para>This target is started automatically as soon as a | |
935 | sound card is plugged in or becomes available at | |
936 | boot.</para> | |
937 | ||
938 | <para>This may be used to pull in audio management daemons | |
939 | dynamically when audio hardware is found.</para> | |
940 | </listitem> | |
941 | </varlistentry> | |
2c633a82 AP |
942 | <varlistentry> |
943 | <term><filename>usb-gadget.target</filename></term> | |
944 | <listitem> | |
945 | <para>This target is started automatically as soon as a | |
946 | USB Device Controller becomes available at boot.</para> | |
947 | ||
948 | <para>This may be used to pull in usb gadget | |
949 | dynamically when UDC hardware is found.</para> | |
aefdc112 AK |
950 | |
951 | <xi:include href="version-info.xml" xpointer="v242"/> | |
2c633a82 AP |
952 | </listitem> |
953 | </varlistentry> | |
4e1f0037 LP |
954 | <varlistentry> |
955 | <term><filename>tpm2.target</filename></term> | |
956 | <listitem> | |
957 | <para>This target is started automatically if a TPM2 device is discovered, either by the OS or by | |
958 | the firmware. It acts as synchronization point for services that require TPM2 device access. The | |
959 | target unit is enqueued by | |
960 | <citerefentry><refentrytitle>systemd-tpm2-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
961 | if it detects that the firmware has discovered a TPM2 device but the OS kernel has not activated | |
962 | a driver for it yet. It is also pulled in whenever | |
963 | <citerefentry><refentrytitle>systemd-udevd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
964 | discovers a TPM2 device. The target unit is ordered after the <filename>/dev/tpmrm0</filename> | |
965 | device node, so that it only becomes active once the TPM2 device is actually accessible. Early | |
966 | boot programs that intend to access the TPM2 device should hence order themselves after this | |
967 | target unit, but not pull it in.</para> | |
968 | ||
969 | <xi:include href="version-info.xml" xpointer="v256"/> | |
970 | </listitem> | |
971 | </varlistentry> | |
96719f15 ZJS |
972 | </variablelist> |
973 | </refsect2> | |
974 | ||
975 | <refsect2> | |
976 | <title>Special Passive System Units </title> | |
977 | ||
978 | <para>A number of special system targets are defined that can be | |
979 | used to properly order boot-up of optional services. These targets | |
980 | are generally not part of the initial boot transaction, unless | |
981 | they are explicitly pulled in by one of the implementing services. | |
982 | Note specifically that these <emphasis>passive</emphasis> target | |
983 | units are generally not pulled in by the consumer of a service, | |
984 | but by the provider of the service. This means: a consuming | |
985 | service should order itself after these targets (as appropriate), | |
986 | but not pull it in. A providing service should order itself before | |
987 | these targets (as appropriate) and pull it in (via a | |
988 | <varname>Wants=</varname> type dependency).</para> | |
989 | ||
990 | <para>Note that these passive units cannot be started manually, | |
991 | i.e. <literal>systemctl start time-sync.target</literal> will fail | |
992 | with an error. They can only be pulled in by dependency. This is | |
993 | enforced since they exist for ordering purposes only and thus are | |
994 | not useful as only unit within a transaction.</para> | |
995 | ||
996 | <variablelist> | |
68bda079 LP |
997 | <varlistentry> |
998 | <term><filename>blockdev@.target</filename></term> | |
8e92d92f ZJS |
999 | <listitem><para>This template unit is used to order mount units and other consumers of block |
1000 | devices after services that synthesize these block devices. In particular, this is intended to be | |
1001 | used with storage services (such as | |
08b04ec7 GP |
1002 | <citerefentry><refentrytitle>systemd-cryptsetup@.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>/ |
1003 | <citerefentry><refentrytitle>systemd-veritysetup@.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>) | |
8e92d92f ZJS |
1004 | that allocate and manage a virtual block device. Storage services are ordered before an instance of |
1005 | <filename>blockdev@.target</filename>, and the consumer units after it. The ordering is | |
1006 | particularly relevant during shutdown, as it ensures that the mount is deactivated first and the | |
1007 | service backing the mount later. The <filename>blockdev@.target</filename> instance should be | |
1008 | pulled in via a <option>Wants=</option> dependency of the storage daemon and thus generally not be | |
1009 | part of any transaction unless a storage daemon is used. The instance name for instances of this | |
1010 | template unit must be a properly escaped block device node path, e.g. | |
211c99c7 | 1011 | <filename index="false">blockdev@dev-mapper-foobar.target</filename> for the storage device |
aefdc112 AK |
1012 | <filename index="false">/dev/mapper/foobar</filename>.</para> |
1013 | ||
1014 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
68bda079 | 1015 | </varlistentry> |
96719f15 ZJS |
1016 | <varlistentry> |
1017 | <term><filename>cryptsetup-pre.target</filename></term> | |
1018 | <listitem> | |
1019 | <para>This passive target unit may be pulled in by services | |
1020 | that want to run before any encrypted block device is set | |
1021 | up. All encrypted block devices are set up after this target | |
1022 | has been reached. Since the shutdown order is implicitly the | |
1023 | reverse start-up order between units, this target is | |
1024 | particularly useful to ensure that a service is shut down | |
1025 | only after all encrypted block devices are fully | |
1026 | stopped.</para> | |
aefdc112 AK |
1027 | |
1028 | <xi:include href="version-info.xml" xpointer="v215"/> | |
96719f15 ZJS |
1029 | </listitem> |
1030 | </varlistentry> | |
08b04ec7 GP |
1031 | <varlistentry> |
1032 | <term><filename>veritysetup-pre.target</filename></term> | |
1033 | <listitem> | |
1034 | <para>This passive target unit may be pulled in by services | |
1035 | that want to run before any verity integrity protected block | |
1036 | device is set up. All verity integrity protected block | |
1037 | devices are set up after this target has been reached. Since | |
1038 | the shutdown order is implicitly the reverse start-up order | |
1039 | between units, this target is particularly useful to ensure | |
1040 | that a service is shut down only after all verity integrity | |
1041 | protected block devices are fully stopped.</para> | |
ec07c3c8 AK |
1042 | |
1043 | <xi:include href="version-info.xml" xpointer="v248"/> | |
08b04ec7 GP |
1044 | </listitem> |
1045 | </varlistentry> | |
f4466bdb HS |
1046 | <varlistentry> |
1047 | <term><filename>first-boot-complete.target</filename></term> | |
1048 | <listitem> | |
1049 | <para>This passive target is intended as a synchronization point for units that need to run once | |
1050 | during the first boot. Only after all units ordered before this target have finished, will the | |
1051 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
1052 | be committed to disk, marking the first boot as completed. If the boot is aborted at any time | |
1053 | before that, the next boot will re-run any units with <varname>ConditionFirstBoot=yes</varname>. | |
1054 | </para> | |
ec07c3c8 AK |
1055 | |
1056 | <xi:include href="version-info.xml" xpointer="v247"/> | |
f4466bdb HS |
1057 | </listitem> |
1058 | </varlistentry> | |
96719f15 ZJS |
1059 | <varlistentry> |
1060 | <term><filename>getty-pre.target</filename></term> | |
1061 | <listitem> | |
1062 | <para>A special passive target unit. Users of this target | |
1063 | are expected to pull it in the boot transaction via | |
1064 | a dependency (e.g. <varname>Wants=</varname>). Order your | |
1065 | unit before this unit if you want to make use of the console | |
1066 | just before <filename>getty</filename> is started. | |
1067 | </para> | |
aefdc112 AK |
1068 | |
1069 | <xi:include href="version-info.xml" xpointer="v235"/> | |
96719f15 ZJS |
1070 | </listitem> |
1071 | </varlistentry> | |
1072 | <varlistentry> | |
1073 | <term><filename>local-fs-pre.target</filename></term> | |
1074 | <listitem> | |
1075 | <para>This target unit is | |
1076 | automatically ordered before | |
1077 | all local mount points marked | |
1078 | with <option>auto</option> | |
1079 | (see above). It can be used to | |
1080 | execute certain units before | |
1081 | all local mounts.</para> | |
1082 | </listitem> | |
1083 | </varlistentry> | |
1084 | <varlistentry> | |
1085 | <term><filename>network.target</filename></term> | |
1086 | <listitem> | |
85f3bd23 LP |
1087 | <para>This unit is supposed to indicate when network functionality is available, but it is only |
1088 | very weakly defined what that is supposed to mean. However, the following should apply at | |
1089 | minimum:</para> | |
1090 | ||
1091 | <itemizedlist> | |
1092 | <listitem><para>At start-up, any configured synthetic network devices (i.e. not physical ones | |
1093 | that require hardware to show up and be probed, but virtual ones like bridge devices and | |
1094 | similar which are created programmatically) that do not depend on any underlying hardware | |
1095 | should be allocated by the time this target is reached. It is not necessary for these | |
1096 | interfaces to also have completed IP level configuration by the time | |
1097 | <filename>network.target</filename> is reached.</para></listitem> | |
1098 | ||
1099 | <listitem><para>At shutdown, a unit that is ordered after <filename>network.target</filename> | |
1100 | will be stopped before the network — to whatever level it might be set up by then — is shut | |
1101 | down. It is hence useful when writing service files that require network access on shutdown, | |
1102 | which should order themselves after this target, but not pull it in. Also see <ulink | |
e07ed99d LP |
1103 | url="https://systemd.io/NETWORK_ONLINE">Running Services After the Network Is Up</ulink> for |
1104 | more information.</para></listitem> | |
85f3bd23 LP |
1105 | </itemizedlist> |
1106 | ||
1107 | <para>It must emphasized that at start-up there's no guarantee that hardware-based devices have | |
1108 | shown up by the time this target is reached, or even acquired complete IP configuration. For that | |
1109 | purpose use <filename>network-online.target</filename> as described above.</para> | |
96719f15 ZJS |
1110 | </listitem> |
1111 | </varlistentry> | |
1112 | <varlistentry> | |
1113 | <term><filename>network-pre.target</filename></term> | |
1114 | <listitem> | |
e07ed99d LP |
1115 | <para>This passive target unit may be pulled in by services that want to run before any network |
1116 | is set up, for example for the purpose of setting up a firewall. All network management software | |
1117 | orders itself after this target, but does not pull it in. Also see <ulink | |
1118 | url="https://systemd.io/NETWORK_ONLINE">Running Services After the Network Is Up</ulink> for more | |
1119 | information.</para> | |
aefdc112 AK |
1120 | |
1121 | <xi:include href="version-info.xml" xpointer="v214"/> | |
96719f15 ZJS |
1122 | </listitem> |
1123 | </varlistentry> | |
1124 | <varlistentry> | |
1125 | <term><filename>nss-lookup.target</filename></term> | |
1126 | <listitem> | |
1127 | <para>A target that should be used as synchronization point for all host/network name | |
1128 | service lookups. Note that this is independent of UNIX user/group name lookups for which | |
1129 | <filename>nss-user-lookup.target</filename> should be used. All services for which the | |
1130 | availability of full host/network name resolution is essential should be ordered after | |
1131 | this target, but not pull it in. systemd automatically adds dependencies of type | |
1132 | <varname>After=</varname> for this target unit to all SysV init script service units | |
1133 | with an LSB header referring to the <literal>$named</literal> facility.</para> | |
1134 | </listitem> | |
1135 | </varlistentry> | |
1136 | <varlistentry> | |
1137 | <term><filename>nss-user-lookup.target</filename></term> | |
1138 | <listitem> | |
1139 | <para>A target that should be used as synchronization point for all regular UNIX | |
1140 | user/group name service lookups. Note that this is independent of host/network name | |
1141 | lookups for which <filename>nss-lookup.target</filename> should be used. All services | |
1142 | for which the availability of the full user/group database is essential should be | |
1143 | ordered after this target, but not pull it in. All services which provide parts of the | |
1144 | user/group database should be ordered before this target, and pull it in. Note that this | |
1145 | unit is only relevant for regular users and groups — system users and groups are | |
1146 | required to be resolvable during earliest boot already, and hence do not need any | |
1147 | special ordering against this target.</para> | |
1148 | </listitem> | |
1149 | </varlistentry> | |
1150 | <varlistentry> | |
1151 | <term><filename>remote-fs-pre.target</filename></term> | |
1152 | <listitem> | |
1153 | <para>This target unit is automatically ordered before all | |
08b04ec7 | 1154 | mount point units (see above) and cryptsetup/veritysetup devices |
96719f15 ZJS |
1155 | marked with the <option>_netdev</option>. It can be used to run |
1156 | certain units before remote encrypted devices and mounts are established. | |
1157 | Note that this unit is generally not part of the initial | |
1158 | transaction, unless the unit that wants to be ordered before | |
1159 | all remote mounts pulls it in via a | |
1160 | <varname>Wants=</varname> type dependency. If the unit wants | |
1161 | to be pulled in by the first remote mount showing up, it | |
1162 | should use <filename>network-online.target</filename> (see | |
1163 | above).</para> | |
1164 | </listitem> | |
1165 | </varlistentry> | |
1166 | <varlistentry> | |
1167 | <term><filename>rpcbind.target</filename></term> | |
1168 | <listitem> | |
1169 | <para>The portmapper/rpcbind pulls in this target and orders | |
1170 | itself before it, to indicate its availability. systemd | |
1171 | automatically adds dependencies of type | |
1172 | <varname>After=</varname> for this target unit to all SysV | |
1173 | init script service units with an LSB header referring to | |
1174 | the <literal>$portmap</literal> facility.</para> | |
1175 | </listitem> | |
1176 | </varlistentry> | |
95be59f9 LP |
1177 | <varlistentry> |
1178 | <term><filename>ssh-access.target</filename></term> | |
1179 | <listitem> | |
1180 | <para>Service and socket units that provide remote SSH secure shell access to the local system | |
1181 | should pull in this unit and order themselves before this unit. It's supposed to act as a | |
1182 | milestone indicating if and when SSH access into the system is available. It should only become | |
1183 | active when an SSH port is bound for remote clients (i.e. if SSH is used as a local privilege | |
1184 | escalation mechanism, it should <emphasis>not</emphasis> involve this target unit), regardless of | |
1185 | the protocol choices, i.e. regardless if IPv4, IPv6 or <constant>AF_VSOCK</constant> is | |
1186 | used.</para> | |
1187 | <xi:include href="version-info.xml" xpointer="v256"/> | |
1188 | </listitem> | |
1189 | </varlistentry> | |
4ea0f675 PB |
1190 | <varlistentry> |
1191 | <term><filename>time-set.target</filename></term> | |
1192 | <listitem> | |
b149d230 LP |
1193 | <para>Services responsible for setting the system clock (<constant>CLOCK_REALTIME</constant>) |
1194 | from a local source (such as a maintained timestamp file or imprecise real-time clock) should | |
1195 | pull in this target and order themselves before it. Services where approximate, roughly monotonic | |
1196 | time is desired should be ordered after this unit, but not pull it in.</para> | |
1197 | ||
1198 | <para>This target does not provide the accuracy guarantees of | |
1199 | <filename>time-sync.target</filename> (see below), however does not depend on remote clock | |
1200 | sources to be reachable, i.e. the target is typically not delayed by network problems and | |
1201 | similar. Use of this target is recommended for services where approximate clock accuracy and | |
1202 | rough monotonicity is desired but activation shall not be delayed for possibly unreliable network | |
1203 | communication.</para> | |
1204 | ||
1205 | <para>The service manager automatically adds dependencies of type <varname>After=</varname> for | |
1206 | this target unit to all timer units with at least one <varname>OnCalendar=</varname> | |
1207 | directive.</para> | |
1208 | ||
1209 | <para>The | |
1210 | <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
1211 | service is a simple daemon that pulls in this target and orders itself before it. Besides | |
1212 | implementing the SNTP network protocol it maintains a timestamp file on disk whose modification | |
6870daff | 1213 | time is regularly updated. At service start-up the local system clock is set from that modification time, |
b149d230 LP |
1214 | ensuring it increases roughly monotonically.</para> |
1215 | ||
1216 | <para>Note that ordering a unit after <filename>time-set.target</filename> only has effect if | |
1217 | there's actually a service ordered before it that delays it until the clock is adjusted for rough | |
1218 | monotonicity. Otherwise, this target might get reached before the clock is adjusted to be roughly | |
1219 | monotonic. Enable | |
1220 | <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, | |
57b3b8f4 | 1221 | or an alternative NTP implementation to delay the target.</para> |
aefdc112 AK |
1222 | |
1223 | <xi:include href="version-info.xml" xpointer="v242"/> | |
4ea0f675 PB |
1224 | </listitem> |
1225 | </varlistentry> | |
96719f15 ZJS |
1226 | <varlistentry> |
1227 | <term><filename>time-sync.target</filename></term> | |
1228 | <listitem> | |
b149d230 LP |
1229 | <para>Services indicating completed synchronization of the system clock |
1230 | (<constant>CLOCK_REALTIME</constant>) to a remote source should pull in this target and order | |
1231 | themselves before it. Services where accurate time is essential should be ordered after this | |
1232 | unit, but not pull it in.</para> | |
1431b2f7 | 1233 | |
b149d230 LP |
1234 | <para>The service manager automatically adds dependencies of type <varname>After=</varname> for |
1235 | this target unit to all SysV init script service units with an LSB header referring to the | |
1236 | <literal>$time</literal> facility, as well to all timer units with at least one | |
1237 | <varname>OnCalendar=</varname> directive.</para> | |
1238 | ||
1239 | <para>This target provides stricter clock accuracy guarantees than | |
57b3b8f4 LP |
1240 | <filename>time-set.target</filename> (see above), but likely requires |
1241 | network communication and thus introduces unpredictable delays. | |
1242 | Services that require clock accuracy and where network | |
b149d230 LP |
1243 | communication delays are acceptable should use this target. Services that require a less accurate |
1244 | clock, and only approximate and roughly monotonic clock behaviour should use | |
1245 | <filename>time-set.target</filename> instead.</para> | |
1246 | ||
1247 | <para>Note that ordering a unit after <filename>time-sync.target</filename> only has effect if | |
1248 | there's actually a service ordered before it that delays it until clock synchronization is | |
1249 | reached. Otherwise, this target might get reached before the clock is synchronized to any remote | |
1250 | accurate reference clock. When using | |
1431b2f7 | 1251 | <citerefentry><refentrytitle>systemd-timesyncd.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
b149d230 LP |
1252 | enable |
1253 | <citerefentry><refentrytitle>systemd-time-wait-sync.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
57b3b8f4 | 1254 | to delay the target; or use an equivalent service for other NTP implementations.</para> |
b149d230 LP |
1255 | |
1256 | <table> | |
1257 | <title>Comparison</title> | |
1258 | <tgroup cols='2' align='left' colsep='1' rowsep='1'> | |
1259 | <colspec colname="time-set" /> | |
1260 | <colspec colname="time-sync" /> | |
1261 | <thead> | |
1262 | <row> | |
1263 | <entry><filename>time-set.target</filename></entry> | |
1264 | <entry><filename>time-sync.target</filename></entry> | |
1265 | </row> | |
1266 | </thead> | |
1267 | <tbody> | |
1268 | <row> | |
1269 | <entry>"quick" to reach</entry> | |
1270 | <entry>"slow" to reach</entry> | |
1271 | </row> | |
1272 | <row> | |
1273 | <entry>typically uses local clock sources, boot process not affected by availability of external resources</entry> | |
1274 | <entry>typically uses remote clock sources, inserts dependencies on remote resources into boot process</entry> | |
1275 | </row> | |
1276 | <row> | |
1277 | <entry>reliable, because local</entry> | |
1278 | <entry>unreliable, because typically network involved</entry> | |
1279 | </row> | |
1280 | <row> | |
1281 | <entry>typically guarantees an approximate and roughly monotonic clock only</entry> | |
1282 | <entry>typically guarantees an accurate clock</entry> | |
1283 | </row> | |
1284 | <row> | |
1285 | <entry>implemented by <filename>systemd-timesyncd.service</filename></entry> | |
1286 | <entry>implemented by <filename>systemd-time-wait-sync.service</filename></entry> | |
1287 | </row> | |
1288 | </tbody> | |
1289 | </tgroup> | |
1290 | </table> | |
1291 | ||
96719f15 ZJS |
1292 | </listitem> |
1293 | </varlistentry> | |
1294 | </variablelist> | |
1295 | </refsect2> | |
1296 | ||
1297 | <refsect2> | |
1298 | <title>Special Slice Units</title> | |
1299 | ||
1300 | <para>There are four <literal>.slice</literal> units which form the basis of the hierarchy for | |
1301 | assignment of resources for services, users, and virtual machines or containers. See | |
1302 | <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
1303 | for details about slice units.</para> | |
1304 | ||
1305 | <variablelist> | |
1306 | <varlistentry> | |
1307 | <term><filename>-.slice</filename></term> | |
1308 | <listitem> | |
e8fd5554 LP |
1309 | <para>The root slice is the root of the slice hierarchy. It usually does not contain units |
1310 | directly, but may be used to set defaults for the whole tree.</para> | |
aefdc112 AK |
1311 | |
1312 | <xi:include href="version-info.xml" xpointer="v206"/> | |
96719f15 ZJS |
1313 | </listitem> |
1314 | </varlistentry> | |
1315 | ||
1316 | <varlistentry> | |
e8fd5554 | 1317 | <term><filename>machine.slice</filename></term> |
96719f15 | 1318 | <listitem> |
e8fd5554 LP |
1319 | <para>By default, all virtual machines and containers registered with |
1320 | <command>systemd-machined</command> are found in this slice. This is pulled in by | |
1321 | <filename>systemd-machined.service</filename>.</para> | |
aefdc112 AK |
1322 | |
1323 | <xi:include href="version-info.xml" xpointer="v206"/> | |
96719f15 ZJS |
1324 | </listitem> |
1325 | </varlistentry> | |
1326 | ||
1327 | <varlistentry> | |
e8fd5554 | 1328 | <term><filename>capsule.slice</filename></term> |
96719f15 | 1329 | <listitem> |
e8fd5554 LP |
1330 | <para>By default, all capsules encapsulated in <filename>capsule@.service</filename> are found in |
1331 | this slice.</para> | |
1332 | ||
1333 | <xi:include href="version-info.xml" xpointer="v255"/> | |
1334 | </listitem> | |
1335 | </varlistentry> | |
1336 | ||
1337 | <varlistentry> | |
1338 | <term><filename>system.slice</filename></term> | |
1339 | <listitem> | |
1340 | <para>By default, all system services started by <command>systemd</command> are found in this | |
1341 | slice.</para> | |
aefdc112 AK |
1342 | |
1343 | <xi:include href="version-info.xml" xpointer="v206"/> | |
96719f15 ZJS |
1344 | </listitem> |
1345 | </varlistentry> | |
1346 | ||
1347 | <varlistentry> | |
e8fd5554 | 1348 | <term><filename>user.slice</filename></term> |
96719f15 | 1349 | <listitem> |
e8fd5554 LP |
1350 | <para>By default, all user processes and services started on |
1351 | behalf of the user, including the per-user systemd instance | |
1352 | are found in this slice. This is pulled in by | |
1353 | <filename>systemd-logind.service</filename>.</para> | |
aefdc112 AK |
1354 | |
1355 | <xi:include href="version-info.xml" xpointer="v206"/> | |
96719f15 ZJS |
1356 | </listitem> |
1357 | </varlistentry> | |
e8fd5554 | 1358 | |
96719f15 ZJS |
1359 | </variablelist> |
1360 | </refsect2> | |
c92fcc4f MP |
1361 | </refsect1> |
1362 | ||
798d3a52 | 1363 | <refsect1> |
bb288a2c | 1364 | <title>Units managed by the user service manager</title> |
96719f15 ZJS |
1365 | |
1366 | <refsect2> | |
1367 | <title>Special User Units</title> | |
1368 | ||
1369 | <para>When systemd runs as a user instance, the following special | |
827f62c3 ZJS |
1370 | units are available:</para> |
1371 | ||
1372 | <variablelist> | |
1373 | <varlistentry> | |
1374 | <term><filename>default.target</filename></term> | |
1375 | <listitem> | |
e8fd5554 LP |
1376 | <para>This is the main target of the user service manager, started by default when the service |
1377 | manager is invoked. Various services that compose the normal user session should be pulled into | |
1378 | this target. In this regard, <filename>default.target</filename> is similar to | |
1379 | <filename>multi-user.target</filename> in the system instance, but it is a real unit, not an | |
1380 | alias.</para> | |
aefdc112 AK |
1381 | |
1382 | <xi:include href="version-info.xml" xpointer="v242"/> | |
827f62c3 ZJS |
1383 | </listitem> |
1384 | </varlistentry> | |
1385 | </variablelist> | |
1386 | ||
e8fd5554 LP |
1387 | <variablelist> |
1388 | <varlistentry> | |
1389 | <term><filename>capsule@.target</filename></term> | |
1390 | <listitem> | |
1391 | <para>This is the main target of capsule service managers, started by default, instantiated with | |
1392 | the capsule name. This may be used to define different sets of units that are started for | |
1393 | different capsules via generic unit definitions. For details about capsules see | |
1394 | <citerefentry><refentrytitle>capsule@.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para> | |
1395 | ||
1396 | <xi:include href="version-info.xml" xpointer="v255"/> | |
1397 | </listitem> | |
1398 | </varlistentry> | |
1399 | </variablelist> | |
1400 | ||
827f62c3 | 1401 | <para>In addition, the following units are available which have definitions similar to their |
96719f15 ZJS |
1402 | system counterparts: |
1403 | <filename>exit.target</filename>, | |
96719f15 ZJS |
1404 | <filename>shutdown.target</filename>, |
1405 | <filename>sockets.target</filename>, | |
1406 | <filename>timers.target</filename>, | |
1407 | <filename>paths.target</filename>, | |
1408 | <filename>bluetooth.target</filename>, | |
1409 | <filename>printer.target</filename>, | |
1410 | <filename>smartcard.target</filename>, | |
1411 | <filename>sound.target</filename>.</para> | |
1412 | </refsect2> | |
1413 | ||
1414 | <refsect2> | |
1415 | <title>Special Passive User Units</title> | |
1416 | ||
1417 | <variablelist> | |
1418 | <varlistentry> | |
1419 | <term><filename>graphical-session.target</filename></term> | |
1420 | <listitem> | |
1421 | <para>This target is active whenever any graphical session is running. It is used to | |
1422 | stop user services which only apply to a graphical (X, Wayland, etc.) session when the | |
1423 | session is terminated. Such services should have | |
bdac5608 | 1424 | <literal>PartOf=graphical-session.target</literal> in their [Unit] |
96719f15 ZJS |
1425 | section. A target for a particular session (e. g. |
1426 | <filename>gnome-session.target</filename>) starts and stops | |
1427 | <literal>graphical-session.target</literal> with | |
1428 | <literal>BindsTo=graphical-session.target</literal>.</para> | |
1429 | ||
1430 | <para>Which services are started by a session target is determined by the | |
1431 | <literal>Wants=</literal> and <literal>Requires=</literal> dependencies. For services | |
1432 | that can be enabled independently, symlinks in <literal>.wants/</literal> and | |
1433 | <literal>.requires/</literal> should be used, see | |
1434 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
1435 | Those symlinks should either be shipped in packages, or should be added dynamically | |
1436 | after installation, for example using <literal>systemctl add-wants</literal>, see | |
1437 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. | |
1438 | </para> | |
1439 | ||
1440 | <example> | |
1441 | <title>Nautilus as part of a GNOME session</title> | |
1442 | ||
1443 | <para><literal>gnome-session.target</literal> pulls in Nautilus as top-level service:</para> | |
1444 | ||
1445 | <programlisting>[Unit] | |
8b596d51 LP |
1446 | Description=User systemd services for GNOME graphical session |
1447 | Wants=nautilus.service | |
1448 | BindsTo=graphical-session.target</programlisting> | |
96719f15 ZJS |
1449 | |
1450 | <para><literal>nautilus.service</literal> gets stopped when the session stops:</para> | |
1451 | ||
1452 | <programlisting>[Unit] | |
8b596d51 LP |
1453 | Description=Render the desktop icons with Nautilus |
1454 | PartOf=graphical-session.target | |
96719f15 | 1455 | |
8b596d51 LP |
1456 | [Service] |
1457 | …</programlisting> | |
96719f15 | 1458 | </example> |
aefdc112 AK |
1459 | |
1460 | <xi:include href="version-info.xml" xpointer="v234"/> | |
96719f15 ZJS |
1461 | </listitem> |
1462 | </varlistentry> | |
1463 | ||
1464 | <varlistentry> | |
1465 | <term><filename>graphical-session-pre.target</filename></term> | |
1466 | <listitem> | |
1467 | <para>This target contains services which set up the environment or global configuration | |
1468 | of a graphical session, such as SSH/GPG agents (which need to export an environment | |
1469 | variable into all desktop processes) or migration of obsolete d-conf keys after an OS | |
1470 | upgrade (which needs to happen before starting any process that might use them). This | |
1471 | target must be started before starting a graphical session like | |
1472 | <filename>gnome-session.target</filename>.</para> | |
aefdc112 AK |
1473 | |
1474 | <xi:include href="version-info.xml" xpointer="v234"/> | |
96719f15 ZJS |
1475 | </listitem> |
1476 | </varlistentry> | |
8feca247 BB |
1477 | |
1478 | <varlistentry> | |
1479 | <term><filename>xdg-desktop-autostart.target</filename></term> | |
1480 | <listitem> | |
1481 | <para>The XDG specification defines a way to autostart applications using XDG desktop files. | |
4540e698 BB |
1482 | systemd ships |
1483 | <citerefentry><refentrytitle>systemd-xdg-autostart-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
75909cc7 ZJS |
1484 | for the XDG desktop files in autostart directories. Desktop Environments can opt-in to use this |
1485 | service by adding a <varname>Wants=</varname> dependency on | |
1486 | <filename>xdg-desktop-autostart.target</filename>.</para> | |
ec07c3c8 AK |
1487 | |
1488 | <xi:include href="version-info.xml" xpointer="v246"/> | |
8feca247 BB |
1489 | </listitem> |
1490 | </varlistentry> | |
96719f15 ZJS |
1491 | </variablelist> |
1492 | </refsect2> | |
0f7793be BB |
1493 | |
1494 | <refsect2> | |
1495 | <title>Special User Slice Units</title> | |
1496 | ||
1497 | <para>There are four <literal>.slice</literal> units which form the basis of the user hierarchy for | |
1498 | assignment of resources for user applications and services. See | |
1499 | <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>7</manvolnum></citerefentry> | |
1500 | for details about slice units and the documentation about | |
1501 | <ulink url="https://systemd.io/DESKTOP_ENVIRONMENTS">Desktop Environments</ulink> | |
1502 | for further information.</para> | |
1503 | ||
1504 | <variablelist> | |
1505 | <varlistentry> | |
1506 | <term><filename>-.slice</filename></term> | |
1507 | <listitem> | |
1508 | <para>The root slice is the root of the user's slice hierarchy. | |
1509 | It usually does not contain units directly, but may be used to set defaults for the whole tree.</para> | |
ec07c3c8 AK |
1510 | |
1511 | <xi:include href="version-info.xml" xpointer="v247"/> | |
0f7793be BB |
1512 | </listitem> |
1513 | </varlistentry> | |
1514 | ||
1515 | <varlistentry> | |
1516 | <term><filename>app.slice</filename></term> | |
1517 | <listitem> | |
1518 | <para>By default, all user services and applications managed by | |
1519 | <command>systemd</command> are found in this slice. | |
1520 | All interactively launched applications like web browsers and text editors | |
1521 | as well as non-critical services should be placed into this slice.</para> | |
ec07c3c8 AK |
1522 | |
1523 | <xi:include href="version-info.xml" xpointer="v247"/> | |
0f7793be BB |
1524 | </listitem> |
1525 | </varlistentry> | |
1526 | ||
1527 | <varlistentry> | |
1528 | <term><filename>session.slice</filename></term> | |
1529 | <listitem> | |
1530 | <para>All essential services and applications required for the | |
1531 | session should use this slice. | |
1532 | These are services that either cannot be restarted easily | |
1533 | or where latency issues may affect the interactivity of the system and applications. | |
1534 | This includes the display server, screen readers and other services such as DBus or XDG portals. | |
1535 | Such services should be configured to be part of this slice by | |
1536 | adding <varname>Slice=session.slice</varname> to their unit files.</para> | |
ec07c3c8 AK |
1537 | |
1538 | <xi:include href="version-info.xml" xpointer="v247"/> | |
0f7793be BB |
1539 | </listitem> |
1540 | </varlistentry> | |
1541 | ||
1542 | <varlistentry> | |
1543 | <term><filename>background.slice</filename></term> | |
1544 | <listitem> | |
1545 | <para>All services running low-priority background tasks should use this slice. | |
1546 | This permits resources to be preferentially assigned to the other slices. | |
1547 | Examples include non-interactive tasks like file indexing or backup operations | |
1548 | where latency is not important.</para> | |
ec07c3c8 AK |
1549 | |
1550 | <xi:include href="version-info.xml" xpointer="v247"/> | |
0f7793be BB |
1551 | </listitem> |
1552 | </varlistentry> | |
1553 | </variablelist> | |
1554 | </refsect2> | |
798d3a52 ZJS |
1555 | </refsect1> |
1556 | ||
1557 | <refsect1> | |
1558 | <title>See Also</title> | |
13a69c12 DT |
1559 | <para><simplelist type="inline"> |
1560 | <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> | |
1561 | <member><citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
1562 | <member><citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
1563 | <member><citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
1564 | <member><citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
1565 | <member><citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
1566 | <member><citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry></member> | |
1567 | <member><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> | |
1568 | <member><citerefentry><refentrytitle>user@.service</refentrytitle><manvolnum>5</manvolnum></citerefentry></member> | |
1569 | </simplelist></para> | |
798d3a52 | 1570 | </refsect1> |
9f235308 LP |
1571 | |
1572 | </refentry> |