Debian Codegraph @

upstream/mageia-cauldron/man5/systemd.unit.5

raw
1 '\" t
2 .TH "SYSTEMD\&.UNIT" "5" "" "systemd 258.7" "systemd.unit"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.unit \- Unit configuration
24 .SH "SYNOPSIS"
25 .PP
26 \fIservice\fR\&.service, \fIsocket\fR\&.socket, \fIdevice\fR\&.device, \fImount\fR\&.mount, \fIautomount\fR\&.automount, \fIswap\fR\&.swap, \fItarget\fR\&.target, \fIpath\fR\&.path, \fItimer\fR\&.timer, \fIslice\fR\&.slice, \fIscope\fR\&.scope
27 .SS "System Unit Search Path"
28 .PP
29 .RS 4
30 /etc/systemd/system\&.control/*
31 .RE
32 .RS 4
33 /run/systemd/system\&.control/*
34 .RE
35 .RS 4
36 /run/systemd/transient/*
37 .RE
38 .RS 4
39 /run/systemd/generator\&.early/*
40 .RE
41 .RS 4
42 /etc/systemd/system/*
43 .RE
44 .RS 4
45 /etc/systemd/system\&.attached/*
46 .RE
47 .RS 4
48 /run/systemd/system/*
49 .RE
50 .RS 4
51 /run/systemd/system\&.attached/*
52 .RE
53 .RS 4
54 /run/systemd/generator/*
55 .RE
56 .RS 4
57 \&...
58 .RE
59 .RS 4
60 /usr/local/lib/systemd/system/*
61 .RE
62 .RS 4
63 /usr/lib/systemd/system/*
64 .RE
65 .RS 4
66 /run/systemd/generator\&.late/*
67 .RE
68 .SS "User Unit Search Path"
69 .PP
70 .RS 4
71 ~/\&.config/systemd/user\&.control/*
72 .RE
73 .RS 4
74 $XDG_RUNTIME_DIR/systemd/user\&.control/*
75 .RE
76 .RS 4
77 $XDG_RUNTIME_DIR/systemd/transient/*
78 .RE
79 .RS 4
80 $XDG_RUNTIME_DIR/systemd/generator\&.early/*
81 .RE
82 .RS 4
83 ~/\&.config/systemd/user/*
84 .RE
85 .RS 4
86 $XDG_CONFIG_DIRS/systemd/user/*
87 .RE
88 .RS 4
89 /etc/systemd/user/*
90 .RE
91 .RS 4
92 $XDG_RUNTIME_DIR/systemd/user/*
93 .RE
94 .RS 4
95 /run/systemd/user/*
96 .RE
97 .RS 4
98 $XDG_RUNTIME_DIR/systemd/generator/*
99 .RE
100 .RS 4
101 $XDG_DATA_HOME/systemd/user/*
102 .RE
103 .RS 4
104 $XDG_DATA_DIRS/systemd/user/*
105 .RE
106 .RS 4
107 \&...
108 .RE
109 .RS 4
110 /usr/local/lib/systemd/user/*
111 .RE
112 .RS 4
113 /usr/lib/systemd/user/*
114 .RE
115 .RS 4
116 $XDG_RUNTIME_DIR/systemd/generator\&.late/*
117 .RE
118 .SH "DESCRIPTION"
119 .PP
120 A unit file is a plain text ini\-style file that encodes information about a service, a socket, a device, a mount point, an automount point, a swap file or partition, a start\-up target, a watched file system path, a timer controlled and supervised by
121 \fBsystemd\fR(1), a resource management slice or a group of externally created processes\&. See
122 \fBsystemd.syntax\fR(7)
123 for a general description of the syntax\&.
124 .PP
125 This man page lists the common configuration options of all the unit types\&. These options need to be configured in the [Unit] or [Install] sections of the unit files\&.
126 .PP
127 In addition to the generic [Unit] and [Install] sections described here, each unit may have a type\-specific section, e\&.g\&. [Service] for a service unit\&. See the respective man pages for more information:
128 \fBsystemd.service\fR(5),
129 \fBsystemd.socket\fR(5),
130 \fBsystemd.device\fR(5),
131 \fBsystemd.mount\fR(5),
132 \fBsystemd.automount\fR(5),
133 \fBsystemd.swap\fR(5),
134 \fBsystemd.target\fR(5),
135 \fBsystemd.path\fR(5),
136 \fBsystemd.timer\fR(5),
137 \fBsystemd.slice\fR(5),
138 \fBsystemd.scope\fR(5)\&.
139 .PP
140 Unit files are loaded from a set of paths determined during compilation, described in the next section\&.
141 .PP
142 Valid unit names consist of a "unit name prefix", and a suffix specifying the unit type which begins with a dot\&. The "unit name prefix" must consist of one or more valid characters (ASCII letters, digits,
143 ":",
144 "\-",
145 "_",
146 "\&.", and
147 "\e")\&. The total length of the unit name including the suffix must not exceed 255 characters\&. The unit type suffix must be one of
148 "\&.service",
149 "\&.socket",
150 "\&.device",
151 "\&.mount",
152 "\&.automount",
153 "\&.swap",
154 "\&.target",
155 "\&.path",
156 "\&.timer",
157 "\&.slice", or
158 "\&.scope"\&.
159 .PP
160 Unit names can be parameterized by a single argument called the "instance name"\&. The unit is then constructed based on a "template file" which serves as the definition of multiple services or other units\&. A template unit must have a single
161 "@"
162 at the end of the unit name prefix (right before the type suffix)\&. The name of the full unit is formed by inserting the instance name between
163 "@"
164 and the unit type suffix\&. In the unit file itself, the instance parameter may be referred to using
165 "%i"
166 and other specifiers, see below\&.
167 .PP
168 Unit files may contain additional options on top of those listed here\&. If systemd encounters an unknown option, it will write a warning log message but continue loading the unit\&. If an option or section name is prefixed with
169 \fBX\-\fR, it is ignored completely by systemd\&. Options within an ignored section do not need the prefix\&. Applications may use this to include additional information in the unit files\&. To access those options, applications need to parse the unit files on their own\&.
170 .PP
171 Units can be aliased (have an alternative name), by creating a symlink from the new name to the existing name in one of the unit search paths\&. For example,
172 systemd\-networkd\&.service
173 has the alias
174 dbus\-org\&.freedesktop\&.network1\&.service, created during installation as a symlink, so when
175 \fBsystemd\fR
176 is asked through D\-Bus to load
177 dbus\-org\&.freedesktop\&.network1\&.service, it\*(Aqll load
178 systemd\-networkd\&.service\&. As another example,
179 default\&.target
180 \(em the default system target started at boot \(em is commonly aliased to either
181 multi\-user\&.target
182 or
183 graphical\&.target
184 to select what is started by default\&. Alias names may be used in commands like
185 \fBdisable\fR,
186 \fBstart\fR,
187 \fBstop\fR,
188 \fBstatus\fR, and similar, and in all unit dependency directives, including
189 \fIWants=\fR,
190 \fIRequires=\fR,
191 \fIBefore=\fR,
192 \fIAfter=\fR\&. Aliases cannot be used with the
193 \fBpreset\fR
194 command\&.
195 .PP
196 Aliases obey the following restrictions: a unit of a certain type ("\&.service",
197 "\&.socket", \&...) can only be aliased by a name with the same type suffix\&. A plain unit (not a template or an instance), may only be aliased by a plain name\&. A template instance may only be aliased by another template instance, and the instance part must be identical\&. A template may be aliased by another template (in which case the alias applies to all instances of the template)\&. As a special case, a template instance (e\&.g\&.
198 "alias@inst\&.service") may be a symlink to different template (e\&.g\&.
199 "template@inst\&.service")\&. In that case, just this specific instance is aliased, while other instances of the template (e\&.g\&.
200 "alias@foo\&.service",
201 "alias@bar\&.service") are not aliased\&. Those rules preserve the requirement that the instance (if any) is always uniquely defined for a given unit and all its aliases\&. The target of alias symlink must point to a valid unit file location, i\&.e\&. the symlink target name must match the symlink source name as described, and the destination path must be in one of the unit search paths, see UNIT FILE LOAD PATH section below for more details\&. Note that the target file might not exist, i\&.e\&. the symlink may be dangling\&.
202 .PP
203 Unit files may specify aliases through the
204 \fIAlias=\fR
205 directive in the [Install] section\&. When the unit is enabled, symlinks will be created for those names, and removed when the unit is disabled\&. For example,
206 reboot\&.target
207 specifies
208 \fIAlias=ctrl\-alt\-del\&.target\fR, so when enabled, the symlink
209 /etc/systemd/system/ctrl\-alt\-del\&.target
210 pointing to the
211 reboot\&.target
212 file will be created, and when
213 Ctrl+Alt+Del
214 is invoked,
215 \fBsystemd\fR
216 will look for
217 ctrl\-alt\-del\&.target, follow the symlink to
218 reboot\&.target, and execute
219 reboot\&.service
220 as part of that target\&.
221 \fBsystemd\fR
222 does not look at the [Install] section at all during normal operation, so any directives in that section only have an effect through the symlinks created during enablement\&.
223 .PP
224 Along with a unit file
225 foo\&.service, the directory
226 foo\&.service\&.wants/
227 may exist\&. All unit files symlinked from such a directory are implicitly added as dependencies of type
228 \fIWants=\fR
229 to the unit\&. Similar functionality exists for
230 \fIRequires=\fR
231 type dependencies as well, the directory suffix is
232 \&.requires/
233 in this case\&. This functionality is useful to hook units into the start\-up of other units, without having to modify their unit files\&. For details about the semantics of
234 \fIWants=\fR
235 and
236 \fIRequires=\fR, see below\&. The preferred way to create symlinks in the
237 \&.wants/
238 or
239 \&.requires/
240 directories is by specifying the dependency in [Install] section of the target unit, and creating the symlink in the file system with the
241 \fBenable\fR
242 or
243 \fBpreset\fR
244 commands of
245 \fBsystemctl\fR(1)\&. The target can be a normal unit (either plain or a specific instance of a template unit)\&. In case when the source unit is a template, the target can also be a template, in which case the instance will be "propagated" to the target unit to form a valid unit instance\&. The target of symlinks in
246 \&.wants/
247 or
248 \&.requires/
249 must thus point to a valid unit file location, i\&.e\&. the symlink target name must satisfy the described requirements, and the destination path must be in one of the unit search paths, see UNIT FILE LOAD PATH section below for more details\&. Note that the target file might not exist, i\&.e\&. the symlink may be dangling\&.
250 .PP
251 Along with a unit file
252 foo\&.service, a "drop\-in" directory
253 foo\&.service\&.d/
254 may exist\&. All files with the suffix
255 "\&.conf"
256 from this directory will be merged in the alphanumeric order and parsed after the main unit file itself has been parsed\&. This is useful to alter or add configuration settings for a unit, without having to modify unit files\&. Each drop\-in file must contain appropriate section headers\&. For instantiated units, this logic will first look for the instance
257 "\&.d/"
258 subdirectory (e\&.g\&.
259 "foo@bar\&.service\&.d/") and read its
260 "\&.conf"
261 files, followed by the template
262 "\&.d/"
263 subdirectory (e\&.g\&.
264 "foo@\&.service\&.d/") and the
265 "\&.conf"
266 files there\&. Moreover, for unit names containing dashes ("\-"), the set of directories generated by repeatedly truncating the unit name after all dashes is searched too\&. Specifically, for a unit name
267 foo\-bar\-baz\&.service
268 not only the regular drop\-in directory
269 foo\-bar\-baz\&.service\&.d/
270 is searched but also both
271 foo\-bar\-\&.service\&.d/
272 and
273 foo\-\&.service\&.d/\&. This is useful for defining common drop\-ins for a set of related units, whose names begin with a common prefix\&. This scheme is particularly useful for mount, automount and slice units, whose systematic naming structure is built around dashes as component separators\&. Note that equally named drop\-in files further down the prefix hierarchy override those further up, i\&.e\&.
274 foo\-bar\-\&.service\&.d/10\-override\&.conf
275 overrides
276 foo\-\&.service\&.d/10\-override\&.conf\&.
277 .PP
278 In cases of unit aliases (described above), dropins for the aliased name and all aliases are loaded\&. In the example of
279 default\&.target
280 aliasing
281 graphical\&.target,
282 default\&.target\&.d/,
283 default\&.target\&.wants/,
284 default\&.target\&.requires/,
285 graphical\&.target\&.d/,
286 graphical\&.target\&.wants/,
287 graphical\&.target\&.requires/
288 would all be read\&. For templates, dropins for the template, any template aliases, the template instance, and all alias instances are read\&. When just a specific template instance is aliased, then the dropins for the target template, the target template instance, and the alias template instance are read\&.
289 .PP
290 In addition to
291 /etc/systemd/system, the drop\-in
292 "\&.d/"
293 directories for system services can be placed in
294 /usr/lib/systemd/system
295 or
296 /run/systemd/system
297 directories\&. Drop\-in files in
298 /etc/
299 take precedence over those in
300 /run/
301 which in turn take precedence over those in
302 /usr/lib/\&. Drop\-in files under any of these directories take precedence over unit files wherever located\&. Multiple drop\-in files with different names are applied in lexicographic order, regardless of which of the directories they reside in\&.
303 .PP
304 Units also support a top\-level drop\-in with
305 \fItype\fR\&.d/, where
306 \fItype\fR
307 may be e\&.g\&.
308 "service"
309 or
310 "socket", that allows altering or adding to the settings of all corresponding unit files on the system\&. The formatting and precedence of applying drop\-in configurations follow what is defined above\&. Files in
311 \fItype\fR\&.d/
312 have lower precedence compared to files in name\-specific override directories\&. The usual rules apply: multiple drop\-in files with different names are applied in lexicographic order, regardless of which of the directories they reside in, so a file in
313 \fItype\fR\&.d/
314 applies to a unit only if there are no drop\-ins or masks with that name in directories with higher precedence\&. See Examples\&.
315 .PP
316 Note that while systemd offers a flexible dependency system between units it is recommended to use this functionality only sparingly and instead rely on techniques such as bus\-based or socket\-based activation which make dependencies implicit, resulting in a both simpler and more flexible system\&.
317 .PP
318 As mentioned above, a unit may be instantiated from a template file\&. This allows creation of multiple units from a single configuration file\&. If systemd looks for a unit configuration file, it will first search for the literal unit name in the file system\&. If that yields no success and the unit name contains an
319 "@"
320 character, systemd will look for a unit template that shares the same name but with the instance string (i\&.e\&. the part between the
321 "@"
322 character and the suffix) removed\&. Example: if a service
323 getty@tty3\&.service
324 is requested and no file by that name is found, systemd will look for
325 getty@\&.service
326 and instantiate a service from that configuration file if it is found\&.
327 .PP
328 To refer to the instance string from within the configuration file you may use the special
329 "%i"
330 specifier in many of the configuration options\&. See below for details\&.
331 .PP
332 If a unit file is empty (i\&.e\&. has the file size 0) or is symlinked to
333 /dev/null, its configuration will not be loaded and it appears with a load state of
334 "masked", and cannot be activated\&. Use this as an effective way to fully disable a unit, making it impossible to start it even manually\&.
335 .PP
336 The unit file format is covered by the
337 \m[blue]\fBInterface Portability and Stability Promise\fR\m[]\&\s-2\u[1]\d\s+2\&.
338 .SH "STRING ESCAPING FOR INCLUSION IN UNIT NAMES"
339 .PP
340 Sometimes it is useful to convert arbitrary strings into unit names\&. To facilitate this, a method of string escaping is used, in order to map strings containing arbitrary byte values (except
341 \fBNUL\fR) into valid unit names and their restricted character set\&. A common special case are unit names that reflect paths to objects in the file system hierarchy\&. Example: a device unit
342 dev\-sda\&.device
343 refers to a device with the device node
344 /dev/sda
345 in the file system\&.
346 .PP
347 The escaping algorithm operates as follows: given a string, any
348 "/"
349 character is replaced by
350 "\-", and all other characters which are not ASCII alphanumerics,
351 ":",
352 "_"
353 or
354 "\&."
355 are replaced by C\-style
356 "\ex2d"
357 escapes\&. In addition,
358 "\&."
359 is replaced with such a C\-style escape when it would appear as the first character in the escaped string\&.
360 .PP
361 When the input qualifies as absolute file system path, this algorithm is extended slightly: the path to the root directory
362 "/"
363 is encoded as single dash
364 "\-"\&. In addition, any leading, trailing or duplicate
365 "/"
366 characters are removed from the string before transformation\&. Example:
367 /foo//bar/baz/
368 becomes
369 "foo\-bar\-baz"\&.
370 .PP
371 This escaping is fully reversible, as long as it is known whether the escaped string was a path (the unescaping results are different for paths and non\-path strings)\&. The
372 \fBsystemd-escape\fR(1)
373 command may be used to apply and reverse escaping on arbitrary strings\&. Use
374 \fBsystemd\-escape \-\-path\fR
375 to escape path strings, and
376 \fBsystemd\-escape\fR
377 without
378 \fB\-\-path\fR
379 otherwise\&.
380 .SH "AUTOMATIC DEPENDENCIES"
381 .SS "Implicit Dependencies"
382 .PP
383 A number of unit dependencies are implicitly established, depending on unit type and unit configuration\&. These implicit dependencies can make unit configuration file cleaner\&. For the implicit dependencies in each unit type, please refer to section "Implicit Dependencies" in respective man pages\&.
384 .PP
385 For example, service units with
386 \fIType=dbus\fR
387 automatically acquire dependencies of type
388 \fIRequires=\fR
389 and
390 \fIAfter=\fR
391 on
392 dbus\&.socket\&. See
393 \fBsystemd.service\fR(5)
394 for details\&.
395 .SS "Default Dependencies"
396 .PP
397 Default dependencies are similar to implicit dependencies, but can be turned on and off by setting
398 \fIDefaultDependencies=\fR
399 to
400 \fIyes\fR
401 (the default) and
402 \fIno\fR, while implicit dependencies are always in effect\&. See section "Default Dependencies" in respective man pages for the effect of enabling
403 \fIDefaultDependencies=\fR
404 in each unit types\&.
405 .PP
406 For example, target units will complement all configured dependencies of type
407 \fIWants=\fR
408 or
409 \fIRequires=\fR
410 with dependencies of type
411 \fIAfter=\fR\&. See
412 \fBsystemd.target\fR(5)
413 for details\&. Note that this behavior can be opted out by setting
414 \fIDefaultDependencies=no\fR
415 in the specified units, or it can be selectively overridden via an explicit
416 \fIBefore=\fR
417 dependency\&.
418 .SH "UNIT FILE LOAD PATH"
419 .PP
420 Unit files are loaded from a set of paths determined during compilation, described in the two tables below\&. Unit files found in directories listed earlier override files with the same name in directories lower in the list
421 \&\s-2\u[2]\d\s+2\&.
422 .PP
423 When the variable
424 \fI$SYSTEMD_UNIT_PATH\fR
425 is set, the contents of this variable overrides the unit load path\&. If
426 \fI$SYSTEMD_UNIT_PATH\fR
427 ends with an empty component (":"), the usual unit load path will be appended to the contents of the variable\&.
428 .sp
429 .it 1 an-trap
430 .nr an-no-space-flag 1
431 .nr an-break-flag 1
432 .br
433 .B Table\ \&1.\ \& Load path when running in system mode (\-\-system)\&.
434 .TS
435 allbox tab(:);
436 lB lB.
437 T{
438 Path
439 T}:T{
440 Description
441 T}
442 .T&
443 l l
444 l ^
445 l l
446 l l
447 l l
448 l l
449 l l
450 l l
451 l l
452 l l.
453 T{
454 /etc/systemd/system\&.control
455 T}:T{
456 Persistent and transient configuration created using the dbus API
457 T}
458 T{
459 /run/systemd/system\&.control
460 T}:
461 T{
462 /run/systemd/transient
463 T}:T{
464 Dynamic configuration for transient units
465 T}
466 T{
467 /run/systemd/generator\&.early
468 T}:T{
469 Generated units with high priority (see \fIearly\-dir\fR in \fBsystemd.generator\fR(7))
470 T}
471 T{
472 /etc/systemd/system
473 T}:T{
474 System units created by the administrator
475 T}
476 T{
477 /run/systemd/system
478 T}:T{
479 Runtime units
480 T}
481 T{
482 /run/systemd/generator
483 T}:T{
484 Generated units with medium priority (see \fInormal\-dir\fR in \fBsystemd.generator\fR(7))
485 T}
486 T{
487 /usr/local/lib/systemd/system
488 T}:T{
489 System units installed by the administrator
490 T}
491 T{
492 /usr/lib/systemd/system
493 T}:T{
494 System units installed by the distribution package manager
495 T}
496 T{
497 /run/systemd/generator\&.late
498 T}:T{
499 Generated units with low priority (see \fIlate\-dir\fR in \fBsystemd.generator\fR(7))
500 T}
501 .TE
502 .sp 1
503 .sp
504 .it 1 an-trap
505 .nr an-no-space-flag 1
506 .nr an-break-flag 1
507 .br
508 .B Table\ \&2.\ \& Load path when running in user mode (\-\-user)\&.
509 .TS
510 allbox tab(:);
511 lB lB.
512 T{
513 Path
514 T}:T{
515 Description
516 T}
517 .T&
518 l l
519 l ^
520 l l
521 l l
522 l l
523 l l
524 l l
525 l l
526 l l
527 l l
528 l l
529 l l
530 l l
531 l l
532 l l
533 l l.
534 T{
535 $XDG_CONFIG_HOME/systemd/user\&.control or ~/\&.config/systemd/user\&.control
536 T}:T{
537 Persistent and transient configuration created using the dbus API (\fI$XDG_CONFIG_HOME\fR is used if set, ~/\&.config otherwise)
538 T}
539 T{
540 $XDG_RUNTIME_DIR/systemd/user\&.control
541 T}:
542 T{
543 $XDG_RUNTIME_DIR/systemd/transient
544 T}:T{
545 Dynamic configuration for transient units
546 T}
547 T{
548 $XDG_RUNTIME_DIR/systemd/generator\&.early
549 T}:T{
550 Generated units with high priority (see \fIearly\-dir\fR in \fBsystemd.generator\fR(7))
551 T}
552 T{
553 $XDG_CONFIG_HOME/systemd/user or $HOME/\&.config/systemd/user
554 T}:T{
555 User configuration (\fI$XDG_CONFIG_HOME\fR is used if set, ~/\&.config otherwise)
556 T}
557 T{
558 $XDG_CONFIG_DIRS/systemd/user or /etc/xdg/systemd/user
559 T}:T{
560 Additional configuration directories as specified by the XDG base directory specification (\fI$XDG_CONFIG_DIRS\fR is used if set, /etc/xdg otherwise)
561 T}
562 T{
563 /etc/systemd/user
564 T}:T{
565 User units created by the administrator
566 T}
567 T{
568 $XDG_RUNTIME_DIR/systemd/user
569 T}:T{
570 Runtime units (only used when $XDG_RUNTIME_DIR is set)
571 T}
572 T{
573 /run/systemd/user
574 T}:T{
575 Runtime units
576 T}
577 T{
578 $XDG_RUNTIME_DIR/systemd/generator
579 T}:T{
580 Generated units with medium priority (see \fInormal\-dir\fR in \fBsystemd.generator\fR(7))
581 T}
582 T{
583 $XDG_DATA_HOME/systemd/user or $HOME/\&.local/share/systemd/user
584 T}:T{
585 Units of packages that have been installed in the home directory (\fI$XDG_DATA_HOME\fR is used if set, ~/\&.local/share otherwise)
586 T}
587 T{
588 $XDG_DATA_DIRS/systemd/user or /usr/local/share/systemd/user and /usr/share/systemd/user
589 T}:T{
590 Additional data directories as specified by the XDG base directory specification (\fI$XDG_DATA_DIRS\fR is used if set, /usr/local/share and /usr/share otherwise)
591 T}
592 T{
593 $dir/systemd/user for each \fI$dir\fR in \fI$XDG_DATA_DIRS\fR
594 T}:T{
595 Additional locations for installed user units, one for each entry in \fI$XDG_DATA_DIRS\fR
596 T}
597 T{
598 /usr/local/lib/systemd/user
599 T}:T{
600 User units installed by the administrator
601 T}
602 T{
603 /usr/lib/systemd/user
604 T}:T{
605 User units installed by the distribution package manager
606 T}
607 T{
608 $XDG_RUNTIME_DIR/systemd/generator\&.late
609 T}:T{
610 Generated units with low priority (see \fIlate\-dir\fR in \fBsystemd.generator\fR(7))
611 T}
612 .TE
613 .sp 1
614 .PP
615 The set of load paths for the user manager instance may be augmented or changed using various environment variables\&. And environment variables may in turn be set using environment generators, see
616 \fBsystemd.environment-generator\fR(7)\&. In particular,
617 \fI$XDG_DATA_HOME\fR
618 and
619 \fI$XDG_DATA_DIRS\fR
620 may be easily set using
621 \fBsystemd-environment-d-generator\fR(8)\&. Thus, directories listed here are just the defaults\&. To see the actual list that would be used based on compilation options and current environment use
622 .sp
623 .if n \{\
624 .RS 4
625 .\}
626 .nf
627 systemd\-analyze \-\-user unit\-paths
628 .fi
629 .if n \{\
630 .RE
631 .\}
632 .PP
633 Moreover, additional units might be loaded into systemd from directories not on the unit load path by creating a symlink pointing to a unit file in the directories\&. You can use
634 \fBsystemctl link\fR
635 for this; see
636 \fBsystemctl\fR(1)\&. The file system where the linked unit files are located must be accessible when systemd is started (e\&.g\&. anything underneath
637 /home/
638 or
639 /var/
640 is not allowed, unless those directories are located on the root file system)\&.
641 .PP
642 It is important to distinguish "linked unit files" from "unit file aliases": any symlink where the symlink
643 \fItarget\fR
644 is within the unit load path becomes an alias: the source name and the target file name must satisfy specific constraints listed above in the discussion of aliases, but the symlink target does not have to exist, and in fact the symlink target path is not used, except to check whether the target is within the unit load path\&. In contrast, a symlink which goes outside of the unit load path signifies a linked unit file\&. The symlink is followed when loading the file, but the destination name is otherwise unused (and may even not be a valid unit file name)\&. For example, symlinks
645 /etc/systemd/system/alias1\&.service
646 โ†’
647 service1\&.service,
648 /etc/systemd/system/alias2\&.service
649 โ†’
650 /usr/lib/systemd/service1\&.service,
651 /etc/systemd/system/alias3\&.service
652 โ†’
653 /etc/systemd/system/service1\&.service
654 are all valid aliases and
655 service1\&.service
656 will have four names, even if the unit file is located at
657 /run/systemd/system/service1\&.service\&. In contrast, a symlink
658 /etc/systemd/system/link1\&.service
659 โ†’
660 \&.\&./link1_service_file
661 means that
662 link1\&.service
663 is a "linked unit" and the contents of
664 /etc/systemd/link1_service_file
665 provide its configuration\&.
666 .SH "UNIT GARBAGE COLLECTION"
667 .PP
668 The system and service manager loads a unit\*(Aqs configuration automatically when a unit is referenced for the first time\&. It will automatically unload the unit configuration and state again when the unit is not needed anymore ("garbage collection")\&. A unit may be referenced through a number of different mechanisms:
669 .sp
670 .RS 4
671 .ie n \{\
672 \h'-04' 1.\h'+01'\c
673 .\}
674 .el \{\
675 .sp -1
676 .IP " 1." 4.2
677 .\}
678 Another loaded unit references it with a dependency such as
679 \fIAfter=\fR,
680 \fIWants=\fR, \&...
681 .RE
682 .sp
683 .RS 4
684 .ie n \{\
685 \h'-04' 2.\h'+01'\c
686 .\}
687 .el \{\
688 .sp -1
689 .IP " 2." 4.2
690 .\}
691 The unit is currently starting, running, reloading or stopping\&.
692 .RE
693 .sp
694 .RS 4
695 .ie n \{\
696 \h'-04' 3.\h'+01'\c
697 .\}
698 .el \{\
699 .sp -1
700 .IP " 3." 4.2
701 .\}
702 The unit is currently in the
703 \fBfailed\fR
704 state\&. (But see below\&.)
705 .RE
706 .sp
707 .RS 4
708 .ie n \{\
709 \h'-04' 4.\h'+01'\c
710 .\}
711 .el \{\
712 .sp -1
713 .IP " 4." 4.2
714 .\}
715 A job for the unit is pending\&.
716 .RE
717 .sp
718 .RS 4
719 .ie n \{\
720 \h'-04' 5.\h'+01'\c
721 .\}
722 .el \{\
723 .sp -1
724 .IP " 5." 4.2
725 .\}
726 The unit is pinned by an active IPC client program\&.
727 .RE
728 .sp
729 .RS 4
730 .ie n \{\
731 \h'-04' 6.\h'+01'\c
732 .\}
733 .el \{\
734 .sp -1
735 .IP " 6." 4.2
736 .\}
737 The unit is a special "perpetual" unit that is always active and loaded\&. Examples for perpetual units are the root mount unit
738 \-\&.mount
739 or the scope unit
740 init\&.scope
741 that the service manager itself lives in\&.
742 .RE
743 .sp
744 .RS 4
745 .ie n \{\
746 \h'-04' 7.\h'+01'\c
747 .\}
748 .el \{\
749 .sp -1
750 .IP " 7." 4.2
751 .\}
752 The unit has running processes associated with it\&.
753 .RE
754 .PP
755 The garbage collection logic may be altered with the
756 \fICollectMode=\fR
757 option, which allows configuration whether automatic unloading of units that are in
758 \fBfailed\fR
759 state is permissible, see below\&.
760 .PP
761 Note that when a unit\*(Aqs configuration and state is unloaded, all execution results, such as exit codes, exit signals, resource consumption and other statistics are lost, except for what is stored in the log subsystem\&.
762 .PP
763 Use
764 \fBsystemctl daemon\-reload\fR
765 or an equivalent command to reload unit configuration while the unit is already loaded\&. In this case, all configuration settings are flushed out and replaced with the new configuration (which however might not be in effect immediately), however all runtime state is saved/restored\&.
766 .SH "[UNIT] SECTION OPTIONS"
767 .PP
768 The unit file may include a [Unit] section, which carries generic information about the unit that is not dependent on the type of unit:
769 .PP
770 \fIDescription=\fR
771 .RS 4
772 A brief, meaningful, human\-readable text identifying the unit\&. This may be used by
773 \fBsystemd\fR
774 (and suitable UIs) as a user\-visible label for the unit, so this string should identify the unit rather than just describe it, despite the name\&. This string also should not just repeat the unit name\&.
775 "Apache HTTP Server"
776 or
777 "Postfix Mail Server"
778 are good examples\&. Bad examples are
779 "high\-performance lightweight HTTP server"
780 (too generic) or
781 "Apache"
782 (meaningless for people who do not know the Apache HTTP server project, duplicates the unit name)\&.
783 \fBsystemd\fR
784 may use this string as a noun in status messages ("Starting \fIDescription\fR\&.\&.\&.",
785 "Started \fIDescription\fR\&.",
786 "Reached target \fIDescription\fR\&.",
787 "Failed to start \fIDescription\fR\&."), so it should be capitalized, and should not be a full sentence, or a phrase with a verb conjugated in the present continuous, or end in a full stop\&. Bad examples include
788 "exiting the container",
789 "updating the database once per day\&.", or
790 "OpenSSH server second instance daemon"\&.
791 .sp
792 Added in version 201\&.
793 .RE
794 .PP
795 \fIDocumentation=\fR
796 .RS 4
797 A space\-separated list of URIs referencing documentation for this unit or its configuration\&. Accepted are only URIs of the types
798 "http://",
799 "https://",
800 "file:",
801 "info:",
802 "man:"\&. For more information about the syntax of these URIs, see
803 \fBuri\fR(7)\&. The URIs should be listed in order of relevance, starting with the most relevant\&. It is a good idea to first reference documentation that explains what the unit\*(Aqs purpose is, followed by how it is configured, followed by any other related documentation\&. This option may be specified more than once, in which case the specified list of URIs is merged\&. If the empty string is assigned to this option, the list is reset and all prior assignments will have no effect\&.
804 .sp
805 Added in version 201\&.
806 .RE
807 .PP
808 \fIWants=\fR
809 .RS 4
810 Configures (weak) requirement dependencies on other units\&. This option may be specified more than once or multiple space\-separated units may be specified in one option in which case dependencies for all listed names will be created\&. Dependencies of this type may also be configured outside of the unit configuration file by adding a symlink to a
811 \&.wants/
812 directory accompanying the unit file\&. For details, see above\&.
813 .sp
814 Units listed in this option will be started if the configuring unit is\&. However, if the listed units fail to start or cannot be added to the transaction, this has no impact on the validity of the transaction as a whole, and this unit will still be started\&. This is the recommended way to hook the start\-up of one unit to the start\-up of another unit\&.
815 .sp
816 Note that requirement dependencies do not influence the order in which services are started or stopped\&. This has to be configured independently with the
817 \fIAfter=\fR
818 or
819 \fIBefore=\fR
820 options\&. If unit
821 foo\&.service
822 pulls in unit
823 bar\&.service
824 as configured with
825 \fIWants=\fR
826 and no ordering is configured with
827 \fIAfter=\fR
828 or
829 \fIBefore=\fR, then both units will be started simultaneously and without any delay between them if
830 foo\&.service
831 is activated\&.
832 .sp
833 Added in version 201\&.
834 .RE
835 .PP
836 \fIRequires=\fR
837 .RS 4
838 Similar to
839 \fIWants=\fR, but declares a stronger requirement dependency\&. Dependencies of this type may also be configured by adding a symlink to a
840 \&.requires/
841 directory accompanying the unit file\&.
842 .sp
843 If this unit gets activated, the units listed will be activated as well\&. If one of the other units fails to activate, and an ordering dependency
844 \fIAfter=\fR
845 on the failing unit is set, this unit will not be started\&. Besides, with or without specifying
846 \fIAfter=\fR, this unit will be stopped (or restarted) if one of the other units is explicitly stopped (or restarted)\&.
847 .sp
848 Often, it is a better choice to use
849 \fIWants=\fR
850 instead of
851 \fIRequires=\fR
852 in order to achieve a system that is more robust when dealing with failing services\&.
853 .sp
854 Note that this dependency type does not imply that the other unit always has to be in active state when this unit is running\&. Specifically: failing condition checks (such as
855 \fIConditionPathExists=\fR,
856 \fIConditionPathIsSymbolicLink=\fR, \&... \(em see below) do not cause the start job of a unit with a
857 \fIRequires=\fR
858 dependency on it to fail\&. Also, some unit types may deactivate on their own (for example, a service process may decide to exit cleanly, or a device may be unplugged by the user), which is not propagated to units having a
859 \fIRequires=\fR
860 dependency\&. Use the
861 \fIBindsTo=\fR
862 dependency type together with
863 \fIAfter=\fR
864 to ensure that a unit may never be in active state without a specific other unit also in active state (see below)\&.
865 .sp
866 Added in version 201\&.
867 .RE
868 .PP
869 \fIRequisite=\fR
870 .RS 4
871 Similar to
872 \fIRequires=\fR\&. However, if the units listed here are not started already, they will not be started and the starting of this unit will fail immediately\&.
873 \fIRequisite=\fR
874 does not imply an ordering dependency, even if both units are started in the same transaction\&. Hence this setting should usually be combined with
875 \fIAfter=\fR, to ensure this unit is not started before the other unit\&.
876 .sp
877 When
878 \fIRequisite=b\&.service\fR
879 is used on
880 a\&.service, this dependency will show as
881 \fIRequisiteOf=a\&.service\fR
882 in property listing of
883 b\&.service\&.
884 \fIRequisiteOf=\fR
885 dependency cannot be specified directly\&.
886 .sp
887 Added in version 201\&.
888 .RE
889 .PP
890 \fIBindsTo=\fR
891 .RS 4
892 Configures requirement dependencies, very similar in style to
893 \fIRequires=\fR\&. However, this dependency type is stronger: in addition to the effects of
894 \fIRequires=\fR, which already stops (or restarts) the configuring unit when a listed unit is explicitly stopped (or restarted), it also does so when a listed unit stops unexpectedly (which includes when it fails)\&. Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit might terminate on its own choice, the backing device of a device unit might be unplugged or the mount point of a mount unit might be unmounted without involvement of the system and service manager\&.
895 .sp
896 When used in conjunction with
897 \fIAfter=\fR
898 on the same unit the behaviour of
899 \fIBindsTo=\fR
900 is even stronger\&. In this case, the unit bound to strictly has to be in active state for this unit to also be in active state\&. This not only means a unit bound to another unit that suddenly enters inactive state, but also one that is bound to another unit that gets skipped due to an unmet condition check (such as
901 \fIConditionPathExists=\fR,
902 \fIConditionPathIsSymbolicLink=\fR, \&... \(em see below) will be stopped, should it be running\&. Hence, in many cases it is best to combine
903 \fIBindsTo=\fR
904 with
905 \fIAfter=\fR\&.
906 .sp
907 When
908 \fIBindsTo=b\&.service\fR
909 is used on
910 a\&.service, this dependency will show as
911 \fIBoundBy=a\&.service\fR
912 in property listing of
913 b\&.service\&.
914 \fIBoundBy=\fR
915 dependency cannot be specified directly\&.
916 .sp
917 Added in version 201\&.
918 .RE
919 .PP
920 \fIPartOf=\fR
921 .RS 4
922 Configures dependencies similar to
923 \fIRequires=\fR, but limited to stopping and restarting of units\&. When systemd stops or restarts the units listed here, the action is propagated to this unit\&. Note that this is a one\-way dependency\ \&\(em changes to this unit do not affect the listed units\&.
924 .sp
925 When
926 \fIPartOf=b\&.service\fR
927 is used on
928 a\&.service, this dependency will show as
929 \fIConsistsOf=a\&.service\fR
930 in property listing of
931 b\&.service\&.
932 \fIConsistsOf=\fR
933 dependency cannot be specified directly\&.
934 .sp
935 Added in version 201\&.
936 .RE
937 .PP
938 \fIUpholds=\fR
939 .RS 4
940 Configures dependencies similar to
941 \fIWants=\fR, but as long as this unit is up, all units listed in
942 \fIUpholds=\fR
943 are started whenever found to be inactive or failed, and no job is queued for them\&. While a
944 \fIWants=\fR
945 dependency on another unit has a one\-time effect when this units started, a
946 \fIUpholds=\fR
947 dependency on it has a continuous effect, constantly restarting the unit if necessary\&. This is an alternative to the
948 \fIRestart=\fR
949 setting of service units, to ensure they are kept running whatever happens\&. The restart happens without delay, and usual per\-unit rate\-limit applies\&.
950 .sp
951 When
952 \fIUpholds=b\&.service\fR
953 is used on
954 a\&.service, this dependency will show as
955 \fIUpheldBy=a\&.service\fR
956 in the property listing of
957 b\&.service\&.
958 .sp
959 Added in version 249\&.
960 .RE
961 .PP
962 \fIConflicts=\fR
963 .RS 4
964 A space\-separated list of unit names\&. Configures negative requirement dependencies\&. If a unit has a
965 \fIConflicts=\fR
966 requirement on a set of other units, then starting it will stop all of them and starting any of them will stop it\&.
967 .sp
968 Note that this setting does not imply an ordering dependency, similarly to the
969 \fIWants=\fR
970 and
971 \fIRequires=\fR
972 dependencies described above\&. This means that to ensure that the conflicting unit is stopped before the other unit is started, an
973 \fIAfter=\fR
974 or
975 \fIBefore=\fR
976 dependency must be declared\&. It does not matter which of the two ordering dependencies is used, because stop jobs are always ordered before start jobs, see the discussion in
977 \fIBefore=\fR/\fIAfter=\fR
978 below\&.
979 .sp
980 If unit A that conflicts with unit B is scheduled to be started at the same time as B, the transaction will either fail (in case both are required parts of the transaction) or be modified to be fixed (in case one or both jobs are not a required part of the transaction)\&. In the latter case, the job that is not required will be removed, or in case both are not required, the unit that conflicts will be started and the unit that is conflicted is stopped\&.
981 .sp
982 Added in version 201\&.
983 .RE
984 .PP
985 \fIBefore=\fR, \fIAfter=\fR
986 .RS 4
987 These two settings expect a space\-separated list of unit names\&. They may be specified more than once, in which case dependencies for all listed names are created\&.
988 .sp
989 Those two settings configure ordering dependencies between units\&. If unit
990 foo\&.service
991 contains the setting
992 \fBBefore=bar\&.service\fR
993 and both units are being started,
994 bar\&.service\*(Aqs start\-up is delayed until
995 foo\&.service
996 has finished starting up\&.
997 \fIAfter=\fR
998 is the inverse of
999 \fIBefore=\fR, i\&.e\&. while
1000 \fIBefore=\fR
1001 ensures that the configured unit is started before the listed unit begins starting up,
1002 \fIAfter=\fR
1003 ensures the opposite, that the listed unit is fully started up before the configured unit is started\&.
1004 .sp
1005 When two units with an ordering dependency between them are shut down, the inverse of the start\-up order is applied\&. I\&.e\&. if a unit is configured with
1006 \fIAfter=\fR
1007 on another unit, the former is stopped before the latter if both are shut down\&. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start\-up\&. It does not matter if the ordering dependency is
1008 \fIAfter=\fR
1009 or
1010 \fIBefore=\fR, in this case\&. It also does not matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start\-up in all cases\&. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place\&. It depends on the unit type when precisely a unit has finished starting up\&. Most importantly, for service units start\-up is considered completed for the purpose of
1011 \fIBefore=\fR/\fIAfter=\fR
1012 when all its configured start\-up commands have been invoked and they either failed or reported start\-up success\&. Note that this includes
1013 \fIExecStartPost=\fR
1014 (or
1015 \fIExecStopPost=\fR
1016 for the shutdown case)\&.
1017 .sp
1018 Note that those settings are independent of and orthogonal to the requirement dependencies as configured by
1019 \fIRequires=\fR,
1020 \fIWants=\fR,
1021 \fIRequisite=\fR, or
1022 \fIBindsTo=\fR\&. It is a common pattern to include a unit name in both the
1023 \fIAfter=\fR
1024 and
1025 \fIWants=\fR
1026 options, in which case the unit listed will be started before the unit that is configured with these options\&.
1027 .sp
1028 Note that
1029 \fIBefore=\fR
1030 dependencies on device units have no effect and are not supported\&. Devices generally become available as a result of an external hotplug event, and systemd creates the corresponding device unit without delay\&.
1031 .sp
1032 Added in version 201\&.
1033 .RE
1034 .PP
1035 \fIOnFailure=\fR
1036 .RS 4
1037 A space\-separated list of one or more units that are activated when this unit enters the
1038 "failed"
1039 state\&.
1040 .sp
1041 Added in version 201\&.
1042 .RE
1043 .PP
1044 \fIOnSuccess=\fR
1045 .RS 4
1046 A space\-separated list of one or more units that are activated when this unit enters the
1047 "inactive"
1048 state\&.
1049 .sp
1050 Added in version 249\&.
1051 .RE
1052 .PP
1053 \fIPropagatesReloadTo=\fR, \fIReloadPropagatedFrom=\fR
1054 .RS 4
1055 A space\-separated list of one or more units to which reload requests from this unit shall be propagated to, or units from which reload requests shall be propagated to this unit, respectively\&. Issuing a reload request on a unit will automatically also enqueue reload requests on all units that are linked to it using these two settings\&.
1056 .sp
1057 Added in version 201\&.
1058 .RE
1059 .PP
1060 \fIPropagatesStopTo=\fR, \fIStopPropagatedFrom=\fR
1061 .RS 4
1062 A space\-separated list of one or more units to which stop requests from this unit shall be propagated to, or units from which stop requests shall be propagated to this unit, respectively\&. Issuing a stop request on a unit will automatically also enqueue stop requests on all units that are linked to it using these two settings\&.
1063 .sp
1064 Added in version 249\&.
1065 .RE
1066 .PP
1067 \fIJoinsNamespaceOf=\fR
1068 .RS 4
1069 For units that start processes (such as service units), lists one or more other units whose network and/or temporary file namespace to join\&. If this is specified on a unit (say,
1070 a\&.service
1071 has
1072 \fIJoinsNamespaceOf=b\&.service\fR), then the inverse dependency (\fIJoinsNamespaceOf=a\&.service\fR
1073 for b\&.service) is implied\&. This only applies to unit types which support the
1074 \fIPrivateNetwork=\fR,
1075 \fINetworkNamespacePath=\fR,
1076 \fIPrivateIPC=\fR,
1077 \fIIPCNamespacePath=\fR, and
1078 \fIPrivateTmp=\fR
1079 directives (see
1080 \fBsystemd.exec\fR(5)
1081 for details)\&. If a unit that has this setting set is started, its processes will see the same
1082 /tmp/,
1083 /var/tmp/, IPC namespace and network namespace as one listed unit that is started\&. If multiple listed units are already started and these do not share their namespace, then it is not defined which namespace is joined\&. Note that this setting only has an effect if
1084 \fIPrivateNetwork=\fR/\fINetworkNamespacePath=\fR,
1085 \fIPrivateIPC=\fR/\fIIPCNamespacePath=\fR
1086 and/or
1087 \fIPrivateTmp=\fR
1088 is enabled for both the unit that joins the namespace and the unit whose namespace is joined\&.
1089 .sp
1090 Added in version 209\&.
1091 .RE
1092 .PP
1093 \fIRequiresMountsFor=\fR
1094 .RS 4
1095 Takes a space\-separated list of absolute paths\&. Automatically adds dependencies of type
1096 \fIRequires=\fR
1097 and
1098 \fIAfter=\fR
1099 for all mount units required to access the specified path\&.
1100 .sp
1101 Mount points marked with
1102 \fBnoauto\fR
1103 are not mounted automatically through
1104 local\-fs\&.target, but are still honored for the purposes of this option, i\&.e\&. they will be pulled in by this unit\&.
1105 .sp
1106 Added in version 201\&.
1107 .RE
1108 .PP
1109 \fIWantsMountsFor=\fR
1110 .RS 4
1111 Same as
1112 \fIRequiresMountsFor=\fR, but adds dependencies of type
1113 \fIWants=\fR
1114 instead of
1115 \fIRequires=\fR\&.
1116 .sp
1117 Added in version 256\&.
1118 .RE
1119 .PP
1120 \fIOnSuccessJobMode=\fR, \fIOnFailureJobMode=\fR
1121 .RS 4
1122 Takes a value of
1123 "fail",
1124 "replace",
1125 "replace\-irreversibly",
1126 "isolate",
1127 "flush",
1128 "ignore\-dependencies"
1129 or
1130 "ignore\-requirements"\&. Defaults to
1131 "replace"\&. Specifies how the units listed in
1132 \fIOnSuccess=\fR/\fIOnFailure=\fR
1133 will be enqueued\&. See
1134 \fBsystemctl\fR(1)\*(Aqs
1135 \fB\-\-job\-mode=\fR
1136 option for details on the possible values\&. If this is set to
1137 "isolate", only a single unit may be listed in
1138 \fIOnSuccess=\fR/\fIOnFailure=\fR\&.
1139 .sp
1140 Added in version 209\&.
1141 .RE
1142 .PP
1143 \fIIgnoreOnIsolate=\fR
1144 .RS 4
1145 Takes a boolean argument\&. If
1146 \fBtrue\fR, this unit will not be stopped when isolating another unit\&. Defaults to
1147 \fBfalse\fR
1148 for service, target, socket, timer, and path units, and
1149 \fBtrue\fR
1150 for slice, scope, device, swap, mount, and automount units\&.
1151 .sp
1152 Added in version 201\&.
1153 .RE
1154 .PP
1155 \fIStopWhenUnneeded=\fR
1156 .RS 4
1157 Takes a boolean argument\&. If
1158 \fBtrue\fR, this unit will be stopped when it is no longer used\&. Note that, in order to minimize the work to be executed, systemd will not stop units by default unless they are conflicting with other units, or the user explicitly requested their shut down\&. If this option is set, a unit will be automatically cleaned up if no other active unit requires it\&. Defaults to
1159 \fBfalse\fR\&.
1160 .sp
1161 Added in version 201\&.
1162 .RE
1163 .PP
1164 \fIRefuseManualStart=\fR, \fIRefuseManualStop=\fR
1165 .RS 4
1166 Takes a boolean argument\&. If
1167 \fBtrue\fR, this unit can only be activated or deactivated indirectly\&. In this case, explicit start\-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start\-up or termination will succeed\&. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated\&. These options default to
1168 \fBfalse\fR\&.
1169 .sp
1170 Added in version 201\&.
1171 .RE
1172 .PP
1173 \fIAllowIsolate=\fR
1174 .RS 4
1175 Takes a boolean argument\&. If
1176 \fBtrue\fR, this unit may be used with the
1177 \fBsystemctl isolate\fR
1178 command\&. Otherwise, this will be refused\&. It probably is a good idea to leave this disabled except for target units that shall be used similar to runlevels in SysV init systems, just as a precaution to avoid unusable system states\&. This option defaults to
1179 \fBfalse\fR\&.
1180 .sp
1181 Added in version 201\&.
1182 .RE
1183 .PP
1184 \fIDefaultDependencies=\fR
1185 .RS 4
1186 Takes a boolean argument\&. If
1187 \fByes\fR, (the default), a few default dependencies will implicitly be created for the unit\&. The actual dependencies created depend on the unit type\&. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown\&. See the respective man pages for details\&. Generally, only services involved with early boot or late shutdown should set this option to
1188 \fBno\fR\&. It is highly recommended to leave this option enabled for the majority of common units\&. If set to
1189 \fBno\fR, this option does not disable all implicit dependencies, just non\-essential ones\&.
1190 .sp
1191 Added in version 201\&.
1192 .RE
1193 .PP
1194 \fISurviveFinalKillSignal=\fR
1195 .RS 4
1196 Takes a boolean argument\&. Defaults to
1197 \fBno\fR\&. If
1198 \fByes\fR, processes belonging to this unit will not be sent the final
1199 "SIGTERM"
1200 and
1201 "SIGKILL"
1202 signals during the final phase of the system shutdown process\&. This functionality replaces the older mechanism that allowed a program to set
1203 "argv[0][0] = \*(Aq@\*(Aq"
1204 as described at
1205 \m[blue]\fBsystemd and Storage Daemons for the Root File System\fR\m[]\&\s-2\u[3]\d\s+2, which however continues to be supported\&.
1206 .sp
1207 Added in version 255\&.
1208 .RE
1209 .PP
1210 \fICollectMode=\fR
1211 .RS 4
1212 Tweaks the "garbage collection" algorithm for this unit\&. Takes one of
1213 \fBinactive\fR
1214 or
1215 \fBinactive\-or\-failed\fR\&. If set to
1216 \fBinactive\fR
1217 the unit will be unloaded if it is in the
1218 \fBinactive\fR
1219 state and is not referenced by clients, jobs or other units \(em however it is not unloaded if it is in the
1220 \fBfailed\fR
1221 state\&. In
1222 \fBfailed\fR
1223 mode, failed units are not unloaded until the user invoked
1224 \fBsystemctl reset\-failed\fR
1225 on them to reset the
1226 \fBfailed\fR
1227 state, or an equivalent command\&. This behaviour is altered if this option is set to
1228 \fBinactive\-or\-failed\fR: in this case, the unit is unloaded even if the unit is in a
1229 \fBfailed\fR
1230 state, and thus an explicitly resetting of the
1231 \fBfailed\fR
1232 state is not necessary\&. Note that if this mode is used unit results (such as exit codes, exit signals, consumed resources, \&...) are flushed out immediately after the unit completed, except for what is stored in the logging subsystem\&. Defaults to
1233 \fBinactive\fR\&.
1234 .sp
1235 Added in version 236\&.
1236 .RE
1237 .PP
1238 \fIFailureAction=\fR, \fISuccessAction=\fR
1239 .RS 4
1240 Configure the action to take when the unit stops and enters a failed state or inactive state\&. Takes one of
1241 \fBnone\fR,
1242 \fBreboot\fR,
1243 \fBreboot\-force\fR,
1244 \fBreboot\-immediate\fR,
1245 \fBpoweroff\fR,
1246 \fBpoweroff\-force\fR,
1247 \fBpoweroff\-immediate\fR,
1248 \fBexit\fR,
1249 \fBexit\-force\fR,
1250 \fBsoft\-reboot\fR,
1251 \fBsoft\-reboot\-force\fR,
1252 \fBkexec\fR,
1253 \fBkexec\-force\fR,
1254 \fBhalt\fR,
1255 \fBhalt\-force\fR
1256 and
1257 \fBhalt\-immediate\fR\&. In system mode, all options are allowed\&. In user mode, only
1258 \fBnone\fR,
1259 \fBexit\fR, and
1260 \fBexit\-force\fR
1261 are allowed\&. Both options default to
1262 \fBnone\fR\&.
1263 .sp
1264 If
1265 \fBnone\fR
1266 is set, no action will be triggered\&.
1267 \fBreboot\fR
1268 causes a reboot following the normal shutdown procedure (i\&.e\&. equivalent to
1269 \fBsystemctl reboot\fR)\&.
1270 \fBreboot\-force\fR
1271 causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i\&.e\&. equivalent to
1272 \fBsystemctl reboot \-f\fR) and
1273 \fBreboot\-immediate\fR
1274 causes immediate execution of the
1275 \fBreboot\fR(2)
1276 system call, which might result in data loss (i\&.e\&. equivalent to
1277 \fBsystemctl reboot \-ff\fR)\&. Similarly,
1278 \fBpoweroff\fR,
1279 \fBpoweroff\-force\fR,
1280 \fBpoweroff\-immediate\fR,
1281 \fBkexec\fR,
1282 \fBkexec\-force\fR,
1283 \fBhalt\fR,
1284 \fBhalt\-force\fR
1285 and
1286 \fBhalt\-immediate\fR
1287 have the effect of powering down the system, executing kexec, and halting the system respectively with similar semantics\&.
1288 \fBexit\fR
1289 causes the manager to exit following the normal shutdown procedure, and
1290 \fBexit\-force\fR
1291 causes it terminate without shutting down services\&. When
1292 \fBexit\fR
1293 or
1294 \fBexit\-force\fR
1295 is used by default the exit status of the main process of the unit (if this applies) is returned from the service manager\&. However, this may be overridden with
1296 \fIFailureActionExitStatus=\fR/\fISuccessActionExitStatus=\fR, see below\&.
1297 \fBsoft\-reboot\fR
1298 will trigger a userspace reboot operation\&.
1299 \fBsoft\-reboot\-force\fR
1300 does that too, but does not go through the shutdown transaction beforehand\&.
1301 .sp
1302 Added in version 236\&.
1303 .RE
1304 .PP
1305 \fIFailureActionExitStatus=\fR, \fISuccessActionExitStatus=\fR
1306 .RS 4
1307 Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the
1308 \fIFailureAction=\fR/\fISuccessAction=\fR
1309 are set to
1310 \fBexit\fR
1311 or
1312 \fBexit\-force\fR
1313 and the action is triggered\&. By default, the exit status of the main process of the triggering unit (if this applies) is propagated\&. Takes a value in the range 0\&...255 or the empty string to request default behaviour\&.
1314 .sp
1315 Added in version 240\&.
1316 .RE
1317 .PP
1318 \fIJobTimeoutSec=\fR, \fIJobRunningTimeoutSec=\fR
1319 .RS 4
1320 \fIJobTimeoutSec=\fR
1321 specifies a timeout for the whole job that starts running when the job is queued\&.
1322 \fIJobRunningTimeoutSec=\fR
1323 specifies a timeout that starts running when the queued job is actually started\&. If either limit is reached, the job will be cancelled, the unit however will not change state or even enter the
1324 "failed"
1325 mode\&.
1326 .sp
1327 Both settings take a time span with the default unit of seconds, but other units may be specified, see
1328 \fBsystemd.time\fR(7)\&. The default is
1329 "infinity"
1330 (job timeouts disabled), except for device units where
1331 \fIJobRunningTimeoutSec=\fR
1332 defaults to
1333 \fIDefaultDeviceTimeoutSec=\fR\&.
1334 .sp
1335 Note: these timeouts are independent from any unit\-specific timeouts (for example, the timeout set with
1336 \fITimeoutStartSec=\fR
1337 in service units)\&. The job timeout has no effect on the unit itself\&. Or in other words: unit\-specific timeouts are useful to abort unit state changes, and revert them\&. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change\&.
1338 .sp
1339 Added in version 201\&.
1340 .RE
1341 .PP
1342 \fIJobTimeoutAction=\fR, \fIJobTimeoutRebootArgument=\fR
1343 .RS 4
1344 \fIJobTimeoutAction=\fR
1345 optionally configures an additional action to take when the timeout is hit, see description of
1346 \fIJobTimeoutSec=\fR
1347 and
1348 \fIJobRunningTimeoutSec=\fR
1349 above\&. It takes the same values as
1350 \fIFailureAction=\fR/\fISuccessAction=\fR\&. Defaults to
1351 \fBnone\fR\&.
1352 .sp
1353 \fIJobTimeoutRebootArgument=\fR
1354 configures an optional reboot string to pass to the
1355 \fBreboot\fR(2)
1356 system call\&.
1357 .sp
1358 Added in version 240\&.
1359 .RE
1360 .PP
1361 \fIStartLimitIntervalSec=\fR\fI\fIinterval\fR\fR, \fIStartLimitBurst=\fR\fI\fIburst\fR\fR
1362 .RS 4
1363 Configure unit start rate limiting\&. Units which are started more than
1364 \fIburst\fR
1365 times within an
1366 \fIinterval\fR
1367 time span are not permitted to start any more\&. Use
1368 \fIStartLimitIntervalSec=\fR
1369 to configure the checking interval and
1370 \fIStartLimitBurst=\fR
1371 to configure how many starts per interval are allowed\&.
1372 .sp
1373 \fIinterval\fR
1374 is a time span with the default unit of seconds, but other units may be specified, see
1375 \fBsystemd.time\fR(7)\&. The special value
1376 "infinity"
1377 can be used to limit the total number of start attempts, even if they happen at large time intervals\&. Defaults to
1378 \fIDefaultStartLimitIntervalSec=\fR
1379 in manager configuration file, and may be set to 0 to disable any kind of rate limiting\&.
1380 \fIburst\fR
1381 is a number and defaults to
1382 \fIDefaultStartLimitBurst=\fR
1383 in manager configuration file\&.
1384 .sp
1385 These configuration options are particularly useful in conjunction with the service setting
1386 \fIRestart=\fR
1387 (see
1388 \fBsystemd.service\fR(5)); however, they apply to all kinds of starts (including manual), not just those triggered by the
1389 \fIRestart=\fR
1390 logic\&.
1391 .sp
1392 Note that units which are configured for
1393 \fIRestart=\fR, and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually or from a timer or socket at a later point, after the
1394 \fIinterval\fR
1395 has passed\&. From that point on, the restart logic is activated again\&.
1396 \fBsystemctl reset\-failed\fR
1397 will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that\&. Rate\-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit\&.
1398 .sp
1399 When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too\&. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect\&.
1400 .sp
1401 This setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time\&.
1402 .sp
1403 Added in version 229\&.
1404 .RE
1405 .PP
1406 \fIStartLimitAction=\fR
1407 .RS 4
1408 Configure an additional action to take if the rate limit configured with
1409 \fIStartLimitIntervalSec=\fR
1410 and
1411 \fIStartLimitBurst=\fR
1412 is hit\&. Takes the same values as the
1413 \fIFailureAction=\fR/\fISuccessAction=\fR
1414 settings\&. If
1415 \fBnone\fR
1416 is set, hitting the rate limit will trigger no action except that the start will not be permitted\&. Defaults to
1417 \fBnone\fR\&.
1418 .sp
1419 Added in version 229\&.
1420 .RE
1421 .PP
1422 \fIRebootArgument=\fR
1423 .RS 4
1424 Configure the optional argument for the
1425 \fBreboot\fR(2)
1426 system call if
1427 \fIStartLimitAction=\fR
1428 or
1429 \fIFailureAction=\fR
1430 is a reboot action\&. This works just like the optional argument to
1431 \fBsystemctl reboot\fR
1432 command\&.
1433 .sp
1434 Added in version 229\&.
1435 .RE
1436 .PP
1437 \fISourcePath=\fR
1438 .RS 4
1439 A path to a configuration file this unit has been generated from\&. This is primarily useful for implementation of generator tools that convert configuration from an external configuration file format into native unit files\&. This functionality should not be used in normal units\&.
1440 .sp
1441 Added in version 201\&.
1442 .RE
1443 .SS "Conditions and Asserts"
1444 .PP
1445 Unit files may also include a number of
1446 \fICondition\&...=\fR
1447 and
1448 \fIAssert\&...=\fR
1449 settings\&. Before the unit is started, systemd will verify that the specified conditions and asserts are true\&. If not, the starting of the unit will be (mostly silently) skipped (in case of conditions), or aborted with an error message (in case of asserts)\&. Failing conditions or asserts will not result in the unit being moved into the
1450 "failed"
1451 state\&. The conditions and asserts are checked at the time the queued start job is to be executed\&. The ordering dependencies are still respected, so other units are still pulled in and ordered as if this unit was successfully activated, and the conditions and asserts are executed the precise moment the unit would normally start and thus can validate system state after the units ordered before completed initialization\&. Use condition expressions for skipping units that do not apply to the local system, for example because the kernel or runtime environment does not require their functionality\&.
1452 .PP
1453 If multiple conditions are specified, the unit will be executed if all of them apply (i\&.e\&. a logical AND is applied)\&. Condition checks can use a pipe symbol ("|") after the equals sign ("Condition\&...=|\&..."), which causes the condition to become a
1454 \fItriggering\fR
1455 condition\&. If at least one triggering condition is defined for a unit, then the unit will be started if at least one of the triggering conditions of the unit applies and all of the regular (i\&.e\&. non\-triggering) conditions apply\&. If you prefix an argument with the pipe symbol and an exclamation mark, the pipe symbol must be passed first, the exclamation second\&. If any of these options is assigned the empty string, the list of conditions is reset completely, all previous condition settings (of any kind) will have no effect\&.
1456 .PP
1457 The
1458 \fIAssertArchitecture=\fR,
1459 \fIAssertVirtualization=\fR, \&... options are similar to conditions but cause the start job to fail (instead of being skipped)\&. The failed check is logged\&. Units with unmet conditions are considered to be in a clean state and will be garbage collected if they are not referenced\&. This means that when queried, the condition failure may or may not show up in the state of the unit\&.
1460 .PP
1461 Note that neither assertion nor condition expressions result in unit state changes\&. Also note that both are checked at the time the job is to be executed, i\&.e\&. long after depending jobs and it itself were queued\&. Thus, neither condition nor assertion expressions are suitable for conditionalizing unit dependencies\&.
1462 .PP
1463 The
1464 \fBcondition\fR
1465 verb of
1466 \fBsystemd-analyze\fR(1)
1467 can be used to test condition and assert expressions\&.
1468 .PP
1469 Except for
1470 \fIConditionPathIsSymbolicLink=\fR, all path checks follow symlinks\&.
1471 .PP
1472 \fIConditionArchitecture=\fR
1473 .RS 4
1474 Check whether the system is running on a specific architecture\&. Takes one of
1475 "x86",
1476 "x86\-64",
1477 "ppc",
1478 "ppc\-le",
1479 "ppc64",
1480 "ppc64\-le",
1481 "ia64",
1482 "parisc",
1483 "parisc64",
1484 "s390",
1485 "s390x",
1486 "sparc",
1487 "sparc64",
1488 "mips",
1489 "mips\-le",
1490 "mips64",
1491 "mips64\-le",
1492 "alpha",
1493 "arm",
1494 "arm\-be",
1495 "arm64",
1496 "arm64\-be",
1497 "sh",
1498 "sh64",
1499 "m68k",
1500 "tilegx",
1501 "cris",
1502 "arc",
1503 "arc\-be", or
1504 "native"\&.
1505 .sp
1506 Use
1507 \fBsystemd-analyze\fR(1)
1508 for the complete list of known architectures\&.
1509 .sp
1510 The architecture is determined from the information returned by
1511 \fBuname\fR(2)
1512 and is thus subject to
1513 \fBpersonality\fR(2)\&. Note that a
1514 \fIPersonality=\fR
1515 setting in the same unit file has no effect on this condition\&. A special architecture name
1516 "native"
1517 is mapped to the architecture the system manager itself is compiled for\&. The test may be negated by prepending an exclamation mark\&.
1518 .sp
1519 Added in version 201\&.
1520 .RE
1521 .PP
1522 \fIConditionFirmware=\fR
1523 .RS 4
1524 Check whether the system\*(Aqs firmware is of a certain type\&. The following values are possible:
1525 .sp
1526 .RS 4
1527 .ie n \{\
1528 \h'-04'\(bu\h'+03'\c
1529 .\}
1530 .el \{\
1531 .sp -1
1532 .IP \(bu 2.3
1533 .\}
1534 "uefi"
1535 matches systems with EFI\&.
1536 .RE
1537 .sp
1538 .RS 4
1539 .ie n \{\
1540 \h'-04'\(bu\h'+03'\c
1541 .\}
1542 .el \{\
1543 .sp -1
1544 .IP \(bu 2.3
1545 .\}
1546 "device\-tree"
1547 matches systems with a device tree\&.
1548 .RE
1549 .sp
1550 .RS 4
1551 .ie n \{\
1552 \h'-04'\(bu\h'+03'\c
1553 .\}
1554 .el \{\
1555 .sp -1
1556 .IP \(bu 2.3
1557 .\}
1558 "device\-tree\-compatible(\fIvalue\fR)"
1559 matches systems with a device tree that are compatible with
1560 "value"\&.
1561 .RE
1562 .sp
1563 .RS 4
1564 .ie n \{\
1565 \h'-04'\(bu\h'+03'\c
1566 .\}
1567 .el \{\
1568 .sp -1
1569 .IP \(bu 2.3
1570 .\}
1571 "smbios\-field(\fIfield\fR \fIoperator\fR \fIvalue\fR)"
1572 matches systems with a SMBIOS field containing a certain value\&.
1573 \fIfield\fR
1574 is the name of the SMBIOS field exposed as
1575 "sysfs"
1576 attribute file below
1577 /sys/class/dmi/id/\&.
1578 \fIoperator\fR
1579 is one of
1580 "<",
1581 "<=",
1582 ">=",
1583 ">",
1584 "==",
1585 "<>"
1586 for version comparisons,
1587 "="
1588 and
1589 "!="
1590 for literal string comparisons, or
1591 "$=",
1592 "!$="
1593 for shell\-style glob comparisons\&.
1594 \fIvalue\fR
1595 is the expected value of the SMBIOS field value (possibly containing shell style globs in case
1596 "$="/"!$="
1597 is used)\&.
1598 .RE
1599 .sp
1600 Added in version 249\&.
1601 .RE
1602 .PP
1603 \fIConditionVirtualization=\fR
1604 .RS 4
1605 Check whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation\&. Takes either boolean value to check if being executed in any virtualized environment, or one of
1606 "vm"
1607 and
1608 "container"
1609 to test against a generic type of virtualization solution, or one of
1610 "qemu",
1611 "kvm",
1612 "amazon",
1613 "zvm",
1614 "vmware",
1615 "microsoft",
1616 "oracle",
1617 "powervm",
1618 "xen",
1619 "bochs",
1620 "uml",
1621 "bhyve",
1622 "qnx",
1623 "apple",
1624 "sre",
1625 "openvz",
1626 "lxc",
1627 "lxc\-libvirt",
1628 "systemd\-nspawn",
1629 "docker",
1630 "podman",
1631 "rkt",
1632 "wsl",
1633 "proot",
1634 "pouch",
1635 "acrn"
1636 to test against a specific implementation, or
1637 "private\-users"
1638 to check whether we are running in a user namespace\&. See
1639 \fBsystemd-detect-virt\fR(1)
1640 for a full list of known virtualization technologies and their identifiers\&. If multiple virtualization technologies are nested, only the innermost is considered\&. The test may be negated by prepending an exclamation mark\&.
1641 .sp
1642 Added in version 244\&.
1643 .RE
1644 .PP
1645 \fIConditionHost=\fR
1646 .RS 4
1647 \fIConditionHost=\fR
1648 may be used to match against the hostname, machine ID, boot ID or product UUID of the host\&. This either takes a hostname string (optionally with shell style globs) which is tested against the locally set hostname as returned by
1649 \fBgethostname\fR(2), or a 128bit ID or UUID, formatted as string\&. The latter is compared against machine ID, boot ID and the firmware product UUID if there is any\&. See
1650 \fBmachine-id\fR(5)
1651 for details about the machine ID\&. The test may be negated by prepending an exclamation mark\&.
1652 .sp
1653 Added in version 244\&.
1654 .RE
1655 .PP
1656 \fIConditionKernelCommandLine=\fR
1657 .RS 4
1658 \fIConditionKernelCommandLine=\fR
1659 may be used to check whether a specific kernel command line option is set (or if prefixed with the exclamation mark \(em unset)\&. The argument must either be a single word, or an assignment (i\&.e\&. two words, separated by
1660 "=")\&. In the former case the kernel command line is searched for the word appearing as is, or as left hand side of an assignment\&. In the latter case, the exact assignment is looked for with right and left hand side matching\&. This operates on the kernel command line communicated to userspace via
1661 /proc/cmdline, except when the service manager is invoked as payload of a container manager, in which case the command line of
1662 PID 1
1663 is used instead (i\&.e\&.
1664 /proc/1/cmdline)\&.
1665 .sp
1666 Added in version 244\&.
1667 .RE
1668 .PP
1669 \fIConditionKernelVersion=\fR
1670 .RS 4
1671 \fIConditionKernelVersion=\fR
1672 may be used to check whether the kernel version (as reported by
1673 \fBuname \-r\fR) matches a certain expression, or if prefixed with the exclamation mark, does not match\&. The argument must be a list of (potentially quoted) expressions\&. Each expression starts with one of
1674 "="
1675 or
1676 "!="
1677 for string comparisons,
1678 "<",
1679 "<=",
1680 "==",
1681 "<>",
1682 ">=",
1683 ">"
1684 for version comparisons, or
1685 "$=",
1686 "!$="
1687 for a shell\-style glob match\&. If no operator is specified,
1688 "$="
1689 is implied\&.
1690 .sp
1691 Note that using the kernel version string is an unreliable way to determine which features are supported by a kernel, because of the widespread practice of backporting drivers, features, and fixes from newer upstream kernels into older versions provided by distributions\&. Hence, this check is inherently unportable and should not be used for units which may be used on different distributions\&.
1692 .sp
1693 Added in version 244\&.
1694 .RE
1695 .PP
1696 \fIConditionVersion=\fR
1697 .RS 4
1698 \fIConditionVersion=\fR
1699 may be used to check whether a software version matches a certain expression, or if prefixed with the exclamation mark, does not match\&. The first argument is the software whose version has to be checked\&. Currently
1700 "kernel",
1701 "systemd"
1702 and
1703 "glibc"
1704 are supported\&. If this argument is omitted,
1705 "kernel"
1706 is implied\&. The second argument must be a list of (potentially quoted) expressions\&. Each expression starts with one of
1707 "="
1708 or
1709 "!="
1710 for string comparisons,
1711 "<",
1712 "<=",
1713 "==",
1714 "<>",
1715 ">=",
1716 ">"
1717 for version comparisons, or
1718 "$=",
1719 "!$="
1720 for a shell\-style glob match\&. If no operator is specified,
1721 "$="
1722 is implied\&.
1723 .sp
1724 Added in version 258\&.
1725 .RE
1726 .PP
1727 \fIConditionCredential=\fR
1728 .RS 4
1729 \fIConditionCredential=\fR
1730 may be used to check whether a credential by the specified name was passed into the service manager\&. See
1731 \m[blue]\fBSystem and Service Credentials\fR\m[]\&\s-2\u[4]\d\s+2
1732 for details about credentials\&. If used in services for the system service manager this may be used to conditionalize services based on system credentials passed in\&. If used in services for the per\-user service manager this may be used to conditionalize services based on credentials passed into the
1733 unit@\&.service
1734 service instance belonging to the user\&. The argument must be a valid credential name\&.
1735 .sp
1736 Added in version 252\&.
1737 .RE
1738 .PP
1739 \fIConditionEnvironment=\fR
1740 .RS 4
1741 \fIConditionEnvironment=\fR
1742 may be used to check whether a specific environment variable is set (or if prefixed with the exclamation mark \(em unset) in the service manager\*(Aqs environment block\&. The argument may be a single word, to check if the variable with this name is defined in the environment block, or an assignment ("\fIname\fR=\fIvalue\fR"), to check if the variable with this exact value is defined\&. Note that the environment block of the service manager itself is checked, i\&.e\&. not any variables defined with
1743 \fIEnvironment=\fR
1744 or
1745 \fIEnvironmentFile=\fR, as described above\&. This is particularly useful when the service manager runs inside a containerized environment or as per\-user service manager, in order to check for variables passed in by the enclosing container manager or PAM\&.
1746 .sp
1747 Added in version 246\&.
1748 .RE
1749 .PP
1750 \fIConditionSecurity=\fR
1751 .RS 4
1752 \fIConditionSecurity=\fR
1753 may be used to check whether the given security technology is enabled on the system\&. Currently, the following values are recognized:
1754 .sp
1755 .it 1 an-trap
1756 .nr an-no-space-flag 1
1757 .nr an-break-flag 1
1758 .br
1759 .B Table\ \&3.\ \&Recognized security technologies
1760 .TS
1761 allbox tab(:);
1762 lB lB.
1763 T{
1764 Value
1765 T}:T{
1766 Description
1767 T}
1768 .T&
1769 l l
1770 l l
1771 l l
1772 l l
1773 l l
1774 l l
1775 l l
1776 l l
1777 l l
1778 l l.
1779 T{
1780 selinux
1781 T}:T{
1782 SELinux MAC
1783 T}
1784 T{
1785 apparmor
1786 T}:T{
1787 AppArmor MAC
1788 T}
1789 T{
1790 tomoyo
1791 T}:T{
1792 Tomoyo MAC
1793 T}
1794 T{
1795 smack
1796 T}:T{
1797 SMACK MAC
1798 T}
1799 T{
1800 ima
1801 T}:T{
1802 Integrity Measurement Architecture (IMA)
1803 T}
1804 T{
1805 audit
1806 T}:T{
1807 Linux Audit Framework
1808 T}
1809 T{
1810 uefi\-secureboot
1811 T}:T{
1812 UEFI SecureBoot
1813 T}
1814 T{
1815 tpm2
1816 T}:T{
1817 Trusted Platform Module 2\&.0 (TPM2)
1818 T}
1819 T{
1820 cvm
1821 T}:T{
1822 Confidential virtual machine (SEV/TDX)
1823 T}
1824 T{
1825 measured\-uki
1826 T}:T{
1827 Unified Kernel Image with PCR 11 Measurements, as per \fBsystemd-stub\fR(7)\&. Added in version 255\&.
1828 T}
1829 .TE
1830 .sp 1
1831 The test may be negated by prepending an exclamation mark\&.
1832 .sp
1833 Added in version 244\&.
1834 .RE
1835 .PP
1836 \fIConditionCapability=\fR
1837 .RS 4
1838 Check whether the given capability exists in the capability bounding set of the service manager (i\&.e\&. this does not check whether capability is actually available in the permitted or effective sets, see
1839 \fBcapabilities\fR(7)
1840 for details)\&. Pass a capability name such as
1841 "CAP_MKNOD", possibly prefixed with an exclamation mark to negate the check\&.
1842 .sp
1843 Added in version 244\&.
1844 .RE
1845 .PP
1846 \fIConditionACPower=\fR
1847 .RS 4
1848 Check whether the system has AC power, or is exclusively battery powered at the time of activation of the unit\&. This takes a boolean argument\&. If set to
1849 "true", the condition will hold only if at least one AC connector of the system is connected to a power source, or if no AC connectors are known\&. Conversely, if set to
1850 "false", the condition will hold only if there is at least one AC connector known and all AC connectors are disconnected from a power source\&.
1851 .sp
1852 Added in version 244\&.
1853 .RE
1854 .PP
1855 \fIConditionNeedsUpdate=\fR
1856 .RS 4
1857 Takes one of
1858 /var/
1859 or
1860 /etc/
1861 as argument, possibly prefixed with a
1862 "!"
1863 (to invert the condition)\&. This condition may be used to conditionalize units on whether the specified directory requires an update because
1864 /usr/\*(Aqs modification time is newer than the stamp file
1865 \&.updated
1866 in the specified directory\&. This is useful to implement offline updates of the vendor operating system resources in
1867 /usr/
1868 that require updating of
1869 /etc/
1870 or
1871 /var/
1872 on the next following boot\&. Units making use of this condition should order themselves before
1873 \fBsystemd-update-done.service\fR(8), to make sure they run before the stamp file\*(Aqs modification time gets reset indicating a completed update\&.
1874 .sp
1875 If the
1876 \fIsystemd\&.condition_needs_update=\fR
1877 option is specified on the kernel command line (taking a boolean), it will override the result of this condition check, taking precedence over any file modification time checks\&. If the kernel command line option is used,
1878 systemd\-update\-done\&.service
1879 will not have immediate effect on any following
1880 \fIConditionNeedsUpdate=\fR
1881 checks, until the system is rebooted where the kernel command line option is not specified anymore\&.
1882 .sp
1883 Note that to make this scheme effective, the timestamp of
1884 /usr/
1885 should be explicitly updated after its contents are modified\&. The kernel will automatically update modification timestamp on a directory only when immediate children of a directory are modified; an modification of nested files will not automatically result in mtime of
1886 /usr/
1887 being updated\&.
1888 .sp
1889 Also note that if the update method includes a call to execute appropriate post\-update steps itself, it should not touch the timestamp of
1890 /usr/\&. In a typical distribution packaging scheme, packages will do any required update steps as part of the installation or upgrade, to make package contents immediately usable\&.
1891 \fIConditionNeedsUpdate=\fR
1892 should be used with other update mechanisms where such an immediate update does not happen\&.
1893 .sp
1894 Added in version 244\&.
1895 .RE
1896 .PP
1897 \fIConditionFirstBoot=\fR
1898 .RS 4
1899 Takes a boolean argument\&. This condition may be used to conditionalize units on whether the system is booting up for the first time\&. This roughly means that
1900 /etc/
1901 was unpopulated when the system started booting (for details, see "First Boot Semantics" in
1902 \fBmachine-id\fR(5))\&. First Boot is considered finished (this condition will evaluate as false) after the manager has finished the startup phase\&.
1903 .sp
1904 This condition may be used to populate
1905 /etc/
1906 on the first boot after factory reset, or when a new system instance boots up for the first time\&.
1907 .sp
1908 Note that the service manager itself will perform setup steps during First Boot: it will initialize
1909 \fBmachine-id\fR(5)
1910 and preset all units, enabling or disabling them according to the
1911 \fBsystemd.preset\fR(5)
1912 settings\&. Additional setup may be performed via units with
1913 \fIConditionFirstBoot=yes\fR\&.
1914 .sp
1915 For robustness, units with
1916 \fIConditionFirstBoot=yes\fR
1917 should order themselves before
1918 first\-boot\-complete\&.target
1919 and pull in this passive target with
1920 \fIWants=\fR\&. This ensures that in a case of an aborted first boot, these units will be re\-run during the next system startup\&.
1921 .sp
1922 If the
1923 \fIsystemd\&.condition_first_boot=\fR
1924 option is specified on the kernel command line (taking a boolean), it will override the result of this condition check, taking precedence over
1925 /etc/machine\-id
1926 existence checks\&.
1927 .sp
1928 Added in version 244\&.
1929 .RE
1930 .PP
1931 \fIConditionPathExists=\fR
1932 .RS 4
1933 Check for the existence of a file\&. If the specified absolute path name does not exist, the condition will fail\&. If the absolute path name passed to
1934 \fIConditionPathExists=\fR
1935 is prefixed with an exclamation mark ("!"), the test is negated, and the unit is only started if the path does not exist\&.
1936 .sp
1937 Added in version 244\&.
1938 .RE
1939 .PP
1940 \fIConditionPathExistsGlob=\fR
1941 .RS 4
1942 \fIConditionPathExistsGlob=\fR
1943 is similar to
1944 \fIConditionPathExists=\fR, but checks for the existence of at least one file or directory matching the specified globbing pattern\&.
1945 .sp
1946 Added in version 244\&.
1947 .RE
1948 .PP
1949 \fIConditionPathIsDirectory=\fR
1950 .RS 4
1951 \fIConditionPathIsDirectory=\fR
1952 is similar to
1953 \fIConditionPathExists=\fR
1954 but verifies that a certain path exists and is a directory\&.
1955 .sp
1956 Added in version 244\&.
1957 .RE
1958 .PP
1959 \fIConditionPathIsSymbolicLink=\fR
1960 .RS 4
1961 \fIConditionPathIsSymbolicLink=\fR
1962 is similar to
1963 \fIConditionPathExists=\fR
1964 but verifies that a certain path exists and is a symbolic link\&.
1965 .sp
1966 Added in version 244\&.
1967 .RE
1968 .PP
1969 \fIConditionPathIsMountPoint=\fR
1970 .RS 4
1971 \fIConditionPathIsMountPoint=\fR
1972 is similar to
1973 \fIConditionPathExists=\fR
1974 but verifies that a certain path exists and is a mount point\&.
1975 .sp
1976 Added in version 244\&.
1977 .RE
1978 .PP
1979 \fIConditionPathIsReadWrite=\fR
1980 .RS 4
1981 \fIConditionPathIsReadWrite=\fR
1982 is similar to
1983 \fIConditionPathExists=\fR
1984 but verifies that the underlying file system is readable and writable (i\&.e\&. not mounted read\-only)\&.
1985 .sp
1986 Added in version 244\&.
1987 .RE
1988 .PP
1989 \fIConditionPathIsEncrypted=\fR
1990 .RS 4
1991 \fIConditionPathIsEncrypted=\fR
1992 is similar to
1993 \fIConditionPathExists=\fR
1994 but verifies that the underlying file system\*(Aqs backing block device is encrypted using dm\-crypt/LUKS\&. Note that this check does not cover ext4 per\-directory encryption, and only detects block level encryption\&. Moreover, if the specified path resides on a file system on top of a loopback block device, only encryption above the loopback device is detected\&. It is not detected whether the file system backing the loopback block device is encrypted\&.
1995 .sp
1996 Added in version 246\&.
1997 .RE
1998 .PP
1999 \fIConditionDirectoryNotEmpty=\fR
2000 .RS 4
2001 \fIConditionDirectoryNotEmpty=\fR
2002 is similar to
2003 \fIConditionPathExists=\fR
2004 but verifies that a certain path exists and is a non\-empty directory\&.
2005 .sp
2006 Added in version 244\&.
2007 .RE
2008 .PP
2009 \fIConditionFileNotEmpty=\fR
2010 .RS 4
2011 \fIConditionFileNotEmpty=\fR
2012 is similar to
2013 \fIConditionPathExists=\fR
2014 but verifies that a certain path exists and refers to a regular file with a non\-zero size\&.
2015 .sp
2016 Added in version 244\&.
2017 .RE
2018 .PP
2019 \fIConditionFileIsExecutable=\fR
2020 .RS 4
2021 \fIConditionFileIsExecutable=\fR
2022 is similar to
2023 \fIConditionPathExists=\fR
2024 but verifies that a certain path exists, is a regular file, and marked executable\&.
2025 .sp
2026 Added in version 244\&.
2027 .RE
2028 .PP
2029 \fIConditionUser=\fR
2030 .RS 4
2031 \fIConditionUser=\fR
2032 takes a numeric
2033 "UID", a UNIX user name, or the special value
2034 "@system"\&. This condition may be used to check whether the service manager is running as the given user\&. The special value
2035 "@system"
2036 can be used to check if the user id is within the system user range\&. This option is not useful for system services, as the system manager exclusively runs as the root user, and thus the test result is constant\&.
2037 .sp
2038 Added in version 244\&.
2039 .RE
2040 .PP
2041 \fIConditionGroup=\fR
2042 .RS 4
2043 \fIConditionGroup=\fR
2044 is similar to
2045 \fIConditionUser=\fR
2046 but verifies that the service manager\*(Aqs real or effective group, or any of its auxiliary groups, match the specified group or GID\&. This setting does not support the special value
2047 "@system"\&.
2048 .sp
2049 Added in version 244\&.
2050 .RE
2051 .PP
2052 \fIConditionControlGroupController=\fR
2053 .RS 4
2054 Check whether given cgroup controllers (e\&.g\&.
2055 "cpu") are available for use on the system or whether the legacy v1 cgroup or the modern v2 cgroup hierarchy is used\&.
2056 .sp
2057 Multiple controllers may be passed with a space separating them; in this case, the condition will only pass if all listed controllers are available for use\&. Controllers unknown to systemd are ignored\&. Valid controllers are
2058 "cpu",
2059 "io",
2060 "memory", and
2061 "pids"\&. Even if available in the kernel, a particular controller may not be available if it was disabled on the kernel command line with
2062 \fIcgroup_disable=controller\fR\&.
2063 .sp
2064 Alternatively, two special strings
2065 "v1"
2066 and
2067 "v2"
2068 may be specified (without any controller names)\&.
2069 "v2"
2070 will pass if the unified v2 cgroup hierarchy is used, and
2071 "v1"
2072 will pass if the legacy v1 hierarchy or the hybrid hierarchy are used\&. Note that legacy or hybrid hierarchies have been deprecated\&. See
2073 \fBsystemd\fR(1)
2074 for more information\&.
2075 .sp
2076 Added in version 244\&.
2077 .RE
2078 .PP
2079 \fIConditionMemory=\fR
2080 .RS 4
2081 Verify that the specified amount of system memory is available to the current system\&. Takes a memory size in bytes as argument, optionally prefixed with a comparison operator
2082 "<",
2083 "<=",
2084 "="
2085 (or
2086 "=="),
2087 "!="
2088 (or
2089 "<>"),
2090 ">=",
2091 ">"\&. On bare\-metal systems compares the amount of physical memory in the system with the specified size, adhering to the specified comparison operator\&. In containers compares the amount of memory assigned to the container instead\&.
2092 .sp
2093 Added in version 244\&.
2094 .RE
2095 .PP
2096 \fIConditionCPUs=\fR
2097 .RS 4
2098 Verify that the specified number of CPUs is available to the current system\&. Takes a number of CPUs as argument, optionally prefixed with a comparison operator
2099 "<",
2100 "<=",
2101 "="
2102 (or
2103 "=="),
2104 "!="
2105 (or
2106 "<>"),
2107 ">=",
2108 ">"\&. Compares the number of CPUs in the CPU affinity mask configured of the service manager itself with the specified number, adhering to the specified comparison operator\&. On physical systems the number of CPUs in the affinity mask of the service manager usually matches the number of physical CPUs, but in special and virtual environments might differ\&. In particular, in containers the affinity mask usually matches the number of CPUs assigned to the container and not the physically available ones\&.
2109 .sp
2110 Added in version 244\&.
2111 .RE
2112 .PP
2113 \fIConditionCPUFeature=\fR
2114 .RS 4
2115 Verify that a given CPU feature is available via the
2116 "CPUID"
2117 instruction\&. This condition only does something on i386 and x86\-64 processors\&. On other processors it is assumed that the CPU does not support the given feature\&. It checks the leaves
2118 "1",
2119 "7",
2120 "0x80000001", and
2121 "0x80000007"\&. Valid values are:
2122 "fpu",
2123 "vme",
2124 "de",
2125 "pse",
2126 "tsc",
2127 "msr",
2128 "pae",
2129 "mce",
2130 "cx8",
2131 "apic",
2132 "sep",
2133 "mtrr",
2134 "pge",
2135 "mca",
2136 "cmov",
2137 "pat",
2138 "pse36",
2139 "clflush",
2140 "mmx",
2141 "fxsr",
2142 "sse",
2143 "sse2",
2144 "ht",
2145 "pni",
2146 "pclmul",
2147 "monitor",
2148 "ssse3",
2149 "fma3",
2150 "cx16",
2151 "sse4_1",
2152 "sse4_2",
2153 "movbe",
2154 "popcnt",
2155 "aes",
2156 "xsave",
2157 "osxsave",
2158 "avx",
2159 "f16c",
2160 "rdrand",
2161 "bmi1",
2162 "avx2",
2163 "bmi2",
2164 "rdseed",
2165 "adx",
2166 "sha_ni",
2167 "syscall",
2168 "rdtscp",
2169 "lm",
2170 "lahf_lm",
2171 "abm",
2172 "constant_tsc"\&.
2173 .sp
2174 Added in version 248\&.
2175 .RE
2176 .PP
2177 \fIConditionOSRelease=\fR
2178 .RS 4
2179 Verify that a specific
2180 "key=value"
2181 pair is set in the host\*(Aqs
2182 \fBos-release\fR(5)\&.
2183 .sp
2184 Other than exact string matching (with
2185 "="
2186 and
2187 "!="), relative comparisons are supported for versioned parameters (e\&.g\&.
2188 "VERSION_ID"; with
2189 "<",
2190 "<=",
2191 "==",
2192 "<>",
2193 ">=",
2194 ">"), and shell\-style wildcard comparisons ("*",
2195 "?",
2196 "[]") are supported with the
2197 "$="
2198 (match) and
2199 "!$="
2200 (non\-match)\&.
2201 .sp
2202 If the given key is not found in the file, the match is done against an empty value\&.
2203 .sp
2204 Added in version 249\&.
2205 .RE
2206 .PP
2207 \fIConditionMemoryPressure=\fR, \fIConditionCPUPressure=\fR, \fIConditionIOPressure=\fR
2208 .RS 4
2209 Verify that the overall system (memory, CPU or IO) pressure is below or equal to a threshold\&. This setting takes a threshold value as argument\&. It can be specified as a simple percentage value, suffixed with
2210 "%", in which case the pressure will be measured as an average over the last five minutes before the attempt to start the unit is performed\&. Alternatively, the average timespan can also be specified using
2211 "/"
2212 as a separator, for example:
2213 "10%/1min"\&. The supported timespans match what the kernel provides, and are limited to
2214 "10sec",
2215 "1min"
2216 and
2217 "5min"\&. The
2218 "full"
2219 PSI will be checked first, and if not found
2220 "some"
2221 will be checked\&. For more details, see the documentation on
2222 \m[blue]\fBPSI (Pressure Stall Information)\fR\m[]\&\s-2\u[5]\d\s+2\&.
2223 .sp
2224 Optionally, the threshold value can be prefixed with the slice unit under which the pressure will be checked, followed by a
2225 ":"\&. If the slice unit is not specified, the overall system pressure will be measured, instead of a particular cgroup\*(Aqs\&.
2226 .sp
2227 Added in version 250\&.
2228 .RE
2229 .PP
2230 \fIConditionKernelModuleLoaded=\fR
2231 .RS 4
2232 Test whether the specified kernel module has been loaded and is already fully initialized\&.
2233 .sp
2234 Added in version 258\&.
2235 .RE
2236 .PP
2237 \fIAssertArchitecture=\fR, \fIAssertVirtualization=\fR, \fIAssertHost=\fR, \fIAssertKernelCommandLine=\fR, \fIAssertKernelVersion=\fR, \fIAssertVersion=\fR, \fIAssertCredential=\fR, \fIAssertEnvironment=\fR, \fIAssertSecurity=\fR, \fIAssertCapability=\fR, \fIAssertACPower=\fR, \fIAssertNeedsUpdate=\fR, \fIAssertFirstBoot=\fR, \fIAssertPathExists=\fR, \fIAssertPathExistsGlob=\fR, \fIAssertPathIsDirectory=\fR, \fIAssertPathIsSymbolicLink=\fR, \fIAssertPathIsMountPoint=\fR, \fIAssertPathIsReadWrite=\fR, \fIAssertPathIsEncrypted=\fR, \fIAssertDirectoryNotEmpty=\fR, \fIAssertFileNotEmpty=\fR, \fIAssertFileIsExecutable=\fR, \fIAssertUser=\fR, \fIAssertGroup=\fR, \fIAssertControlGroupController=\fR, \fIAssertMemory=\fR, \fIAssertCPUs=\fR, \fIAssertCPUFeature=\fR, \fIAssertOSRelease=\fR, \fIAssertMemoryPressure=\fR, \fIAssertCPUPressure=\fR, \fIAssertIOPressure=\fR, \fIAssertKernelModuleLoaded=\fR
2238 .RS 4
2239 Similar to the
2240 \fIConditionArchitecture=\fR,
2241 \fIConditionVirtualization=\fR, \&..., condition settings described above, these settings add assertion checks to the start\-up of the unit\&. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly)\&. Note that hitting a configured assertion does not cause the unit to enter the
2242 "failed"
2243 state (or in fact result in any state change of the unit), it affects only the job queued for it\&. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into\&.
2244 .sp
2245 Added in version 218\&.
2246 .RE
2247 .SH "MAPPING OF UNIT PROPERTIES TO THEIR INVERSES"
2248 .PP
2249 Unit settings that create a relationship with a second unit usually show up in properties of both units, for example in
2250 \fBsystemctl show\fR
2251 output\&. In some cases the name of the property is the same as the name of the configuration setting, but not always\&. This table lists the properties that are shown on two units which are connected through some dependency, and shows which property on "source" unit corresponds to which property on the "target" unit\&.
2252 .sp
2253 .it 1 an-trap
2254 .nr an-no-space-flag 1
2255 .nr an-break-flag 1
2256 .br
2257 .B Table\ \&4.\ \& "Forward" and "reverse" unit properties
2258 .TS
2259 allbox tab(:);
2260 lB lB lB s.
2261 T{
2262 "Forward" property
2263 T}:T{
2264 "Reverse" property
2265 T}:T{
2266 Where used
2267 T}
2268 .T&
2269 l l l s
2270 l l ^ ^
2271 l l l l
2272 l l l l
2273 l l l l
2274 l l l l
2275 l l l l
2276 l l l l
2277 l l l l
2278 l l l s
2279 l l l s
2280 l l ^ ^
2281 l l l s
2282 l l ^ ^
2283 l l l l.
2284 T{
2285 \fIBefore=\fR
2286 T}:T{
2287 \fIAfter=\fR
2288 T}:T{
2289 [Unit] section
2290 T}
2291 T{
2292 \fIAfter=\fR
2293 T}:T{
2294 \fIBefore=\fR
2295 T}::
2296 T{
2297 \fIRequires=\fR
2298 T}:T{
2299 \fIRequiredBy=\fR
2300 T}:T{
2301 [Unit] section
2302 T}:T{
2303 [Install] section
2304 T}
2305 T{
2306 \fIWants=\fR
2307 T}:T{
2308 \fIWantedBy=\fR
2309 T}:T{
2310 [Unit] section
2311 T}:T{
2312 [Install] section
2313 T}
2314 T{
2315 \fIUpholds=\fR
2316 T}:T{
2317 \fIUpheldBy=\fR
2318 T}:T{
2319 [Unit] section
2320 T}:T{
2321 [Install] section
2322 T}
2323 T{
2324 \fIPartOf=\fR
2325 T}:T{
2326 \fIConsistsOf=\fR
2327 T}:T{
2328 [Unit] section
2329 T}:T{
2330 an automatic property
2331 T}
2332 T{
2333 \fIBindsTo=\fR
2334 T}:T{
2335 \fIBoundBy=\fR
2336 T}:T{
2337 [Unit] section
2338 T}:T{
2339 an automatic property
2340 T}
2341 T{
2342 \fIRequisite=\fR
2343 T}:T{
2344 \fIRequisiteOf=\fR
2345 T}:T{
2346 [Unit] section
2347 T}:T{
2348 an automatic property
2349 T}
2350 T{
2351 \fIConflicts=\fR
2352 T}:T{
2353 \fIConflictedBy=\fR
2354 T}:T{
2355 [Unit] section
2356 T}:T{
2357 an automatic property
2358 T}
2359 T{
2360 \fITriggers=\fR
2361 T}:T{
2362 \fITriggeredBy=\fR
2363 T}:T{
2364 Automatic properties, see notes below
2365 T}
2366 T{
2367 \fIPropagatesReloadTo=\fR
2368 T}:T{
2369 \fIReloadPropagatedFrom=\fR
2370 T}:T{
2371 [Unit] section
2372 T}
2373 T{
2374 \fIReloadPropagatedFrom=\fR
2375 T}:T{
2376 \fIPropagatesReloadTo=\fR
2377 T}::
2378 T{
2379 \fIPropagatesStopTo=\fR
2380 T}:T{
2381 \fIStopPropagatedFrom=\fR
2382 T}:T{
2383 [Unit] section
2384 T}
2385 T{
2386 \fIStopPropagatedFrom=\fR
2387 T}:T{
2388 \fIPropagatesStopTo=\fR
2389 T}::
2390 T{
2391 \fIFollowing=\fR
2392 T}:T{
2393 n/a
2394 T}:T{
2395 An automatic property
2396 T}:T{
2397 \ \&
2398 T}
2399 .TE
2400 .sp 1
2401 .PP
2402 Note:
2403 \fIWantedBy=\fR,
2404 \fIRequiredBy=\fR, and
2405 \fIUpheldBy=\fR
2406 are used in the [Install] section to create symlinks in
2407 \&.wants/,
2408 \&.requires/, and
2409 \&.upholds/
2410 directories\&. They cannot be used directly as a unit configuration setting\&.
2411 .PP
2412 Note:
2413 \fIConsistsOf=\fR,
2414 \fIBoundBy=\fR,
2415 \fIRequisiteOf=\fR,
2416 \fIConflictedBy=\fR
2417 are created implicitly along with their reverses and cannot be specified directly\&.
2418 .PP
2419 Note:
2420 \fITriggers=\fR
2421 is created implicitly between a socket, path unit, or an automount unit, and the unit they activate\&. By default, a unit with the same name is triggered, but this can be overridden using
2422 \fISockets=\fR,
2423 \fIService=\fR, and
2424 \fIUnit=\fR
2425 settings\&. See
2426 \fBsystemd.service\fR(5),
2427 \fBsystemd.socket\fR(5),
2428 \fBsystemd.path\fR(5), and
2429 \fBsystemd.automount\fR(5)
2430 for details\&.
2431 \fITriggeredBy=\fR
2432 is created implicitly on the triggered unit\&.
2433 .PP
2434 Note:
2435 \fIFollowing=\fR
2436 is used to group device aliases and points to the "primary" device unit that systemd is using to track device state, usually corresponding to a sysfs path\&. It does not show up in the "target" unit\&.
2437 .SH "[INSTALL] SECTION OPTIONS"
2438 .PP
2439 Unit files may include an [Install] section, which carries installation information for the unit\&. This section is not interpreted by
2440 \fBsystemd\fR(1)
2441 during runtime; it is used by the
2442 \fBenable\fR
2443 and
2444 \fBdisable\fR
2445 commands of the
2446 \fBsystemctl\fR(1)
2447 tool during installation of a unit\&.
2448 .PP
2449 \fIAlias=\fR
2450 .RS 4
2451 A space\-separated list of additional names this unit shall be installed under\&. The names listed here must have the same suffix (i\&.e\&. type) as the unit filename\&. This option may be specified more than once, in which case all listed names are used\&. At installation time,
2452 \fBsystemctl enable\fR
2453 will create symlinks from these names to the unit filename\&. Note that not all unit types support such alias names, and this setting is not supported for them\&. Specifically, mount, slice, swap, and automount units do not support aliasing\&.
2454 .sp
2455 Added in version 201\&.
2456 .RE
2457 .PP
2458 \fIWantedBy=\fR, \fIRequiredBy=\fR, \fIUpheldBy=\fR
2459 .RS 4
2460 This option may be used more than once, or a space\-separated list of unit names may be given\&. A symbolic link is created in the
2461 \&.wants/,
2462 \&.requires/, or
2463 \&.upholds/
2464 directory of each of the listed units when this unit is installed by
2465 \fBsystemctl enable\fR\&. This has the effect of a dependency of type
2466 \fIWants=\fR,
2467 \fIRequires=\fR, or
2468 \fIUpholds=\fR
2469 being added from the listed unit to the current unit\&. See the description of the mentioned dependency types in the [Unit] section for details\&.
2470 .sp
2471 In case of template units listing non template units, the listing unit must have
2472 \fIDefaultInstance=\fR
2473 set, or
2474 \fBsystemctl enable\fR
2475 must be called with an instance name\&. The instance (default or specified) will be added to the
2476 \&.wants/,
2477 \&.requires/, or
2478 \&.upholds/
2479 list of the listed unit\&. For example,
2480 \fBWantedBy=getty\&.target\fR
2481 in a service
2482 getty@\&.service
2483 will result in
2484 \fBsystemctl enable getty@tty2\&.service\fR
2485 creating a
2486 getty\&.target\&.wants/getty@tty2\&.service
2487 link to
2488 getty@\&.service\&. This also applies to listing specific instances of templated units: this specific instance will gain the dependency\&. A template unit may also list a template unit, in which case a generic dependency will be added where each instance of the listing unit will have a dependency on an instance of the listed template with the same instance value\&. For example,
2489 \fBWantedBy=container@\&.target\fR
2490 in a service
2491 monitor@\&.service
2492 will result in
2493 \fBsystemctl enable monitor@\&.service\fR
2494 creating a
2495 container@\&.target\&.wants/monitor@\&.service
2496 link to
2497 monitor@\&.service, which applies to all instances of
2498 container@\&.target\&.
2499 .sp
2500 Added in version 201\&.
2501 .RE
2502 .PP
2503 \fIAlso=\fR
2504 .RS 4
2505 Additional units to install/deinstall when this unit is installed/deinstalled\&. If the user requests installation/deinstallation of a unit with this option configured,
2506 \fBsystemctl enable\fR
2507 and
2508 \fBsystemctl disable\fR
2509 will automatically install/uninstall units listed in this option as well\&.
2510 .sp
2511 This option may be used more than once, or a space\-separated list of unit names may be given\&.
2512 .sp
2513 Added in version 201\&.
2514 .RE
2515 .PP
2516 \fIDefaultInstance=\fR
2517 .RS 4
2518 In template unit files, this specifies for which instance the unit shall be enabled if the template is enabled without any explicitly set instance\&. This option has no effect in non\-template unit files\&. The specified string must be usable as instance identifier\&.
2519 .sp
2520 Added in version 215\&.
2521 .RE
2522 .PP
2523 The following specifiers are interpreted in the Install section: %a, %b, %B, %g, %G, %H, %i, %j, %l, %m, %n, %N, %o, %p, %u, %U, %v, %w, %W, %%\&. For their meaning see the next section\&.
2524 .SH "SPECIFIERS"
2525 .PP
2526 Many settings resolve specifiers which may be used to write generic unit files referring to runtime or unit parameters that are replaced when the unit files are loaded\&. Specifiers must be known and resolvable for the setting to be valid\&. The following specifiers are understood:
2527 .sp
2528 .it 1 an-trap
2529 .nr an-no-space-flag 1
2530 .nr an-break-flag 1
2531 .br
2532 .B Table\ \&5.\ \&Specifiers available in unit files
2533 .TS
2534 allbox tab(:);
2535 lB lB lB.
2536 T{
2537 Specifier
2538 T}:T{
2539 Meaning
2540 T}:T{
2541 Details
2542 T}
2543 .T&
2544 l l l
2545 l l l
2546 l l l
2547 l l l
2548 l l l
2549 l l l
2550 l l l
2551 l l l
2552 l l l
2553 l l l
2554 l l l
2555 l l l
2556 l l l
2557 l l l
2558 l l l
2559 l l l
2560 l l l
2561 l l l
2562 l l l
2563 l l l
2564 l l l
2565 l l l
2566 l l l
2567 l l l
2568 l l l
2569 l l l
2570 l l l
2571 l l l
2572 l l l
2573 l l l
2574 l l l
2575 l l l
2576 l l l
2577 l l l
2578 l l l
2579 l l l
2580 l l l
2581 l l l
2582 l l l
2583 l l l.
2584 T{
2585 "%a"
2586 T}:T{
2587 Architecture
2588 T}:T{
2589 A short string identifying the architecture of the local system\&. A string such as \fBx86\fR, \fBx86\-64\fR or \fBarm64\fR\&. See the architectures defined for \fIConditionArchitecture=\fR above for a full list\&.
2590 T}
2591 T{
2592 "%A"
2593 T}:T{
2594 Operating system image version
2595 T}:T{
2596 The operating system image version identifier of the running system, as read from the \fIIMAGE_VERSION=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
2597 T}
2598 T{
2599 "%b"
2600 T}:T{
2601 Boot ID
2602 T}:T{
2603 The boot ID of the running system, formatted as string\&. See \fBrandom\fR(4) for more information\&.
2604 T}
2605 T{
2606 "%B"
2607 T}:T{
2608 Operating system build ID
2609 T}:T{
2610 The operating system build identifier of the running system, as read from the \fIBUILD_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
2611 T}
2612 T{
2613 "%C"
2614 T}:T{
2615 Cache directory root
2616 T}:T{
2617 This is either /var/cache (for the system manager) or the path "$XDG_CACHE_HOME" resolves to (for user managers)\&.
2618 T}
2619 T{
2620 "%d"
2621 T}:T{
2622 Credentials directory
2623 T}:T{
2624 This is the value of the "$CREDENTIALS_DIRECTORY" environment variable if available\&. See section "Credentials" in \fBsystemd.exec\fR(5) for more information\&.
2625 T}
2626 T{
2627 "%D"
2628 T}:T{
2629 Shared data directory
2630 T}:T{
2631 This is either /usr/share/ (for the system manager) or the path "$XDG_DATA_HOME" resolves to (for user managers)\&.
2632 T}
2633 T{
2634 "%E"
2635 T}:T{
2636 Configuration directory root
2637 T}:T{
2638 This is either /etc/ (for the system manager) or the path "$XDG_CONFIG_HOME" resolves to (for user managers)\&.
2639 T}
2640 T{
2641 "%f"
2642 T}:T{
2643 Unescaped filename
2644 T}:T{
2645 This is either the unescaped instance name (if applicable) with / prepended (if applicable), or the unescaped prefix name prepended with /\&. This implements unescaping according to the rules for escaping absolute file system paths discussed above\&.
2646 T}
2647 T{
2648 "%g"
2649 T}:T{
2650 User group
2651 T}:T{
2652 This is the name of the group running the service manager instance\&. In case of the system manager this resolves to "root"\&.
2653 T}
2654 T{
2655 "%G"
2656 T}:T{
2657 User GID
2658 T}:T{
2659 This is the numeric GID of the user running the service manager instance\&. In case of the system manager this resolves to "0"\&.
2660 T}
2661 T{
2662 "%h"
2663 T}:T{
2664 User home directory
2665 T}:T{
2666 This is the home directory of the \fIuser running the service manager instance\fR\&. In case of the system manager this resolves to "/root"\&.
2667
2668 Note that this setting is \fInot\fR influenced by the \fIUser=\fR setting configurable in the [Service] section of the service unit\&.
2669 T}
2670 T{
2671 "%H"
2672 T}:T{
2673 Host name
2674 T}:T{
2675 The hostname of the running system at the point in time the unit configuration is loaded\&.
2676 T}
2677 T{
2678 "%i"
2679 T}:T{
2680 Instance name
2681 T}:T{
2682 For instantiated units this is the string between the first "@" character and the type suffix\&. Empty for non\-instantiated units\&.
2683 T}
2684 T{
2685 "%I"
2686 T}:T{
2687 Unescaped instance name
2688 T}:T{
2689 Same as "%i", but with escaping undone\&.
2690 T}
2691 T{
2692 "%j"
2693 T}:T{
2694 Final component of the prefix
2695 T}:T{
2696 This is the string between the last "\-" and the end of the prefix name\&. If there is no "\-", this is the same as "%p"\&.
2697 T}
2698 T{
2699 "%J"
2700 T}:T{
2701 Unescaped final component of the prefix
2702 T}:T{
2703 Same as "%j", but with escaping undone\&.
2704 T}
2705 T{
2706 "%l"
2707 T}:T{
2708 Short host name
2709 T}:T{
2710 The hostname of the running system at the point in time the unit configuration is loaded, truncated at the first dot to remove any domain component\&.
2711 T}
2712 T{
2713 "%L"
2714 T}:T{
2715 Log directory root
2716 T}:T{
2717 This is either /var/log (for the system manager) or the path \fI$XDG_STATE_HOME\fR resolves to with /log appended (for user managers)\&.
2718 T}
2719 T{
2720 "%m"
2721 T}:T{
2722 Machine ID
2723 T}:T{
2724 The machine ID of the running system, formatted as string\&. See \fBmachine-id\fR(5) for more information\&.
2725 T}
2726 T{
2727 "%M"
2728 T}:T{
2729 Operating system image identifier
2730 T}:T{
2731 The operating system image identifier of the running system, as read from the \fIIMAGE_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
2732 T}
2733 T{
2734 "%n"
2735 T}:T{
2736 Full unit name
2737 T}:T{
2738 \ \&
2739 T}
2740 T{
2741 "%N"
2742 T}:T{
2743 Full unit name
2744 T}:T{
2745 Same as "%n", but with the type suffix removed\&.
2746 T}
2747 T{
2748 "%o"
2749 T}:T{
2750 Operating system ID
2751 T}:T{
2752 The operating system identifier of the running system, as read from the \fIID=\fR field of /etc/os\-release\&. See \fBos-release\fR(5) for more information\&.
2753 T}
2754 T{
2755 "%p"
2756 T}:T{
2757 Prefix name
2758 T}:T{
2759 For instantiated units, this refers to the string before the first "@" character of the unit name\&. For non\-instantiated units, same as "%N"\&.
2760 T}
2761 T{
2762 "%P"
2763 T}:T{
2764 Unescaped prefix name
2765 T}:T{
2766 Same as "%p", but with escaping undone\&.
2767 T}
2768 T{
2769 "%q"
2770 T}:T{
2771 Pretty host name
2772 T}:T{
2773 The pretty hostname of the running system at the point in time the unit configuration is loaded, as read from the \fIPRETTY_HOSTNAME=\fR field of /etc/machine\-info\&. If not set, resolves to the short hostname\&. See \fBmachine-info\fR(5) for more information\&.
2774 T}
2775 T{
2776 "%s"
2777 T}:T{
2778 User shell
2779 T}:T{
2780 This is the shell of the user running the service manager instance\&.
2781 T}
2782 T{
2783 "%S"
2784 T}:T{
2785 State directory root
2786 T}:T{
2787 This is either /var/lib (for the system manager) or the path \fI$XDG_STATE_HOME\fR resolves to (for user managers)\&.
2788 T}
2789 T{
2790 "%t"
2791 T}:T{
2792 Runtime directory root
2793 T}:T{
2794 This is either /run/ (for the system manager) or the path "$XDG_RUNTIME_DIR" resolves to (for user managers)\&.
2795 T}
2796 T{
2797 "%T"
2798 T}:T{
2799 Directory for temporary files
2800 T}:T{
2801 This is either /tmp or the path "$TMPDIR", "$TEMP" or "$TMP" are set to\&. (Note that the directory may be specified without a trailing slash\&.)
2802 T}
2803 T{
2804 "%u"
2805 T}:T{
2806 User name
2807 T}:T{
2808 This is the name of the \fIuser running the service manager instance\fR\&. In case of the system manager this resolves to "root"\&.
2809
2810 Note that this setting is \fInot\fR influenced by the \fIUser=\fR setting configurable in the [Service] section of the service unit\&.
2811 T}
2812 T{
2813 "%U"
2814 T}:T{
2815 User UID
2816 T}:T{
2817 This is the numeric UID of the \fIuser running the service manager instance\fR\&. In case of the system manager this resolves to "0"\&.
2818
2819 Note that this setting is \fInot\fR influenced by the \fIUser=\fR setting configurable in the [Service] section of the service unit\&.
2820 T}
2821 T{
2822 "%v"
2823 T}:T{
2824 Kernel release
2825 T}:T{
2826 Identical to \fBuname \-r\fR output\&.
2827 T}
2828 T{
2829 "%V"
2830 T}:T{
2831 Directory for larger and persistent temporary files
2832 T}:T{
2833 This is either /var/tmp or the path "$TMPDIR", "$TEMP" or "$TMP" are set to\&. (Note that the directory may be specified without a trailing slash\&.)
2834 T}
2835 T{
2836 "%w"
2837 T}:T{
2838 Operating system version ID
2839 T}:T{
2840 The operating system version identifier of the running system, as read from the \fIVERSION_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
2841 T}
2842 T{
2843 "%W"
2844 T}:T{
2845 Operating system variant ID
2846 T}:T{
2847 The operating system variant identifier of the running system, as read from the \fIVARIANT_ID=\fR field of /etc/os\-release\&. If not set, resolves to an empty string\&. See \fBos-release\fR(5) for more information\&.
2848 T}
2849 T{
2850 "%y"
2851 T}:T{
2852 The path to the fragment
2853 T}:T{
2854 This is the path where the main part of the unit file is located\&. For linked unit files, the real path outside of the unit search directories is used\&. For units that do not have a fragment file, this specifier will raise an error\&.
2855 T}
2856 T{
2857 "%Y"
2858 T}:T{
2859 The directory of the fragment
2860 T}:T{
2861 This is the directory part of "%y"\&.
2862 T}
2863 T{
2864 "%%"
2865 T}:T{
2866 Single percent sign
2867 T}:T{
2868 Use "%%" in place of "%" to specify a single percent sign\&.
2869 T}
2870 .TE
2871 .sp 1
2872 .SH "EXAMPLES"
2873 .PP
2874 \fBExample\ \&1.\ \&Allowing units to be enabled\fR
2875 .PP
2876 The following snippet (highlighted) allows a unit (e\&.g\&.
2877 foo\&.service) to be enabled via
2878 \fBsystemctl enable\fR:
2879 .sp
2880 .if n \{\
2881 .RS 4
2882 .\}
2883 .nf
2884 [Unit]
2885 Description=Foo
2886
2887 [Service]
2888 ExecStart=/usr/sbin/foo\-daemon
2889
2890 \fI[Install]\fR
2891 \fIWantedBy=multi\-user\&.target\fR
2892 .fi
2893 .if n \{\
2894 .RE
2895 .\}
2896 .PP
2897 After running
2898 \fBsystemctl enable\fR, a symlink
2899 /etc/systemd/system/multi\-user\&.target\&.wants/foo\&.service
2900 linking to the actual unit will be created\&. It tells systemd to pull in the unit when starting
2901 multi\-user\&.target\&. The inverse
2902 \fBsystemctl disable\fR
2903 will remove that symlink again\&.
2904 .PP
2905 \fBExample\ \&2.\ \&Overriding vendor settings\fR
2906 .PP
2907 There are two methods of overriding vendor settings in unit files: copying the unit file from
2908 /usr/lib/systemd/system
2909 to
2910 /etc/systemd/system
2911 and modifying the chosen settings\&. Alternatively, one can create a directory named
2912 \fIunit\fR\&.d/
2913 within
2914 /etc/systemd/system
2915 and place a drop\-in file
2916 \fIname\fR\&.conf
2917 there that only changes the specific settings one is interested in\&. Note that multiple such drop\-in files are read if present, processed in lexicographic order of their filename\&.
2918 .PP
2919 The advantage of the first method is that one easily overrides the complete unit, the vendor unit is not parsed at all anymore\&. It has the disadvantage that improvements to the unit file by the vendor are not automatically incorporated on updates\&.
2920 .PP
2921 The advantage of the second method is that one only overrides the settings one specifically wants, where updates to the unit by the vendor automatically apply\&. This has the disadvantage that some future updates by the vendor might be incompatible with the local changes\&.
2922 .PP
2923 This also applies for user instances of systemd, but with different locations for the unit files\&. See the section on unit load paths for further details\&.
2924 .PP
2925 Suppose there is a vendor\-supplied unit
2926 /usr/lib/systemd/system/httpd\&.service
2927 with the following contents:
2928 .sp
2929 .if n \{\
2930 .RS 4
2931 .\}
2932 .nf
2933 [Unit]
2934 Description=Some HTTP Server
2935 After=remote\-fs\&.target sqldb\&.service
2936 Requires=sqldb\&.service
2937 AssertPathExists=/srv/webserver
2938
2939 [Service]
2940 Type=notify
2941 ExecStart=/usr/sbin/some\-fancy\-httpd\-server
2942 Nice=5
2943
2944 [Install]
2945 WantedBy=multi\-user\&.target
2946 .fi
2947 .if n \{\
2948 .RE
2949 .\}
2950 .PP
2951 Now one wants to change some settings as an administrator: firstly, in the local setup,
2952 /srv/webserver
2953 might not exist, because the HTTP server is configured to use
2954 /srv/www
2955 instead\&. Secondly, the local configuration makes the HTTP server also depend on a memory cache service,
2956 memcached\&.service, that should be pulled in (\fIRequires=\fR) and also be ordered appropriately (\fIAfter=\fR)\&. Thirdly, in order to harden the service a bit more, the administrator would like to set the
2957 \fIPrivateTmp=\fR
2958 setting (see
2959 \fBsystemd.exec\fR(5)
2960 for details)\&. And lastly, the administrator would like to reset the niceness of the service to its default value of 0\&.
2961 .PP
2962 The first possibility is to copy the unit file to
2963 /etc/systemd/system/httpd\&.service
2964 and change the chosen settings:
2965 .sp
2966 .if n \{\
2967 .RS 4
2968 .\}
2969 .nf
2970 [Unit]
2971 Description=Some HTTP Server
2972 After=remote\-fs\&.target sqldb\&.service \fImemcached\&.service\fR
2973 Requires=sqldb\&.service \fImemcached\&.service\fR
2974 AssertPathExists=\fI/srv/www\fR
2975
2976 [Service]
2977 Type=notify
2978 ExecStart=/usr/sbin/some\-fancy\-httpd\-server
2979 \fINice=0\fR
2980 \fIPrivateTmp=yes\fR
2981
2982 [Install]
2983 WantedBy=multi\-user\&.target
2984 .fi
2985 .if n \{\
2986 .RE
2987 .\}
2988 .PP
2989 Alternatively, the administrator could create a drop\-in file
2990 /etc/systemd/system/httpd\&.service\&.d/local\&.conf
2991 with the following contents:
2992 .sp
2993 .if n \{\
2994 .RS 4
2995 .\}
2996 .nf
2997 [Unit]
2998 After=memcached\&.service
2999 Requires=memcached\&.service
3000 # Reset all assertions and then re\-add the condition we want
3001 AssertPathExists=
3002 AssertPathExists=/srv/www
3003
3004 [Service]
3005 Nice=0
3006 PrivateTmp=yes
3007 .fi
3008 .if n \{\
3009 .RE
3010 .\}
3011 .PP
3012 Note that for drop\-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), such as
3013 \fIAssertPathExists=\fR
3014 (or e\&.g\&.
3015 \fIExecStart=\fR
3016 in service units), one needs to first clear the list before re\-adding all entries except the one that is to be removed\&. Dependencies (\fIAfter=\fR, etc\&.) cannot be reset to an empty list, so dependencies can only be added in drop\-ins\&. If you want to remove dependencies, you have to override the entire unit\&.
3017 .PP
3018 \fBExample\ \&3.\ \&Top level drop\-ins with template units\fR
3019 .PP
3020 Top level per\-type drop\-ins can be used to change some aspect of all units of a particular type\&. For example, by creating the
3021 /etc/systemd/system/service\&.d/
3022 directory with a drop\-in file, the contents of the drop\-in file can be applied to all service units\&. We can take this further by having the top\-level drop\-in instantiate a secondary helper unit\&. Consider for example the following set of units and drop\-in files where we install an
3023 \fIOnFailure=\fR
3024 dependency for all service units\&.
3025 .PP
3026 /etc/systemd/system/failure\-handler@\&.service:
3027 .sp
3028 .if n \{\
3029 .RS 4
3030 .\}
3031 .nf
3032 [Unit]
3033 Description=My Failure Handler For %i
3034
3035 [Service]
3036 Type=oneshot
3037 # Perform some special action for when %i exits unexpectedly\&.
3038 ExecStart=/usr/sbin/myfailurehandler %i
3039 .fi
3040 .if n \{\
3041 .RE
3042 .\}
3043 .PP
3044 We can then add an instance of
3045 failure\-handler@\&.service
3046 as an
3047 \fIOnFailure=\fR
3048 dependency for all service units\&.
3049 .PP
3050 /etc/systemd/system/service\&.d/10\-all\&.conf:
3051 .sp
3052 .if n \{\
3053 .RS 4
3054 .\}
3055 .nf
3056 [Unit]
3057 OnFailure=failure\-handler@%N\&.service
3058 .fi
3059 .if n \{\
3060 .RE
3061 .\}
3062 .PP
3063 Now, after running
3064 \fBsystemctl daemon\-reload\fR
3065 all services will have acquired an
3066 \fIOnFailure=\fR
3067 dependency on
3068 failure\-handler@%N\&.service\&. The template instance units will also have gained the dependency which results in the creation of a recursive dependency chain\&. systemd will try to detect these recursive dependency chains where a template unit directly and recursively depends on itself and will remove such dependencies automatically if it finds them\&. If systemd does not detect the recursive dependency chain, we can break the chain ourselves by disabling the drop\-in for the template instance units via a symlink to
3069 /dev/null:
3070 .sp
3071 .if n \{\
3072 .RS 4
3073 .\}
3074 .nf
3075 \fBmkdir /etc/systemd/system/failure\-handler@\&.service\&.d/\fR
3076 \fBln \-s /dev/null /etc/systemd/system/failure\-handler@\&.service\&.d/10\-all\&.conf\fR
3077 \fBsystemctl daemon\-reload\fR
3078 .fi
3079 .if n \{\
3080 .RE
3081 .\}
3082 .PP
3083 This ensures that if a
3084 failure\-handler@\&.service
3085 instance fails it will not trigger an instance named
3086 failure\-handler@failure\-handler\&.service\&.
3087 .SH "SEE ALSO"
3088 .PP
3089 \fBsystemd\fR(1), \fBsystemctl\fR(1), \fBsystemd-system.conf\fR(5), \fBsystemd.special\fR(7), \fBsystemd.service\fR(5), \fBsystemd.socket\fR(5), \fBsystemd.device\fR(5), \fBsystemd.mount\fR(5), \fBsystemd.automount\fR(5), \fBsystemd.swap\fR(5), \fBsystemd.target\fR(5), \fBsystemd.path\fR(5), \fBsystemd.timer\fR(5), \fBsystemd.scope\fR(5), \fBsystemd.slice\fR(5), \fBsystemd.time\fR(7), \fBsystemd-analyze\fR(1), \fBcapabilities\fR(7), \fBsystemd.directives\fR(7), \fBuname\fR(1)
3090 .SH "NOTES"
3091 .IP " 1." 4
3092 Interface Portability and Stability Promise
3093 .RS 4
3094 \%https://systemd.io/PORTABILITY_AND_STABILITY/
3095 .RE
3096 .IP " 2." 4
3097 ๐Ÿ’ฃ๐Ÿ’ฅ๐Ÿงจ๐Ÿ’ฅ๐Ÿ’ฅ๐Ÿ’ฃ Please note that those configuration files must be available at all times. If
3098 /usr/local/
3099 is a separate partition, it may not be available during early boot, and must not be used for configuration.
3100 .IP " 3." 4
3101 systemd and Storage Daemons for the Root File System
3102 .RS 4
3103 \%https://systemd.io/ROOT_STORAGE_DAEMONS
3104 .RE
3105 .IP " 4." 4
3106 System and Service Credentials
3107 .RS 4
3108 \%https://systemd.io/CREDENTIALS
3109 .RE
3110 .IP " 5." 4
3111 PSI (Pressure Stall Information)
3112 .RS 4
3113 \%https://docs.kernel.org/accounting/psi.html
3114 .RE