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