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