]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd.unit.xml
Merge pull request #14532 from poettering/namespace-dynamic-user-fix
[thirdparty/systemd.git] / man / systemd.unit.xml
1 <?xml version='1.0'?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
8
9 <refentry id="systemd.unit">
10
11 <refentryinfo>
12 <title>systemd.unit</title>
13 <productname>systemd</productname>
14 </refentryinfo>
15
16 <refmeta>
17 <refentrytitle>systemd.unit</refentrytitle>
18 <manvolnum>5</manvolnum>
19 </refmeta>
20
21 <refnamediv>
22 <refname>systemd.unit</refname>
23 <refpurpose>Unit configuration</refpurpose>
24 </refnamediv>
25
26 <refsynopsisdiv>
27 <para><filename><replaceable>service</replaceable>.service</filename>,
28 <filename><replaceable>socket</replaceable>.socket</filename>,
29 <filename><replaceable>device</replaceable>.device</filename>,
30 <filename><replaceable>mount</replaceable>.mount</filename>,
31 <filename><replaceable>automount</replaceable>.automount</filename>,
32 <filename><replaceable>swap</replaceable>.swap</filename>,
33 <filename><replaceable>target</replaceable>.target</filename>,
34 <filename><replaceable>path</replaceable>.path</filename>,
35 <filename><replaceable>timer</replaceable>.timer</filename>,
36 <filename><replaceable>slice</replaceable>.slice</filename>,
37 <filename><replaceable>scope</replaceable>.scope</filename></para>
38
39 <refsect2>
40 <title>System Unit Search Path</title>
41
42 <para><literallayout><filename>/etc/systemd/system.control/*</filename>
43 <filename>/run/systemd/system.control/*</filename>
44 <filename>/run/systemd/transient/*</filename>
45 <filename>/run/systemd/generator.early/*</filename>
46 <filename>/etc/systemd/system/*</filename>
47 <filename>/etc/systemd/systemd.attached/*</filename>
48 <filename>/run/systemd/system/*</filename>
49 <filename>/run/systemd/systemd.attached/*</filename>
50 <filename>/run/systemd/generator/*</filename>
51 <filename index='false'></filename>
52 <filename>/usr/lib/systemd/system/*</filename>
53 <filename>/run/systemd/generator.late/*</filename></literallayout></para>
54 </refsect2>
55
56 <refsect2>
57 <title>User Unit Search Path</title>
58 <para><literallayout><filename>~/.config/systemd/user.control/*</filename>
59 <filename>$XDG_RUNTIME_DIR/systemd/user.control/*</filename>
60 <filename>$XDG_RUNTIME_DIR/systemd/transient/*</filename>
61 <filename>$XDG_RUNTIME_DIR/systemd/generator.early/*</filename>
62 <filename>~/.config/systemd/user/*</filename>
63 <filename>/etc/systemd/user/*</filename>
64 <filename>$XDG_RUNTIME_DIR/systemd/user/*</filename>
65 <filename>/run/systemd/user/*</filename>
66 <filename>$XDG_RUNTIME_DIR/systemd/generator/*</filename>
67 <filename>~/.local/share/systemd/user/*</filename>
68 <filename index='false'></filename>
69 <filename>/usr/lib/systemd/user/*</filename>
70 <filename>$XDG_RUNTIME_DIR/systemd/generator.late/*</filename></literallayout></para>
71 </refsect2>
72
73 </refsynopsisdiv>
74
75 <refsect1>
76 <title>Description</title>
77
78 <para>A unit file is a plain text ini-style file that encodes information about a service, a
79 socket, a device, a mount point, an automount point, a swap file or partition, a start-up
80 target, a watched file system path, a timer controlled and supervised by
81 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, a
82 resource management slice or a group of externally created processes. See
83 <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>5</manvolnum></citerefentry>
84 for a general description of the syntax.</para>
85
86 <para>This man page lists the common configuration options of all
87 the unit types. These options need to be configured in the [Unit]
88 or [Install] sections of the unit files.</para>
89
90 <para>In addition to the generic [Unit] and [Install] sections
91 described here, each unit may have a type-specific section, e.g.
92 [Service] for a service unit. See the respective man pages for
93 more information:
94 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
95 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
96 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
97 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
98 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
99 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
100 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
101 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
102 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
103 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
104 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
105 </para>
106
107 <para>Unit files are loaded from a set of paths determined during compilation, described in the next
108 section.</para>
109
110 <para>Valid unit names consist of a "name prefix" and a dot and a suffix specifying the unit type. The
111 "unit prefix" must consist of one or more valid characters (ASCII letters, digits, <literal>:</literal>,
112 <literal>-</literal>, <literal>_</literal>, <literal>.</literal>, and <literal>\</literal>). The total
113 length of the unit name including the suffix must not exceed 256 characters. The type suffix must be one
114 of <literal>.service</literal>, <literal>.socket</literal>, <literal>.device</literal>,
115 <literal>.mount</literal>, <literal>.automount</literal>, <literal>.swap</literal>,
116 <literal>.target</literal>, <literal>.path</literal>, <literal>.timer</literal>,
117 <literal>.slice</literal>, or <literal>.scope</literal>.</para>
118
119 <para>Units names can be parameterized by a single argument called the "instance name". The unit is then
120 constructed based on a "template file" which serves as the definition of multiple services or other
121 units. A template unit must have a single <literal>@</literal> at the end of the name (right before the
122 type suffix). The name of the full unit is formed by inserting the instance name between
123 <literal>@</literal> and the unit type suffix. In the unit file itself, the instance parameter may be
124 referred to using <literal>%i</literal> and other specifiers, see below.</para>
125
126 <para>Unit files may contain additional options on top of those
127 listed here. If systemd encounters an unknown option, it will
128 write a warning log message but continue loading the unit. If an
129 option or section name is prefixed with <option>X-</option>, it is
130 ignored completely by systemd. Options within an ignored section
131 do not need the prefix. Applications may use this to include
132 additional information in the unit files.</para>
133
134 <para>Units can be aliased (have an alternative name), by creating a symlink from the new name to the
135 existing name in one of the unit search paths. For example, <filename>systemd-networkd.service</filename>
136 has the alias <filename>dbus-org.freedesktop.network1.service</filename>, created during installation as
137 a symlink, so when <command>systemd</command> is asked through D-Bus to load
138 <filename>dbus-org.freedesktop.network1.service</filename>, it'll load
139 <filename>systemd-networkd.service</filename>. Alias names may be used in commands like
140 <command>disable</command>, <command>start</command>, <command>stop</command>, <command>status</command>,
141 and similar, and in all unit dependency directives, including <varname>Wants=</varname>,
142 <varname>Requires=</varname>, <varname>Before=</varname>, <varname>After=</varname>. Aliases cannot be
143 used with the <command>preset</command> command.</para>
144
145 <para>Unit files may specify aliases through the <varname>Alias=</varname> directive in the [Install]
146 section. When the unit is enabled, symlinks will be created for those names, and removed when the unit is
147 disabled. For example, <filename>reboot.target</filename> specifies
148 <varname>Alias=ctrl-alt-del.target</varname>, so when enabled, the symlink
149 <filename>/etc/systemd/systemd/ctrl-alt-del.service</filename> pointing to the
150 <filename>reboot.target</filename> file will be created, and when
151 <keycombo><keycap>Ctrl</keycap><keycap>Alt</keycap><keycap>Del</keycap></keycombo> is invoked,
152 <command>systemd</command> will look for the <filename>ctrl-alt-del.service</filename> and execute
153 <filename>reboot.service</filename>. <command>systemd</command> does not look at the [Install] section at
154 all during normal operation, so any directives in that section only have an effect through the symlinks
155 created during enablement.</para>
156
157 <para>Along with a unit file <filename>foo.service</filename>, the directory
158 <filename>foo.service.wants/</filename> may exist. All unit files symlinked from such a directory are
159 implicitly added as dependencies of type <varname>Wants=</varname> to the unit. Similar functionality
160 exists for <varname>Requires=</varname> type dependencies as well, the directory suffix is
161 <filename>.requires/</filename> in this case. This functionality is useful to hook units into the
162 start-up of other units, without having to modify their unit files. For details about the semantics of
163 <varname>Wants=</varname>, see below. The preferred way to create symlinks in the
164 <filename>.wants/</filename> or <filename>.requires/</filename> directory of a unit file is by embedding
165 the dependency in [Install] section of the target unit, and creating the symlink in the file system with
166 the <command>enable</command> or <command>preset</command> commands of
167 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
168
169 <para>Along with a unit file <filename>foo.service</filename>, a "drop-in" directory
170 <filename>foo.service.d/</filename> may exist. All files with the suffix <literal>.conf</literal> from this
171 directory will be parsed after the unit file itself is parsed. This is useful to alter or add configuration
172 settings for a unit, without having to modify unit files. Drop-in files must contain appropriate section
173 headers. For instantiated units, this logic will first look for the instance <literal>.d/</literal> subdirectory
174 (e.g. <literal>foo@bar.service.d/</literal>) and read its <literal>.conf</literal> files, followed by the template
175 <literal>.d/</literal> subdirectory (e.g. <literal>foo@.service.d/</literal>) and the <literal>.conf</literal>
176 files there. Moreover for units names containing dashes (<literal>-</literal>), the set of directories generated by
177 truncating the unit name after all dashes is searched too. Specifically, for a unit name
178 <filename>foo-bar-baz.service</filename> not only the regular drop-in directory
179 <filename>foo-bar-baz.service.d/</filename> is searched but also both <filename>foo-bar-.service.d/</filename> and
180 <filename>foo-.service.d/</filename>. This is useful for defining common drop-ins for a set of related units, whose
181 names begin with a common prefix. This scheme is particularly useful for mount, automount and slice units, whose
182 systematic naming structure is built around dashes as component separators. Note that equally named drop-in files
183 further down the prefix hierarchy override those further up,
184 i.e. <filename>foo-bar-.service.d/10-override.conf</filename> overrides
185 <filename>foo-.service.d/10-override.conf</filename>.</para>
186
187 <para>In addition to <filename>/etc/systemd/system</filename>, the drop-in <literal>.d/</literal>
188 directories for system services can be placed in <filename>/usr/lib/systemd/system</filename> or
189 <filename>/run/systemd/system</filename> directories. Drop-in files in <filename>/etc</filename>
190 take precedence over those in <filename>/run</filename> which in turn take precedence over those
191 in <filename>/usr/lib</filename>. Drop-in files under any of these directories take precedence
192 over unit files wherever located. Multiple drop-in files with different names are applied in
193 lexicographic order, regardless of which of the directories they reside in.</para>
194
195 <para>Units also support a top-level drop-in with <filename><replaceable>type</replaceable>.d/</filename>,
196 where <replaceable>type</replaceable> may be e.g. <literal>service</literal> or <literal>socket</literal>,
197 that allows altering or adding to the settings of all corresponding unit files on the system.
198 The formatting and precedence of applying drop-in configurations follow what is defined above.
199 Configurations in <filename><replaceable>type</replaceable>.d/</filename> have the lowest precedence
200 compared to settings in the name specific override directories. So the contents of
201 <filename>foo-.service.d/10-override.conf</filename> would override
202 <filename>service.d/10-override.conf</filename>.</para>
203
204 <!-- Note that we do not document .include here, as we consider it mostly obsolete, and want
205 people to use .d/ drop-ins instead. -->
206
207 <para>Note that while systemd offers a flexible dependency system
208 between units it is recommended to use this functionality only
209 sparingly and instead rely on techniques such as bus-based or
210 socket-based activation which make dependencies implicit,
211 resulting in a both simpler and more flexible system.</para>
212
213 <para>As mentioned above, a unit may be instantiated from a template file. This allows creation
214 of multiple units from a single configuration file. If systemd looks for a unit configuration
215 file, it will first search for the literal unit name in the file system. If that yields no
216 success and the unit name contains an <literal>@</literal> character, systemd will look for a
217 unit template that shares the same name but with the instance string (i.e. the part between the
218 <literal>@</literal> character and the suffix) removed. Example: if a service
219 <filename>getty@tty3.service</filename> is requested and no file by that name is found, systemd
220 will look for <filename>getty@.service</filename> and instantiate a service from that
221 configuration file if it is found.</para>
222
223 <para>To refer to the instance string from within the
224 configuration file you may use the special <literal>%i</literal>
225 specifier in many of the configuration options. See below for
226 details.</para>
227
228 <para>If a unit file is empty (i.e. has the file size 0) or is
229 symlinked to <filename>/dev/null</filename>, its configuration
230 will not be loaded and it appears with a load state of
231 <literal>masked</literal>, and cannot be activated. Use this as an
232 effective way to fully disable a unit, making it impossible to
233 start it even manually.</para>
234
235 <para>The unit file format is covered by the
236 <ulink
237 url="https://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise">Interface
238 Stability Promise</ulink>.</para>
239
240 </refsect1>
241
242 <refsect1>
243 <title>String Escaping for Inclusion in Unit Names</title>
244
245 <para>Sometimes it is useful to convert arbitrary strings into unit names. To facilitate this, a method of string
246 escaping is used, in order to map strings containing arbitrary byte values (except NUL) into valid unit names and
247 their restricted character set. A common special case are unit names that reflect paths to objects in the file
248 system hierarchy. Example: a device unit <filename>dev-sda.device</filename> refers to a device with the device
249 node <filename index="false">/dev/sda</filename> in the file system.</para>
250
251 <para>The escaping algorithm operates as follows: given a string, any <literal>/</literal> character is replaced by
252 <literal>-</literal>, and all other characters which are not ASCII alphanumerics or <literal>_</literal> are
253 replaced by C-style <literal>\x2d</literal> escapes. In addition, <literal>.</literal> is replaced with such a
254 C-style escape when it would appear as the first character in the escaped string.</para>
255
256 <para>When the input qualifies as absolute file system path, this algorithm is extended slightly: the path to the
257 root directory <literal>/</literal> is encoded as single dash <literal>-</literal>. In addition, any leading,
258 trailing or duplicate <literal>/</literal> characters are removed from the string before transformation. Example:
259 <filename>/foo//bar/baz/</filename> becomes <literal>foo-bar-baz</literal>.</para>
260
261 <para>This escaping is fully reversible, as long as it is known whether the escaped string was a path (the
262 unescaping results are different for paths and non-path strings). The
263 <citerefentry><refentrytitle>systemd-escape</refentrytitle><manvolnum>1</manvolnum></citerefentry> command may be
264 used to apply and reverse escaping on arbitrary strings. Use <command>systemd-escape --path</command> to escape
265 path strings, and <command>systemd-escape</command> without <option>--path</option> otherwise.</para>
266 </refsect1>
267
268 <refsect1>
269 <title>Automatic dependencies</title>
270
271 <refsect2>
272 <title>Implicit Dependencies</title>
273
274 <para>A number of unit dependencies are implicitly established, depending on unit type and
275 unit configuration. These implicit dependencies can make unit configuration file cleaner. For
276 the implicit dependencies in each unit type, please refer to section "Implicit Dependencies"
277 in respective man pages.</para>
278
279 <para>For example, service units with <varname>Type=dbus</varname> automatically acquire
280 dependencies of type <varname>Requires=</varname> and <varname>After=</varname> on
281 <filename>dbus.socket</filename>. See
282 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
283 for details.</para>
284 </refsect2>
285
286 <refsect2>
287 <title>Default Dependencies</title>
288
289 <para>Default dependencies are similar to implicit dependencies, but can be turned on and off
290 by setting <varname>DefaultDependencies=</varname> to <varname>yes</varname> (the default) and
291 <varname>no</varname>, while implicit dependencies are always in effect. See section "Default
292 Dependencies" in respective man pages for the effect of enabling
293 <varname>DefaultDependencies=</varname> in each unit types.</para>
294
295 <para>For example, target units will complement all configured dependencies of type
296 <varname>Wants=</varname> or <varname>Requires=</varname> with dependencies of type
297 <varname>After=</varname> unless <varname>DefaultDependencies=no</varname> is set in the
298 specified units. See
299 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>
300 for details. Note that this behavior can be turned off by setting
301 <varname>DefaultDependencies=no</varname>.</para>
302 </refsect2>
303 </refsect1>
304
305 <refsect1>
306 <title>Unit File Load Path</title>
307
308 <para>Unit files are loaded from a set of paths determined during
309 compilation, described in the two tables below. Unit files found
310 in directories listed earlier override files with the same name in
311 directories lower in the list.</para>
312
313 <para>When the variable <varname>$SYSTEMD_UNIT_PATH</varname> is set,
314 the contents of this variable overrides the unit load path. If
315 <varname>$SYSTEMD_UNIT_PATH</varname> ends with an empty component
316 (<literal>:</literal>), the usual unit load path will be appended
317 to the contents of the variable.</para>
318
319 <table>
320 <title>
321 Load path when running in system mode (<option>--system</option>).
322 </title>
323
324 <tgroup cols='2'>
325 <colspec colname='path' />
326 <colspec colname='expl' />
327 <thead>
328 <row>
329 <entry>Path</entry>
330 <entry>Description</entry>
331 </row>
332 </thead>
333 <tbody>
334 <row>
335 <entry><filename>/etc/systemd/system.control</filename></entry>
336 <entry morerows="1">Persistent and transient configuration created using the dbus API</entry>
337 </row>
338 <row>
339 <entry><filename>/run/systemd/system.control</filename></entry>
340 </row>
341 <row>
342 <entry><filename>/run/systemd/transient</filename></entry>
343 <entry>Dynamic configuration for transient units</entry>
344 </row>
345 <row>
346 <entry><filename>/run/systemd/generator.early</filename></entry>
347 <entry>Generated units with high priority (see <replaceable>early-dir</replaceable> in <citerefentry
348 ><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
349 </row>
350 <row>
351 <entry><filename>/etc/systemd/system</filename></entry>
352 <entry>System units created by the administrator</entry>
353 </row>
354 <row>
355 <entry><filename>/run/systemd/system</filename></entry>
356 <entry>Runtime units</entry>
357 </row>
358 <row>
359 <entry><filename>/run/systemd/generator</filename></entry>
360 <entry>Generated units with medium priority (see <replaceable>normal-dir</replaceable> in <citerefentry
361 ><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
362 </row>
363 <row>
364 <entry><filename>/usr/local/lib/systemd/system</filename></entry>
365 <entry>System units installed by the administrator </entry>
366 </row>
367 <row>
368 <entry><filename>/usr/lib/systemd/system</filename></entry>
369 <entry>System units installed by the distribution package manager</entry>
370 </row>
371 <row>
372 <entry><filename>/run/systemd/generator.late</filename></entry>
373 <entry>Generated units with low priority (see <replaceable>late-dir</replaceable> in <citerefentry
374 ><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
375 </row>
376 </tbody>
377 </tgroup>
378 </table>
379
380 <table>
381 <title>
382 Load path when running in user mode (<option>--user</option>).
383 </title>
384
385 <tgroup cols='2'>
386 <colspec colname='path' />
387 <colspec colname='expl' />
388 <thead>
389 <row>
390 <entry>Path</entry>
391 <entry>Description</entry>
392 </row>
393 </thead>
394 <tbody>
395 <row>
396 <entry><filename>$XDG_CONFIG_HOME/systemd/user.control</filename> or <filename
397 >~/.config/systemd/user.control</filename></entry>
398 <entry morerows="1">Persistent and transient configuration created using the dbus API (<varname>$XDG_CONFIG_HOME</varname> is used if set, <filename>~/.config</filename> otherwise)</entry>
399 </row>
400 <row>
401 <entry><filename>$XDG_RUNTIME_DIR/systemd/user.control</filename></entry>
402 </row>
403 <row>
404 <entry><filename>/run/systemd/transient</filename></entry>
405 <entry>Dynamic configuration for transient units</entry>
406 </row>
407 <row>
408 <entry><filename>/run/systemd/generator.early</filename></entry>
409 <entry>Generated units with high priority (see <replaceable>early-dir</replaceable> in <citerefentry
410 ><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
411 </row>
412 <row>
413 <entry><filename>$XDG_CONFIG_HOME/systemd/user</filename> or <filename>$HOME/.config/systemd/user</filename></entry>
414 <entry>User configuration (<varname>$XDG_CONFIG_HOME</varname> is used if set, <filename>~/.config</filename> otherwise)</entry>
415 </row>
416 <row>
417 <entry><filename>/etc/systemd/user</filename></entry>
418 <entry>User units created by the administrator</entry>
419 </row>
420 <row>
421 <entry><filename>$XDG_RUNTIME_DIR/systemd/user</filename></entry>
422 <entry>Runtime units (only used when $XDG_RUNTIME_DIR is set)</entry>
423 </row>
424 <row>
425 <entry><filename>/run/systemd/user</filename></entry>
426 <entry>Runtime units</entry>
427 </row>
428 <row>
429 <entry><filename>$XDG_RUNTIME_DIR/systemd/generator</filename></entry>
430 <entry>Generated units with medium priority (see <replaceable>normal-dir</replaceable> in <citerefentry
431 ><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
432 </row>
433 <row>
434 <entry><filename>$XDG_DATA_HOME/systemd/user</filename> or <filename>$HOME/.local/share/systemd/user</filename></entry>
435 <entry>Units of packages that have been installed in the home directory (<varname>$XDG_DATA_HOME</varname> is used if set, <filename>~/.local/share</filename> otherwise)</entry>
436 </row>
437 <row>
438 <entry><filename>$dir/systemd/user</filename> for each <varname index="false">$dir</varname> in <varname>$XDG_DATA_DIRS</varname></entry>
439 <entry>Additional locations for installed user units, one for each entry in <varname>$XDG_DATA_DIRS</varname></entry>
440 </row>
441 <row>
442 <entry><filename>/usr/local/lib/systemd/user</filename></entry>
443 <entry>User units installed by the administrator</entry>
444 </row>
445 <row>
446 <entry><filename>/usr/lib/systemd/user</filename></entry>
447 <entry>User units installed by the distribution package manager</entry>
448 </row>
449 <row>
450 <entry><filename>$XDG_RUNTIME_DIR/systemd/generator.late</filename></entry>
451 <entry>Generated units with low priority (see <replaceable>late-dir</replaceable> in <citerefentry
452 ><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
453 </row>
454 </tbody>
455 </tgroup>
456 </table>
457
458 <para>The set of load paths for the user manager instance may be augmented or
459 changed using various environment variables. And environment variables may in
460 turn be set using environment generators, see
461 <citerefentry><refentrytitle>systemd.environment-generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
462 In particular, <varname>$XDG_DATA_HOME</varname> and
463 <varname>$XDG_DATA_DIRS</varname> may be easily set using
464 <citerefentry><refentrytitle>systemd-environment-d-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
465 Thus, directories listed here are just the defaults. To see the actual list that
466 would be used based on compilation options and current environment use
467 <programlisting>systemd-analyze --user unit-paths</programlisting>
468 </para>
469
470 <para>Moreover, additional units might be loaded into systemd from
471 directories not on the unit load path by creating a symlink pointing to a
472 unit file in the directories. You can use <command>systemctl link</command>
473 for this operation. See
474 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
475 for its usage and precaution.
476 </para>
477 </refsect1>
478
479 <refsect1>
480 <title>Unit Garbage Collection</title>
481
482 <para>The system and service manager loads a unit's configuration automatically when a unit is referenced for the
483 first time. It will automatically unload the unit configuration and state again when the unit is not needed anymore
484 ("garbage collection"). A unit may be referenced through a number of different mechanisms:</para>
485
486 <orderedlist>
487 <listitem><para>Another loaded unit references it with a dependency such as <varname>After=</varname>,
488 <varname>Wants=</varname>, …</para></listitem>
489
490 <listitem><para>The unit is currently starting, running, reloading or stopping.</para></listitem>
491
492 <listitem><para>The unit is currently in the <constant>failed</constant> state. (But see below.)</para></listitem>
493
494 <listitem><para>A job for the unit is pending.</para></listitem>
495
496 <listitem><para>The unit is pinned by an active IPC client program.</para></listitem>
497
498 <listitem><para>The unit is a special "perpetual" unit that is always active and loaded. Examples for perpetual
499 units are the root mount unit <filename>-.mount</filename> or the scope unit <filename>init.scope</filename> that
500 the service manager itself lives in.</para></listitem>
501
502 <listitem><para>The unit has running processes associated with it.</para></listitem>
503 </orderedlist>
504
505 <para>The garbage collection logic may be altered with the <varname>CollectMode=</varname> option, which allows
506 configuration whether automatic unloading of units that are in <constant>failed</constant> state is permissible,
507 see below.</para>
508
509 <para>Note that when a unit's configuration and state is unloaded, all execution results, such as exit codes, exit
510 signals, resource consumption and other statistics are lost, except for what is stored in the log subsystem.</para>
511
512 <para>Use <command>systemctl daemon-reload</command> or an equivalent command to reload unit configuration while
513 the unit is already loaded. In this case all configuration settings are flushed out and replaced with the new
514 configuration (which however might not be in effect immediately), however all runtime state is
515 saved/restored.</para>
516 </refsect1>
517
518 <refsect1>
519 <title>[Unit] Section Options</title>
520
521 <para>The unit file may include a [Unit] section, which carries
522 generic information about the unit that is not dependent on the
523 type of unit:</para>
524
525 <variablelist class='unit-directives'>
526 <varlistentry>
527 <term><varname>Description=</varname></term>
528 <listitem><para>A human readable name for the unit. This is used by
529 <command>systemd</command> (and other UIs) as the label for the unit, so this string should
530 identify the unit rather than describe it, despite the name. <literal>Apache2 Web
531 Server</literal> is a good example. Bad examples are <literal>high-performance light-weight
532 HTTP server</literal> (too generic) or <literal>Apache2</literal> (too specific and
533 meaningless for people who do not know Apache). <command>systemd</command> will use this
534 string as a noun in status messages (<literal>Starting
535 <replaceable>description</replaceable>...</literal>, <literal>Started
536 <replaceable>description</replaceable>.</literal>, <literal>Reached target
537 <replaceable>description</replaceable>.</literal>, <literal>Failed to start
538 <replaceable>description</replaceable>.</literal>), so it should be capitalized, and should
539 not be a full sentence or a phrase with a continuous verb. Bad examples include
540 <literal>exiting the container</literal> or <literal>updating the database once per
541 day.</literal>.</para>
542 </listitem>
543 </varlistentry>
544
545 <varlistentry>
546 <term><varname>Documentation=</varname></term>
547 <listitem><para>A space-separated list of URIs referencing
548 documentation for this unit or its configuration. Accepted are
549 only URIs of the types <literal>http://</literal>,
550 <literal>https://</literal>, <literal>file:</literal>,
551 <literal>info:</literal>, <literal>man:</literal>. For more
552 information about the syntax of these URIs, see <citerefentry
553 project='man-pages'><refentrytitle>uri</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
554 The URIs should be listed in order of relevance, starting with
555 the most relevant. It is a good idea to first reference
556 documentation that explains what the unit's purpose is,
557 followed by how it is configured, followed by any other
558 related documentation. This option may be specified more than
559 once, in which case the specified list of URIs is merged. If
560 the empty string is assigned to this option, the list is reset
561 and all prior assignments will have no
562 effect.</para></listitem>
563 </varlistentry>
564
565 <varlistentry>
566 <term><varname>Wants=</varname></term>
567
568 <listitem><para>Configures requirement dependencies on other units. This option may be specified more
569 than once or multiple space-separated units may be specified in one option in which case dependencies
570 for all listed names will be created. Dependencies of this type may also be configured outside of the
571 unit configuration file by adding a symlink to a <filename>.wants/</filename> directory accompanying
572 the unit file. For details, see above.</para>
573
574 <para>Units listed in this option will be started if the configuring unit is. However, if the listed
575 units fail to start or cannot be added to the transaction, this has no impact on the validity of the
576 transaction as a whole, and this unit will still be started. This is the recommended way to hook
577 start-up of one unit to the start-up of another unit.</para>
578
579 <para>Note that requirement dependencies do not influence the order in which services are started or
580 stopped. This has to be configured independently with the <varname>After=</varname> or
581 <varname>Before=</varname> options. If unit <filename>foo.service</filename> pulls in unit
582 <filename>bar.service</filename> as configured with <varname>Wants=</varname> and no ordering is
583 configured with <varname>After=</varname> or <varname>Before=</varname>, then both units will be
584 started simultaneously and without any delay between them if <filename>foo.service</filename> is
585 activated.</para></listitem>
586 </varlistentry>
587
588 <varlistentry>
589 <term><varname>Requires=</varname></term>
590
591 <listitem><para>Similar to <varname>Wants=</varname>, but declares a stronger
592 dependency. Dependencies of this type may also be configured by adding a symlink to a
593 <filename>.requires/</filename> directory accompanying the unit file.</para>
594
595 <para>If this unit gets activated, the units listed will be activated as well. If one of
596 the other units fails to activate, and an ordering dependency <varname>After=</varname> on the
597 failing unit is set, this unit will not be started. Besides, with or without specifying
598 <varname>After=</varname>, this unit will be stopped if one of the other units is explicitly
599 stopped.</para>
600
601 <para>Often, it is a better choice to use <varname>Wants=</varname> instead of
602 <varname>Requires=</varname> in order to achieve a system that is more robust when dealing with
603 failing services.</para>
604
605 <para>Note that this dependency type does not imply that the other unit always has to be in active state when
606 this unit is running. Specifically: failing condition checks (such as <varname>ConditionPathExists=</varname>,
607 <varname>ConditionPathIsSymbolicLink=</varname>, … — see below) do not cause the start job of a unit with a
608 <varname>Requires=</varname> dependency on it to fail. Also, some unit types may deactivate on their own (for
609 example, a service process may decide to exit cleanly, or a device may be unplugged by the user), which is not
610 propagated to units having a <varname>Requires=</varname> dependency. Use the <varname>BindsTo=</varname>
611 dependency type together with <varname>After=</varname> to ensure that a unit may never be in active state
612 without a specific other unit also in active state (see below).</para></listitem>
613 </varlistentry>
614
615 <varlistentry>
616 <term><varname>Requisite=</varname></term>
617
618 <listitem><para>Similar to <varname>Requires=</varname>. However, if the units listed here
619 are not started already, they will not be started and the starting of this unit will fail
620 immediately. <varname>Requisite=</varname> does not imply an ordering dependency, even if
621 both units are started in the same transaction. Hence this setting should usually be
622 combined with <varname>After=</varname>, to ensure this unit is not started before the other
623 unit.</para>
624
625 <para>When <varname>Requisite=b.service</varname> is used on
626 <filename>a.service</filename>, this dependency will show as
627 <varname>RequisiteOf=a.service</varname> in property listing of
628 <filename>b.service</filename>. <varname>RequisiteOf=</varname>
629 dependency cannot be specified directly.</para>
630 </listitem>
631 </varlistentry>
632
633 <varlistentry>
634 <term><varname>BindsTo=</varname></term>
635
636 <listitem><para>Configures requirement dependencies, very similar in style to
637 <varname>Requires=</varname>. However, this dependency type is stronger: in addition to the effect of
638 <varname>Requires=</varname> it declares that if the unit bound to is stopped, this unit will be stopped
639 too. This means a unit bound to another unit that suddenly enters inactive state will be stopped too.
640 Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit
641 might terminate on its own choice, the backing device of a device unit might be unplugged or the mount point of
642 a mount unit might be unmounted without involvement of the system and service manager.</para>
643
644 <para>When used in conjunction with <varname>After=</varname> on the same unit the behaviour of
645 <varname>BindsTo=</varname> is even stronger. In this case, the unit bound to strictly has to be in active
646 state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly
647 enters inactive state, but also one that is bound to another unit that gets skipped due to a failed condition
648 check (such as <varname>ConditionPathExists=</varname>, <varname>ConditionPathIsSymbolicLink=</varname>, … —
649 see below) will be stopped, should it be running. Hence, in many cases it is best to combine
650 <varname>BindsTo=</varname> with <varname>After=</varname>.</para>
651
652 <para>When <varname>BindsTo=b.service</varname> is used on
653 <filename>a.service</filename>, this dependency will show as
654 <varname>BoundBy=a.service</varname> in property listing of
655 <filename>b.service</filename>. <varname>BoundBy=</varname>
656 dependency cannot be specified directly.</para>
657 </listitem>
658 </varlistentry>
659
660 <varlistentry>
661 <term><varname>PartOf=</varname></term>
662
663 <listitem><para>Configures dependencies similar to
664 <varname>Requires=</varname>, but limited to stopping and
665 restarting of units. When systemd stops or restarts the units
666 listed here, the action is propagated to this unit. Note that
667 this is a one-way dependency — changes to this unit do not
668 affect the listed units.</para>
669
670 <para>When <varname>PartOf=b.service</varname> is used on
671 <filename>a.service</filename>, this dependency will show as
672 <varname>ConsistsOf=a.service</varname> in property listing of
673 <filename>b.service</filename>. <varname>ConsistsOf=</varname>
674 dependency cannot be specified directly.</para>
675 </listitem>
676 </varlistentry>
677
678 <varlistentry>
679 <term><varname>Conflicts=</varname></term>
680
681 <listitem><para>A space-separated list of unit names. Configures negative requirement
682 dependencies. If a unit has a <varname>Conflicts=</varname> setting on another unit, starting the
683 former will stop the latter and vice versa.</para>
684
685 <para>Note that this setting does not imply an ordering dependency, similarly to the
686 <varname>Wants=</varname> and <varname>Requires=</varname> dependencies described above. This means
687 that to ensure that the conflicting unit is stopped before the other unit is started, an
688 <varname>After=</varname> or <varname>Before=</varname> dependency must be declared. It doesn't
689 matter which of the two ordering dependencies is used, because stop jobs are always ordered before
690 start jobs, see the discussion in <varname>Before=</varname>/<varname>After=</varname> below.</para>
691
692 <para>If unit A that conflicts with unit B is scheduled to
693 be started at the same time as B, the transaction will either
694 fail (in case both are required parts of the transaction) or be
695 modified to be fixed (in case one or both jobs are not a
696 required part of the transaction). In the latter case, the job
697 that is not required will be removed, or in case both are
698 not required, the unit that conflicts will be started and the
699 unit that is conflicted is stopped.</para></listitem>
700 </varlistentry>
701
702 <varlistentry>
703 <term><varname>Before=</varname></term>
704 <term><varname>After=</varname></term>
705
706 <listitem><para>These two settings expect a space-separated list of unit names. They may be specified
707 more than once, in which case dependencies for all listed names are created.</para>
708
709 <para>Those two setttings configure ordering dependencies between units. If unit
710 <filename>foo.service</filename> contains the setting <option>Before=bar.service</option> and both
711 units are being started, <filename>bar.service</filename>'s start-up is delayed until
712 <filename>foo.service</filename> has finished starting up. <varname>After=</varname> is the inverse
713 of <varname>Before=</varname>, i.e. while <varname>Before=</varname> ensures that the configured unit
714 is started before the listed unit begins starting up, <varname>After=</varname> ensures the opposite,
715 that the listed unit is fully started up before the configured unit is started.</para>
716
717 <para>When two units with an ordering dependency between them are shut down, the inverse of the
718 start-up order is applied. i.e. if a unit is configured with <varname>After=</varname> on another
719 unit, the former is stopped before the latter if both are shut down. Given two units with any
720 ordering dependency between them, if one unit is shut down and the other is started up, the shutdown
721 is ordered before the start-up. It doesn't matter if the ordering dependency is
722 <varname>After=</varname> or <varname>Before=</varname>, in this case. It also doesn't matter which
723 of the two is shut down, as long as one is shut down and the other is started up; the shutdown is
724 ordered before the start-up in all cases. If two units have no ordering dependencies between them,
725 they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit
726 type when precisely a unit has finished starting up. Most importantly, for service units start-up is
727 considered completed for the purpose of <varname>Before=</varname>/<varname>After=</varname> when all
728 its configured start-up commands have been invoked and they either failed or reported start-up
729 success.</para>
730
731 <para>Note that those settings are independent of and orthogonal to the requirement dependencies as
732 configured by <varname>Requires=</varname>, <varname>Wants=</varname>, <varname>Requisite=</varname>,
733 or <varname>BindsTo=</varname>. It is a common pattern to include a unit name in both the
734 <varname>After=</varname> and <varname>Wants=</varname> options, in which case the unit listed will
735 be started before the unit that is configured with these options.</para></listitem>
736 </varlistentry>
737
738 <varlistentry>
739 <term><varname>OnFailure=</varname></term>
740
741 <listitem><para>A space-separated list of one or more units
742 that are activated when this unit enters the
743 <literal>failed</literal> state. A service unit using
744 <varname>Restart=</varname> enters the failed state only after
745 the start limits are reached.</para></listitem>
746 </varlistentry>
747
748 <varlistentry>
749 <term><varname>PropagatesReloadTo=</varname></term>
750 <term><varname>ReloadPropagatedFrom=</varname></term>
751
752 <listitem><para>A space-separated list of one or more units
753 where reload requests on this unit will be propagated to, or
754 reload requests on the other unit will be propagated to this
755 unit, respectively. Issuing a reload request on a unit will
756 automatically also enqueue a reload request on all units that
757 the reload request shall be propagated to via these two
758 settings.</para></listitem>
759 </varlistentry>
760
761 <varlistentry>
762 <term><varname>JoinsNamespaceOf=</varname></term>
763
764 <listitem><para>For units that start processes (such as service units), lists one or more other units
765 whose network and/or temporary file namespace to join. This only applies to unit types which support
766 the <varname>PrivateNetwork=</varname>, <varname>NetworkNamespacePath=</varname> and
767 <varname>PrivateTmp=</varname> directives (see
768 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
769 details). If a unit that has this setting set is started, its processes will see the same
770 <filename>/tmp</filename>, <filename>/var/tmp</filename> and network namespace as one listed unit
771 that is started. If multiple listed units are already started, it is not defined which namespace is
772 joined. Note that this setting only has an effect if
773 <varname>PrivateNetwork=</varname>/<varname>NetworkNamespacePath=</varname> and/or
774 <varname>PrivateTmp=</varname> is enabled for both the unit that joins the namespace and the unit
775 whose namespace is joined.</para></listitem>
776 </varlistentry>
777
778 <varlistentry>
779 <term><varname>RequiresMountsFor=</varname></term>
780
781 <listitem><para>Takes a space-separated list of absolute
782 paths. Automatically adds dependencies of type
783 <varname>Requires=</varname> and <varname>After=</varname> for
784 all mount units required to access the specified path.</para>
785
786 <para>Mount points marked with <option>noauto</option> are not
787 mounted automatically through <filename>local-fs.target</filename>,
788 but are still honored for the purposes of this option, i.e. they
789 will be pulled in by this unit.</para></listitem>
790 </varlistentry>
791
792 <varlistentry>
793 <term><varname>OnFailureJobMode=</varname></term>
794
795 <listitem><para>Takes a value of
796 <literal>fail</literal>,
797 <literal>replace</literal>,
798 <literal>replace-irreversibly</literal>,
799 <literal>isolate</literal>,
800 <literal>flush</literal>,
801 <literal>ignore-dependencies</literal> or
802 <literal>ignore-requirements</literal>. Defaults to
803 <literal>replace</literal>. Specifies how the units listed in
804 <varname>OnFailure=</varname> will be enqueued. See
805 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
806 <option>--job-mode=</option> option for details on the
807 possible values. If this is set to <literal>isolate</literal>,
808 only a single unit may be listed in
809 <varname>OnFailure=</varname>..</para></listitem>
810 </varlistentry>
811
812 <varlistentry>
813 <term><varname>IgnoreOnIsolate=</varname></term>
814
815 <listitem><para>Takes a boolean argument. If <option>true</option>, this unit
816 will not be stopped when isolating another unit. Defaults to
817 <option>false</option> for service, target, socket, busname, timer, and path
818 units, and <option>true</option> for slice, scope, device, swap, mount, and
819 automount units.</para></listitem>
820 </varlistentry>
821
822 <varlistentry>
823 <term><varname>StopWhenUnneeded=</varname></term>
824
825 <listitem><para>Takes a boolean argument. If
826 <option>true</option>, this unit will be stopped when it is no
827 longer used. Note that, in order to minimize the work to be
828 executed, systemd will not stop units by default unless they
829 are conflicting with other units, or the user explicitly
830 requested their shut down. If this option is set, a unit will
831 be automatically cleaned up if no other active unit requires
832 it. Defaults to <option>false</option>.</para></listitem>
833 </varlistentry>
834
835 <varlistentry>
836 <term><varname>RefuseManualStart=</varname></term>
837 <term><varname>RefuseManualStop=</varname></term>
838
839 <listitem><para>Takes a boolean argument. If
840 <option>true</option>, this unit can only be activated or
841 deactivated indirectly. In this case, explicit start-up or
842 termination requested by the user is denied, however if it is
843 started or stopped as a dependency of another unit, start-up
844 or termination will succeed. This is mostly a safety feature
845 to ensure that the user does not accidentally activate units
846 that are not intended to be activated explicitly, and not
847 accidentally deactivate units that are not intended to be
848 deactivated. These options default to
849 <option>false</option>.</para></listitem>
850 </varlistentry>
851
852 <varlistentry>
853 <term><varname>AllowIsolate=</varname></term>
854
855 <listitem><para>Takes a boolean argument. If
856 <option>true</option>, this unit may be used with the
857 <command>systemctl isolate</command> command. Otherwise, this
858 will be refused. It probably is a good idea to leave this
859 disabled except for target units that shall be used similar to
860 runlevels in SysV init systems, just as a precaution to avoid
861 unusable system states. This option defaults to
862 <option>false</option>.</para></listitem>
863 </varlistentry>
864
865 <varlistentry>
866 <term><varname>DefaultDependencies=</varname></term>
867
868 <listitem><para>Takes a boolean argument. If
869 <option>yes</option>, (the default), a few default
870 dependencies will implicitly be created for the unit. The
871 actual dependencies created depend on the unit type. For
872 example, for service units, these dependencies ensure that the
873 service is started only after basic system initialization is
874 completed and is properly terminated on system shutdown. See
875 the respective man pages for details. Generally, only services
876 involved with early boot or late shutdown should set this
877 option to <option>no</option>. It is highly recommended to
878 leave this option enabled for the majority of common units. If
879 set to <option>no</option>, this option does not disable
880 all implicit dependencies, just non-essential
881 ones.</para></listitem>
882 </varlistentry>
883
884 <varlistentry>
885 <term><varname>CollectMode=</varname></term>
886
887 <listitem><para>Tweaks the "garbage collection" algorithm for this unit. Takes one of <option>inactive</option>
888 or <option>inactive-or-failed</option>. If set to <option>inactive</option> the unit will be unloaded if it is
889 in the <constant>inactive</constant> state and is not referenced by clients, jobs or other units — however it
890 is not unloaded if it is in the <constant>failed</constant> state. In <option>failed</option> mode, failed
891 units are not unloaded until the user invoked <command>systemctl reset-failed</command> on them to reset the
892 <constant>failed</constant> state, or an equivalent command. This behaviour is altered if this option is set to
893 <option>inactive-or-failed</option>: in this case the unit is unloaded even if the unit is in a
894 <constant>failed</constant> state, and thus an explicitly resetting of the <constant>failed</constant> state is
895 not necessary. Note that if this mode is used unit results (such as exit codes, exit signals, consumed
896 resources, …) are flushed out immediately after the unit completed, except for what is stored in the logging
897 subsystem. Defaults to <option>inactive</option>.</para>
898 </listitem>
899 </varlistentry>
900
901 <varlistentry>
902 <term><varname>FailureAction=</varname></term>
903 <term><varname>SuccessAction=</varname></term>
904
905 <listitem><para>Configure the action to take when the unit stops and enters a failed state or inactive state.
906 Takes one of <option>none</option>, <option>reboot</option>, <option>reboot-force</option>,
907 <option>reboot-immediate</option>, <option>poweroff</option>, <option>poweroff-force</option>,
908 <option>poweroff-immediate</option>, <option>exit</option>, and <option>exit-force</option>. In system mode,
909 all options are allowed. In user mode, only <option>none</option>, <option>exit</option>, and
910 <option>exit-force</option> are allowed. Both options default to <option>none</option>.</para>
911
912 <para>If <option>none</option> is set, no action will be triggered. <option>reboot</option> causes a reboot
913 following the normal shutdown procedure (i.e. equivalent to <command>systemctl reboot</command>).
914 <option>reboot-force</option> causes a forced reboot which will terminate all processes forcibly but should
915 cause no dirty file systems on reboot (i.e. equivalent to <command>systemctl reboot -f</command>) and
916 <option>reboot-immediate</option> causes immediate execution of the
917 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> system call, which
918 might result in data loss (i.e. equivalent to <command>systemctl reboot -ff</command>). Similarly,
919 <option>poweroff</option>, <option>poweroff-force</option>, <option>poweroff-immediate</option> have the effect
920 of powering down the system with similar semantics. <option>exit</option> causes the manager to exit following
921 the normal shutdown procedure, and <option>exit-force</option> causes it terminate without shutting down
922 services. When <option>exit</option> or <option>exit-force</option> is used by default the exit status of the
923 main process of the unit (if this applies) is returned from the service manager. However, this may be overridden
924 with <varname>FailureActionExitStatus=</varname>/<varname>SuccessActionExitStatus=</varname>, see
925 below.</para></listitem>
926 </varlistentry>
927
928 <varlistentry>
929 <term><varname>FailureActionExitStatus=</varname></term>
930 <term><varname>SuccessActionExitStatus=</varname></term>
931
932 <listitem><para>Controls the exit status to propagate back to an invoking container manager (in case of a
933 system service) or service manager (in case of a user manager) when the
934 <varname>FailureAction=</varname>/<varname>SuccessAction=</varname> are set to <option>exit</option> or
935 <option>exit-force</option> and the action is triggered. By default the exit status of the main process of the
936 triggering unit (if this applies) is propagated. Takes a value in the range 0255 or the empty string to
937 request default behaviour.</para></listitem>
938 </varlistentry>
939
940 <varlistentry>
941 <term><varname>JobTimeoutSec=</varname></term>
942 <term><varname>JobRunningTimeoutSec=</varname></term>
943
944 <listitem><para>When a job for this unit is queued, a timeout <varname>JobTimeoutSec=</varname> may be
945 configured. Similarly, <varname>JobRunningTimeoutSec=</varname> starts counting when the queued job is actually
946 started. If either time limit is reached, the job will be cancelled, the unit however will not change state or
947 even enter the <literal>failed</literal> mode. This value defaults to <literal>infinity</literal> (job timeouts
948 disabled), except for device units (<varname>JobRunningTimeoutSec=</varname> defaults to
949 <varname>DefaultTimeoutStartSec=</varname>). NB: this timeout is independent from any unit-specific timeout
950 (for example, the timeout set with <varname>TimeoutStartSec=</varname> in service units) as the job timeout has
951 no effect on the unit itself, only on the job that might be pending for it. Or in other words: unit-specific
952 timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however
953 is useful to abort only the job waiting for the unit state to change.</para>
954 </listitem>
955 </varlistentry>
956
957 <varlistentry>
958 <term><varname>JobTimeoutAction=</varname></term>
959 <term><varname>JobTimeoutRebootArgument=</varname></term>
960
961 <listitem><para><varname>JobTimeoutAction=</varname> optionally configures an additional action to take when
962 the timeout is hit, see description of <varname>JobTimeoutSec=</varname> and
963 <varname>JobRunningTimeoutSec=</varname> above. It takes the same values as
964 <varname>StartLimitAction=</varname>. Defaults to <option>none</option>.
965 <varname>JobTimeoutRebootArgument=</varname> configures an optional reboot string to pass to the
966 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> system call.
967 </para></listitem>
968 </varlistentry>
969
970 <varlistentry>
971 <term><varname>StartLimitIntervalSec=<replaceable>interval</replaceable></varname></term>
972 <term><varname>StartLimitBurst=<replaceable>burst</replaceable></varname></term>
973
974 <listitem><para>Configure unit start rate limiting. Units which are started more than
975 <replaceable>burst</replaceable> times within an <replaceable>interval</replaceable> time interval are not
976 permitted to start any more. Use <varname>StartLimitIntervalSec=</varname> to configure the checking interval
977 (defaults to <varname>DefaultStartLimitIntervalSec=</varname> in manager configuration file, set it to 0 to
978 disable any kind of rate limiting). Use <varname>StartLimitBurst=</varname> to configure how many starts per
979 interval are allowed (defaults to <varname>DefaultStartLimitBurst=</varname> in manager configuration
980 file). These configuration options are particularly useful in conjunction with the service setting
981 <varname>Restart=</varname> (see
982 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>); however,
983 they apply to all kinds of starts (including manual), not just those triggered by the
984 <varname>Restart=</varname> logic. Note that units which are configured for <varname>Restart=</varname> and
985 which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted
986 manually at a later point, after the <replaceable>interval</replaceable> has passed. From this point on, the
987 restart logic is activated again. Note that <command>systemctl reset-failed</command> will cause the restart
988 rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit
989 and the start limit interferes with that. Note that this rate-limiting is enforced after any unit condition
990 checks are executed, and hence unit activations with failing conditions do not count towards this rate
991 limit. This setting does not apply to slice, target, device, and scope units, since they are unit types whose
992 activation may either never fail, or may succeed only a single time.</para>
993
994 <para>When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are
995 flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously
996 has no effect.</para></listitem>
997 </varlistentry>
998
999 <varlistentry>
1000 <term><varname>StartLimitAction=</varname></term>
1001
1002 <listitem><para>Configure an additional action to take if the rate limit configured with
1003 <varname>StartLimitIntervalSec=</varname> and <varname>StartLimitBurst=</varname> is hit. Takes the same
1004 values as the setting <varname>FailureAction=</varname>/<varname>SuccessAction=</varname> settings and executes
1005 the same actions. If <option>none</option> is set, hitting the rate limit will trigger no action besides that
1006 the start will not be permitted. Defaults to <option>none</option>.</para></listitem>
1007 </varlistentry>
1008
1009 <varlistentry>
1010 <term><varname>RebootArgument=</varname></term>
1011 <listitem><para>Configure the optional argument for the
1012 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry> system call if
1013 <varname>StartLimitAction=</varname> or <varname>FailureAction=</varname> is a reboot action. This
1014 works just like the optional argument to <command>systemctl reboot</command> command.</para></listitem>
1015 </varlistentry>
1016
1017 <varlistentry>
1018 <term><varname>SourcePath=</varname></term>
1019 <listitem><para>A path to a configuration file this unit has
1020 been generated from. This is primarily useful for
1021 implementation of generator tools that convert configuration
1022 from an external configuration file format into native unit
1023 files. This functionality should not be used in normal
1024 units.</para></listitem>
1025 </varlistentry>
1026 </variablelist>
1027
1028 <refsect2>
1029 <title>Conditions and Asserts</title>
1030
1031 <para>Unit files may also include a number of <varname index="false">Condition…=</varname> and
1032 <varname index="false">Assert…=</varname> settings. Before the unit is started, systemd will verify
1033 that the specified conditions are true. If not, the starting of the unit will be (mostly silently)
1034 skipped. Failing conditions will not result in the unit being moved into the <literal>failed</literal>
1035 state. The conditions are checked at the time the queued start job is to be executed. The ordering
1036 dependencies are still respected, so other units are still pulled in and ordered as if this unit was
1037 successfully activated. Use condition expressions in order to skip units that do not apply to the local
1038 system, for example because the kernel or runtime environment doesn't require their functionality.
1039 </para>
1040
1041 <para>If multiple conditions are specified, the unit will be executed if all of them apply (i.e. a
1042 logical AND is applied). Condition checks can use a pipe symbol (<literal>|</literal>) after the equals
1043 sign (<literal>Condition…=|…</literal>), which causes the condition becomes a triggering condition. If
1044 at least one triggering condition is defined for a unit, then the unit will be executed if at least one
1045 of the triggering conditions apply and all of the non-triggering conditions. If you prefix an argument
1046 with the pipe symbol and an exclamation mark, the pipe symbol must be passed first, the exclamation
1047 second. If any of these options is assigned the empty string, the list of conditions is reset
1048 completely, all previous condition settings (of any kind) will have no effect.</para>
1049
1050 <para>The <varname>AssertArchitecture=</varname>, <varname>AssertVirtualization=</varname>, … options
1051 provide a similar mechanism that causes the job to fail (instead of being skipped). The failed check is
1052 logged. Units with failed conditions are considered to be in a clean state and will be garbage
1053 collected if they are not referenced. This means that when queried, the condition failure may or may
1054 not show up in the state of the unit.</para>
1055
1056 <para>Note that neither assertion nor condition expressions result in unit state changes. Also note
1057 that both are checked at the time the job is to be executed, i.e. long after depending jobs and it
1058 itself were queued. Thus, neither condition nor assertion expressions are suitable for conditionalizing
1059 unit dependencies.</para>
1060
1061 <para>The <command>condition</command> verb of
1062 <citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry> can
1063 be used to test condition and assert expressions.</para>
1064
1065 <para>Except for <varname>ConditionPathIsSymbolicLink=</varname>, all path checks follow symlinks.</para>
1066
1067 <variablelist class='unit-directives'>
1068 <!-- We do not document ConditionNull= here, as it is not particularly useful and probably just
1069 confusing. -->
1070
1071 <varlistentry>
1072 <term><varname>ConditionArchitecture=</varname></term>
1073
1074 <listitem><para>Check whether the system is running on a specific architecture. Takes one of
1075 <literal>x86</literal>,
1076 <literal>x86-64</literal>,
1077 <literal>ppc</literal>,
1078 <literal>ppc-le</literal>,
1079 <literal>ppc64</literal>,
1080 <literal>ppc64-le</literal>,
1081 <literal>ia64</literal>,
1082 <literal>parisc</literal>,
1083 <literal>parisc64</literal>,
1084 <literal>s390</literal>,
1085 <literal>s390x</literal>,
1086 <literal>sparc</literal>,
1087 <literal>sparc64</literal>,
1088 <literal>mips</literal>,
1089 <literal>mips-le</literal>,
1090 <literal>mips64</literal>,
1091 <literal>mips64-le</literal>,
1092 <literal>alpha</literal>,
1093 <literal>arm</literal>,
1094 <literal>arm-be</literal>,
1095 <literal>arm64</literal>,
1096 <literal>arm64-be</literal>,
1097 <literal>sh</literal>,
1098 <literal>sh64</literal>,
1099 <literal>m68k</literal>,
1100 <literal>tilegx</literal>,
1101 <literal>cris</literal>,
1102 <literal>arc</literal>,
1103 <literal>arc-be</literal>, or
1104 <literal>native</literal>.</para>
1105
1106 <para>The architecture is determined from the information returned by
1107 <citerefentry project='man-pages'><refentrytitle>uname</refentrytitle><manvolnum>2</manvolnum></citerefentry>
1108 and is thus subject to
1109 <citerefentry><refentrytitle>personality</refentrytitle><manvolnum>2</manvolnum></citerefentry>.
1110 Note that a <varname>Personality=</varname> setting in the same unit file has no effect on this
1111 condition. A special architecture name <literal>native</literal> is mapped to the architecture the
1112 system manager itself is compiled for. The test may be negated by prepending an exclamation
1113 mark.</para>
1114 </listitem>
1115 </varlistentry>
1116
1117 <varlistentry>
1118 <term><varname>ConditionVirtualization=</varname></term>
1119
1120 <listitem><para>Check whether the system is executed in a virtualized environment and optionally
1121 test whether it is a specific implementation. Takes either boolean value to check if being executed
1122 in any virtualized environment, or one of
1123 <literal>vm</literal> and
1124 <literal>container</literal> to test against a generic type of virtualization solution, or one of
1125 <literal>qemu</literal>,
1126 <literal>kvm</literal>,
1127 <literal>zvm</literal>,
1128 <literal>vmware</literal>,
1129 <literal>microsoft</literal>,
1130 <literal>oracle</literal>,
1131 <literal>xen</literal>,
1132 <literal>bochs</literal>,
1133 <literal>uml</literal>,
1134 <literal>bhyve</literal>,
1135 <literal>qnx</literal>,
1136 <literal>openvz</literal>,
1137 <literal>lxc</literal>,
1138 <literal>lxc-libvirt</literal>,
1139 <literal>systemd-nspawn</literal>,
1140 <literal>docker</literal>,
1141 <literal>podman</literal>,
1142 <literal>rkt</literal>,
1143 <literal>wsl</literal>,
1144 <literal>acrn</literal> to test
1145 against a specific implementation, or
1146 <literal>private-users</literal> to check whether we are running in a user namespace. See
1147 <citerefentry><refentrytitle>systemd-detect-virt</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1148 for a full list of known virtualization technologies and their identifiers. If multiple
1149 virtualization technologies are nested, only the innermost is considered. The test may be negated
1150 by prepending an exclamation mark.</para>
1151 </listitem>
1152 </varlistentry>
1153
1154 <varlistentry>
1155 <term><varname>ConditionHost=</varname></term>
1156
1157 <listitem><para><varname>ConditionHost=</varname> may be used to match against the hostname or
1158 machine ID of the host. This either takes a hostname string (optionally with shell style globs)
1159 which is tested against the locally set hostname as returned by
1160 <citerefentry><refentrytitle>gethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>, or
1161 a machine ID formatted as string (see
1162 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
1163 The test may be negated by prepending an exclamation mark.</para>
1164 </listitem>
1165 </varlistentry>
1166
1167 <varlistentry>
1168 <term><varname>ConditionKernelCommandLine=</varname></term>
1169
1170 <listitem><para><varname>ConditionKernelCommandLine=</varname> may be used to check whether a
1171 specific kernel command line option is set (or if prefixed with the exclamation mark — unset). The
1172 argument must either be a single word, or an assignment (i.e. two words, separated by
1173 <literal>=</literal>). In the former case the kernel command line is searched for the word
1174 appearing as is, or as left hand side of an assignment. In the latter case, the exact assignment is
1175 looked for with right and left hand side matching.</para>
1176 </listitem>
1177 </varlistentry>
1178
1179 <varlistentry>
1180 <term><varname>ConditionKernelVersion=</varname></term>
1181
1182 <listitem><para><varname>ConditionKernelVersion=</varname> may be used to check whether the kernel
1183 version (as reported by <command>uname -r</command>) matches a certain expression (or if prefixed
1184 with the exclamation mark does not match it). The argument must be a list of (potentially quoted)
1185 expressions. For each of the expressions, if it starts with one of <literal>&lt;</literal>,
1186 <literal>&lt;=</literal>, <literal>=</literal>, <literal>!=</literal>, <literal>&gt;=</literal>,
1187 <literal>&gt;</literal> a relative version comparison is done, otherwise the specified string is
1188 matched with shell-style globs.</para>
1189
1190 <para>Note that using the kernel version string is an unreliable way to determine which features
1191 are supported by a kernel, because of the widespread practice of backporting drivers, features, and
1192 fixes from newer upstream kernels into older versions provided by distributions. Hence, this check
1193 is inherently unportable and should not be used for units which may be used on different
1194 distributions.</para>
1195 </listitem>
1196 </varlistentry>
1197
1198 <varlistentry>
1199 <term><varname>ConditionSecurity=</varname></term>
1200
1201 <listitem><para><varname>ConditionSecurity=</varname> may be used to check whether the given
1202 security technology is enabled on the system. Currently, the recognized values are
1203 <literal>selinux</literal>, <literal>apparmor</literal>, <literal>tomoyo</literal>,
1204 <literal>ima</literal>, <literal>smack</literal>, <literal>audit</literal> and
1205 <literal>uefi-secureboot</literal>. The test may be negated by prepending an exclamation
1206 mark.</para>
1207 </listitem>
1208 </varlistentry>
1209
1210 <varlistentry>
1211 <term><varname>ConditionCapability=</varname></term>
1212
1213 <listitem><para>Check whether the given capability exists in the capability bounding set of the
1214 service manager (i.e. this does not check whether capability is actually available in the permitted
1215 or effective sets, see
1216 <citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
1217 for details). Pass a capability name such as <literal>CAP_MKNOD</literal>, possibly prefixed with
1218 an exclamation mark to negate the check.</para>
1219 </listitem>
1220 </varlistentry>
1221
1222 <varlistentry>
1223 <term><varname>ConditionACPower=</varname></term>
1224
1225 <listitem><para>Check whether the system has AC power, or is exclusively battery powered at the
1226 time of activation of the unit. This takes a boolean argument. If set to <literal>true</literal>,
1227 the condition will hold only if at least one AC connector of the system is connected to a power
1228 source, or if no AC connectors are known. Conversely, if set to <literal>false</literal>, the
1229 condition will hold only if there is at least one AC connector known and all AC connectors are
1230 disconnected from a power source.</para>
1231 </listitem>
1232 </varlistentry>
1233
1234 <varlistentry>
1235 <term><varname>ConditionNeedsUpdate=</varname></term>
1236
1237 <listitem><para>Takes one of <filename>/var</filename> or <filename>/etc</filename> as argument,
1238 possibly prefixed with a <literal>!</literal> (to inverting the condition). This condition may be
1239 used to conditionalize units on whether the specified directory requires an update because
1240 <filename>/usr</filename>'s modification time is newer than the stamp file
1241 <filename>.updated</filename> in the specified directory. This is useful to implement offline
1242 updates of the vendor operating system resources in <filename>/usr</filename> that require updating
1243 of <filename>/etc</filename> or <filename>/var</filename> on the next following boot. Units making
1244 use of this condition should order themselves before
1245 <citerefentry><refentrytitle>systemd-update-done.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
1246 to make sure they run before the stamp file's modification time gets reset indicating a completed
1247 update.</para>
1248 </listitem>
1249 </varlistentry>
1250
1251 <varlistentry>
1252 <term><varname>ConditionFirstBoot=</varname></term>
1253
1254 <listitem><para>Takes a boolean argument. This condition may be used to conditionalize units on
1255 whether the system is booting up with an unpopulated <filename>/etc</filename> directory
1256 (specifically: an <filename>/etc</filename> with no <filename>/etc/machine-id</filename>). This may
1257 be used to populate <filename>/etc</filename> on the first boot after factory reset, or when a new
1258 system instance boots up for the first time.</para>
1259 </listitem>
1260 </varlistentry>
1261
1262 <varlistentry>
1263 <term><varname>ConditionPathExists=</varname></term>
1264
1265 <listitem><para>Check for the exists of a file. If the specified absolute path name does not exist,
1266 the condition will fail. If the absolute path name passed to
1267 <varname>ConditionPathExists=</varname> is prefixed with an exclamation mark
1268 (<literal>!</literal>), the test is negated, and the unit is only started if the path does not
1269 exist.</para>
1270 </listitem>
1271 </varlistentry>
1272
1273 <varlistentry>
1274 <term><varname>ConditionPathExistsGlob=</varname></term>
1275
1276 <listitem><para><varname>ConditionPathExistsGlob=</varname> is similar to
1277 <varname>ConditionPathExists=</varname>, but checks for the existence of at least one file or
1278 directory matching the specified globbing pattern.</para>
1279 </listitem>
1280 </varlistentry>
1281
1282 <varlistentry>
1283 <term><varname>ConditionPathIsDirectory=</varname></term>
1284
1285 <listitem><para><varname>ConditionPathIsDirectory=</varname> is similar to
1286 <varname>ConditionPathExists=</varname> but verifies that a certain path exists and is a
1287 directory.</para>
1288 </listitem>
1289 </varlistentry>
1290
1291 <varlistentry>
1292 <term><varname>ConditionPathIsSymbolicLink=</varname></term>
1293
1294 <listitem><para><varname>ConditionPathIsSymbolicLink=</varname> is similar to
1295 <varname>ConditionPathExists=</varname> but verifies that a certain path exists and is a symbolic
1296 link.</para>
1297 </listitem>
1298 </varlistentry>
1299
1300 <varlistentry>
1301 <term><varname>ConditionPathIsMountPoint=</varname></term>
1302
1303 <listitem><para><varname>ConditionPathIsMountPoint=</varname> is similar to
1304 <varname>ConditionPathExists=</varname> but verifies that a certain path exists and is a mount
1305 point.</para>
1306 </listitem>
1307 </varlistentry>
1308
1309 <varlistentry>
1310 <term><varname>ConditionPathIsReadWrite=</varname></term>
1311
1312 <listitem><para><varname>ConditionPathIsReadWrite=</varname> is similar to
1313 <varname>ConditionPathExists=</varname> but verifies that the underlying file system is readable
1314 and writable (i.e. not mounted read-only).</para>
1315 </listitem>
1316 </varlistentry>
1317
1318 <varlistentry>
1319 <term><varname>ConditionDirectoryNotEmpty=</varname></term>
1320
1321 <listitem><para><varname>ConditionDirectoryNotEmpty=</varname> is similar to
1322 <varname>ConditionPathExists=</varname> but verifies that a certain path exists and is a non-empty
1323 directory.</para>
1324 </listitem>
1325 </varlistentry>
1326
1327 <varlistentry>
1328 <term><varname>ConditionFileNotEmpty=</varname></term>
1329
1330 <listitem><para><varname>ConditionFileNotEmpty=</varname> is similar to
1331 <varname>ConditionPathExists=</varname> but verifies that a certain path exists and refers to a
1332 regular file with a non-zero size.</para>
1333 </listitem>
1334 </varlistentry>
1335
1336 <varlistentry>
1337 <term><varname>ConditionFileIsExecutable=</varname></term>
1338
1339 <listitem><para><varname>ConditionFileIsExecutable=</varname> is similar to
1340 <varname>ConditionPathExists=</varname> but verifies that a certain path exists, is a regular file,
1341 and marked executable.</para>
1342 </listitem>
1343 </varlistentry>
1344
1345 <varlistentry>
1346 <term><varname>ConditionUser=</varname></term>
1347
1348 <listitem><para><varname>ConditionUser=</varname> takes a numeric <literal>UID</literal>, a UNIX
1349 user name, or the special value <literal>@system</literal>. This condition may be used to check
1350 whether the service manager is running as the given user. The special value
1351 <literal>@system</literal> can be used to check if the user id is within the system user
1352 range. This option is not useful for system services, as the system manager exclusively runs as the
1353 root user, and thus the test result is constant.</para>
1354 </listitem>
1355 </varlistentry>
1356
1357 <varlistentry>
1358 <term><varname>ConditionGroup=</varname></term>
1359
1360 <listitem><para><varname>ConditionGroup=</varname> is similar to <varname>ConditionUser=</varname>
1361 but verifies that the service manager's real or effective group, or any of its auxiliary groups,
1362 match the specified group or GID. This setting does not support the special value
1363 <literal>@system</literal>.</para>
1364 </listitem>
1365 </varlistentry>
1366
1367 <varlistentry>
1368 <term><varname>ConditionControlGroupController=</varname></term>
1369
1370 <listitem><para>Verify that the given cgroup controller (eg. <literal>cpu</literal>) is available
1371 for use on the system. For example, a particular controller may not be available if it was disabled
1372 on the kernel command line with <varname>cgroup_disable=controller</varname>. Multiple controllers
1373 may be passed with a space separating them; in this case the condition will only pass if all listed
1374 controllers are available for use. Controllers unknown to systemd are ignored. Valid controllers
1375 are <literal>cpu</literal>, <literal>cpuacct</literal>, <literal>io</literal>,
1376 <literal>blkio</literal>, <literal>memory</literal>, <literal>devices</literal>, and
1377 <literal>pids</literal>.</para>
1378 </listitem>
1379 </varlistentry>
1380
1381 <varlistentry>
1382 <term><varname>ConditionMemory=</varname></term>
1383
1384 <listitem><para>Verify that the specified amount of system memory is available to the current
1385 system. Takes a memory size in bytes as argument, optionally prefixed with a comparison operator
1386 <literal>&lt;</literal>, <literal>&lt;=</literal>, <literal>=</literal>, <literal>!=</literal>,
1387 <literal>&gt;=</literal>, <literal>&gt;</literal>. On bare-metal systems compares the amount of
1388 physical memory in the system with the specified size, adhering to the specified comparison
1389 operator. In containers compares the amount of memory assigned to the container instead.</para>
1390 </listitem>
1391 </varlistentry>
1392
1393 <varlistentry>
1394 <term><varname>ConditionCPUs=</varname></term>
1395
1396 <listitem><para>Verify that the specified number of CPUs is available to the current system. Takes
1397 a number of CPUs as argument, optionally prefixed with a comparison operator
1398 <literal>&lt;</literal>, <literal>&lt;=</literal>, <literal>=</literal>, <literal>!=</literal>,
1399 <literal>&gt;=</literal>, <literal>&gt;</literal>. Compares the number of CPUs in the CPU affinity
1400 mask configured of the service manager itself with the specified number, adhering to the specified
1401 comparison operator. On physical systems the number of CPUs in the affinity mask of the service
1402 manager usually matches the number of physical CPUs, but in special and virtual environments might
1403 differ. In particular, in containers the affinity mask usually matches the number of CPUs assigned
1404 to the container and not the physically available ones.</para></listitem>
1405 </varlistentry>
1406
1407 <varlistentry>
1408 <term><varname>AssertArchitecture=</varname></term>
1409 <term><varname>AssertVirtualization=</varname></term>
1410 <term><varname>AssertHost=</varname></term>
1411 <term><varname>AssertKernelCommandLine=</varname></term>
1412 <term><varname>AssertKernelVersion=</varname></term>
1413 <term><varname>AssertSecurity=</varname></term>
1414 <term><varname>AssertCapability=</varname></term>
1415 <term><varname>AssertACPower=</varname></term>
1416 <term><varname>AssertNeedsUpdate=</varname></term>
1417 <term><varname>AssertFirstBoot=</varname></term>
1418 <term><varname>AssertPathExists=</varname></term>
1419 <term><varname>AssertPathExistsGlob=</varname></term>
1420 <term><varname>AssertPathIsDirectory=</varname></term>
1421 <term><varname>AssertPathIsSymbolicLink=</varname></term>
1422 <term><varname>AssertPathIsMountPoint=</varname></term>
1423 <term><varname>AssertPathIsReadWrite=</varname></term>
1424 <term><varname>AssertDirectoryNotEmpty=</varname></term>
1425 <term><varname>AssertFileNotEmpty=</varname></term>
1426 <term><varname>AssertFileIsExecutable=</varname></term>
1427 <term><varname>AssertUser=</varname></term>
1428 <term><varname>AssertGroup=</varname></term>
1429 <term><varname>AssertControlGroupController=</varname></term>
1430
1431 <listitem><para>Similar to the <varname>ConditionArchitecture=</varname>,
1432 <varname>ConditionVirtualization=</varname>, …, condition settings described above, these settings
1433 add assertion checks to the start-up of the unit. However, unlike the conditions settings, any
1434 assertion setting that is not met results in failure of the start job (which means this is logged
1435 loudly). Note that hitting a configured assertion does not cause the unit to enter the
1436 <literal>failed</literal> state (or in fact result in any state change of the unit), it affects
1437 only the job queued for it. Use assertion expressions for units that cannot operate when specific
1438 requirements are not met, and when this is something the administrator or user should look
1439 into.</para>
1440 </listitem>
1441 </varlistentry>
1442 </variablelist>
1443 </refsect2>
1444 </refsect1>
1445
1446 <refsect1>
1447 <title>Mapping of unit properties to their inverses</title>
1448
1449 <para>Unit settings that create a relationship with a second unit usually show up
1450 in properties of both units, for example in <command>systemctl show</command>
1451 output. In some cases the name of the property is the same as the name of the
1452 configuration setting, but not always. This table lists the properties
1453 that are shown on two units which are connected through some dependency, and shows
1454 which property on "source" unit corresponds to which property on the "target" unit.
1455 </para>
1456
1457 <table>
1458 <title>
1459 "Forward" and "reverse" unit properties
1460 </title>
1461
1462 <tgroup cols='4'>
1463 <colspec colname='forward' />
1464 <colspec colname='reverse' />
1465 <colspec colname='fuse' />
1466 <colspec colname='ruse' />
1467 <thead>
1468 <row>
1469 <entry>"Forward" property</entry>
1470 <entry>"Reverse" property</entry>
1471 <entry namest='fuse' nameend='ruse' valign='middle'>Where used</entry>
1472 </row>
1473 </thead>
1474 <tbody>
1475 <row>
1476 <entry><varname>Before=</varname></entry>
1477 <entry><varname>After=</varname></entry>
1478 <entry morerows='1' namest='fuse' nameend='ruse' valign='middle'>[Unit] section</entry>
1479 </row>
1480 <row>
1481 <entry><varname>After=</varname></entry>
1482 <entry><varname>Before=</varname></entry>
1483 </row>
1484 <row>
1485 <entry><varname>Requires=</varname></entry>
1486 <entry><varname>RequiredBy=</varname></entry>
1487 <entry>[Unit] section</entry>
1488 <entry>[Install] section</entry>
1489 </row>
1490 <row>
1491 <entry><varname>Wants=</varname></entry>
1492 <entry><varname>WantedBy=</varname></entry>
1493 <entry>[Unit] section</entry>
1494 <entry>[Install] section</entry>
1495 </row>
1496 <row>
1497 <entry><varname>PartOf=</varname></entry>
1498 <entry><varname>ConsistsOf=</varname></entry>
1499 <entry>[Unit] section</entry>
1500 <entry>an automatic property</entry>
1501 </row>
1502 <row>
1503 <entry><varname>BindsTo=</varname></entry>
1504 <entry><varname>BoundBy=</varname></entry>
1505 <entry>[Unit] section</entry>
1506 <entry>an automatic property</entry>
1507 </row>
1508 <row>
1509 <entry><varname>Requisite=</varname></entry>
1510 <entry><varname>RequisiteOf=</varname></entry>
1511 <entry>[Unit] section</entry>
1512 <entry>an automatic property</entry>
1513 </row>
1514 <row>
1515 <entry><varname>Triggers=</varname></entry>
1516 <entry><varname>TriggeredBy=</varname></entry>
1517 <entry namest='fuse' nameend='ruse' valign='middle'>Automatic properties, see notes below</entry>
1518 </row>
1519 <row>
1520 <entry><varname>Conflicts=</varname></entry>
1521 <entry><varname>ConflictedBy=</varname></entry>
1522 <entry>[Unit] section</entry>
1523 <entry>an automatic property</entry>
1524 </row>
1525 <row>
1526 <entry><varname>PropagatesReloadTo=</varname></entry>
1527 <entry><varname>ReloadPropagatedFrom=</varname></entry>
1528 <entry morerows='1' namest='fuse' nameend='ruse' valign='middle'>[Unit] section</entry>
1529 </row>
1530 <row>
1531 <entry><varname>ReloadPropagatedFrom=</varname></entry>
1532 <entry><varname>PropagatesReloadTo=</varname></entry>
1533 </row>
1534 <row>
1535 <entry><varname>Following=</varname></entry>
1536 <entry>n/a</entry>
1537 <entry>An automatic property</entry>
1538 </row>
1539 </tbody>
1540 </tgroup>
1541 </table>
1542
1543 <para>Note: <varname>WantedBy=</varname> and <varname>RequiredBy=</varname> are
1544 used in the [Install] section to create symlinks in <filename>.wants/</filename>
1545 and <filename>.requires/</filename> directories. They cannot be used directly as a
1546 unit configuration setting.</para>
1547
1548 <para>Note: <varname>ConsistsOf=</varname>, <varname>BoundBy=</varname>,
1549 <varname>RequisiteOf=</varname>, <varname>ConflictedBy=</varname> are created
1550 implicitly along with their reverses and cannot be specified directly.</para>
1551
1552 <para>Note: <varname>Triggers=</varname> is created implicitly between a socket,
1553 path unit, or an automount unit, and the unit they activate. By default a unit
1554 with the same name is triggered, but this can be overridden using
1555 <varname>Sockets=</varname>, <varname>Service=</varname>, and <varname>Unit=</varname>
1556 settings. See
1557 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1558 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1559 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1560 and
1561 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1562 for details. <varname>TriggeredBy=</varname> is created implicitly on the
1563 triggered unit.</para>
1564
1565 <para>Note: <varname>Following=</varname> is used to group device aliases and points to the
1566 "primary" device unit that systemd is using to track device state, usually corresponding to a
1567 sysfs path. It does not show up in the "target" unit.</para>
1568 </refsect1>
1569
1570 <refsect1>
1571 <title>[Install] Section Options</title>
1572
1573 <para>Unit files may include an <literal>[Install]</literal> section, which carries installation information for
1574 the unit. This section is not interpreted by
1575 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> during runtime; it is
1576 used by the <command>enable</command> and <command>disable</command> commands of the
1577 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> tool during
1578 installation of a unit.</para>
1579
1580 <variablelist class='unit-directives'>
1581 <varlistentry>
1582 <term><varname>Alias=</varname></term>
1583
1584 <listitem><para>A space-separated list of additional names this unit shall be installed under. The names listed
1585 here must have the same suffix (i.e. type) as the unit filename. This option may be specified more than once,
1586 in which case all listed names are used. At installation time, <command>systemctl enable</command> will create
1587 symlinks from these names to the unit filename. Note that not all unit types support such alias names, and this
1588 setting is not supported for them. Specifically, mount, slice, swap, and automount units do not support
1589 aliasing.</para></listitem>
1590 </varlistentry>
1591
1592 <varlistentry>
1593 <term><varname>WantedBy=</varname></term>
1594 <term><varname>RequiredBy=</varname></term>
1595
1596 <listitem><para>This option may be used more than once, or a
1597 space-separated list of unit names may be given. A symbolic
1598 link is created in the <filename>.wants/</filename> or
1599 <filename>.requires/</filename> directory of each of the
1600 listed units when this unit is installed by <command>systemctl
1601 enable</command>. This has the effect that a dependency of
1602 type <varname>Wants=</varname> or <varname>Requires=</varname>
1603 is added from the listed unit to the current unit. The primary
1604 result is that the current unit will be started when the
1605 listed unit is started. See the description of
1606 <varname>Wants=</varname> and <varname>Requires=</varname> in
1607 the [Unit] section for details.</para>
1608
1609 <para><command>WantedBy=foo.service</command> in a service
1610 <filename>bar.service</filename> is mostly equivalent to
1611 <command>Alias=foo.service.wants/bar.service</command> in the
1612 same file. In case of template units, <command>systemctl
1613 enable</command> must be called with an instance name, and
1614 this instance will be added to the
1615 <filename>.wants/</filename> or
1616 <filename>.requires/</filename> list of the listed unit. E.g.
1617 <command>WantedBy=getty.target</command> in a service
1618 <filename>getty@.service</filename> will result in
1619 <command>systemctl enable getty@tty2.service</command>
1620 creating a
1621 <filename>getty.target.wants/getty@tty2.service</filename>
1622 link to <filename>getty@.service</filename>.
1623 </para></listitem>
1624 </varlistentry>
1625
1626 <varlistentry>
1627 <term><varname>Also=</varname></term>
1628
1629 <listitem><para>Additional units to install/deinstall when
1630 this unit is installed/deinstalled. If the user requests
1631 installation/deinstallation of a unit with this option
1632 configured, <command>systemctl enable</command> and
1633 <command>systemctl disable</command> will automatically
1634 install/uninstall units listed in this option as well.</para>
1635
1636 <para>This option may be used more than once, or a
1637 space-separated list of unit names may be
1638 given.</para></listitem>
1639 </varlistentry>
1640
1641 <varlistentry>
1642 <term><varname>DefaultInstance=</varname></term>
1643
1644 <listitem><para>In template unit files, this specifies for
1645 which instance the unit shall be enabled if the template is
1646 enabled without any explicitly set instance. This option has
1647 no effect in non-template unit files. The specified string
1648 must be usable as instance identifier.</para></listitem>
1649 </varlistentry>
1650 </variablelist>
1651
1652 <para>The following specifiers are interpreted in the Install
1653 section: %n, %N, %p, %i, %j, %g, %G, %U, %u, %m, %H, %b, %v. For their
1654 meaning see the next section.
1655 </para>
1656 </refsect1>
1657
1658 <refsect1>
1659 <title>Specifiers</title>
1660
1661 <para>Many settings resolve specifiers which may be used to write
1662 generic unit files referring to runtime or unit parameters that
1663 are replaced when the unit files are loaded. Specifiers must be known
1664 and resolvable for the setting to be valid. The following
1665 specifiers are understood:</para>
1666
1667 <table>
1668 <title>Specifiers available in unit files</title>
1669 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
1670 <colspec colname="spec" />
1671 <colspec colname="mean" />
1672 <colspec colname="detail" />
1673 <thead>
1674 <row>
1675 <entry>Specifier</entry>
1676 <entry>Meaning</entry>
1677 <entry>Details</entry>
1678 </row>
1679 </thead>
1680 <tbody>
1681 <row>
1682 <entry><literal>%b</literal></entry>
1683 <entry>Boot ID</entry>
1684 <entry>The boot ID of the running system, formatted as string. See <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry> for more information.</entry>
1685 </row>
1686 <row>
1687 <entry><literal>%C</literal></entry>
1688 <entry>Cache directory root</entry>
1689 <entry>This is either <filename>/var/cache</filename> (for the system manager) or the path <literal>$XDG_CACHE_HOME</literal> resolves to (for user managers).</entry>
1690 </row>
1691 <row>
1692 <entry><literal>%E</literal></entry>
1693 <entry>Configuration directory root</entry>
1694 <entry>This is either <filename>/etc</filename> (for the system manager) or the path <literal>$XDG_CONFIG_HOME</literal> resolves to (for user managers).</entry>
1695 </row>
1696 <row>
1697 <entry><literal>%f</literal></entry>
1698 <entry>Unescaped filename</entry>
1699 <entry>This is either the unescaped instance name (if applicable) with <filename>/</filename> prepended (if applicable), or the unescaped prefix name prepended with <filename>/</filename>. This implements unescaping according to the rules for escaping absolute file system paths discussed above.</entry>
1700 </row>
1701 <row>
1702 <entry><literal>%h</literal></entry>
1703 <entry>User home directory</entry>
1704 <entry>This is the home directory of the <emphasis>user running the service manager instance</emphasis>. In case of the system manager this resolves to <literal>/root</literal>.
1705
1706 Note that this setting is <emphasis>not</emphasis> influenced by the <varname>User=</varname> setting configurable in the [Service] section of the service unit.</entry>
1707 </row>
1708 <row>
1709 <entry><literal>%H</literal></entry>
1710 <entry>Host name</entry>
1711 <entry>The hostname of the running system at the point in time the unit configuration is loaded.</entry>
1712 </row>
1713 <row>
1714 <entry><literal>%i</literal></entry>
1715 <entry>Instance name</entry>
1716 <entry>For instantiated units this is the string between the first <literal>@</literal> character and the type suffix. Empty for non-instantiated units.</entry>
1717 </row>
1718 <row>
1719 <entry><literal>%I</literal></entry>
1720 <entry>Unescaped instance name</entry>
1721 <entry>Same as <literal>%i</literal>, but with escaping undone.</entry>
1722 </row>
1723 <row>
1724 <entry><literal>%j</literal></entry>
1725 <entry>Final component of the prefix</entry>
1726 <entry>This is the string between the last <literal>-</literal> and the end of the prefix name. If there is no <literal>-</literal>, this is the same as <literal>%p</literal>.</entry>
1727 </row>
1728 <row>
1729 <entry><literal>%J</literal></entry>
1730 <entry>Unescaped final component of the prefix</entry>
1731 <entry>Same as <literal>%j</literal>, but with escaping undone.</entry>
1732 </row>
1733 <row>
1734 <entry><literal>%L</literal></entry>
1735 <entry>Log directory root</entry>
1736 <entry>This is either <filename>/var/log</filename> (for the system manager) or the path <literal>$XDG_CONFIG_HOME</literal> resolves to with <filename index="false">/log</filename> appended (for user managers).</entry>
1737 </row>
1738 <row>
1739 <entry><literal>%m</literal></entry>
1740 <entry>Machine ID</entry>
1741 <entry>The machine ID of the running system, formatted as string. See <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more information.</entry>
1742 </row>
1743 <row>
1744 <entry><literal>%n</literal></entry>
1745 <entry>Full unit name</entry>
1746 <entry></entry>
1747 </row>
1748 <row>
1749 <entry><literal>%N</literal></entry>
1750 <entry>Full unit name</entry>
1751 <entry>Same as <literal>%n</literal>, but with the type suffix removed.</entry>
1752 </row>
1753 <row>
1754 <entry><literal>%p</literal></entry>
1755 <entry>Prefix name</entry>
1756 <entry>For instantiated units, this refers to the string before the first <literal>@</literal> character of the unit name. For non-instantiated units, same as <literal>%N</literal>.</entry>
1757 </row>
1758 <row>
1759 <entry><literal>%P</literal></entry>
1760 <entry>Unescaped prefix name</entry>
1761 <entry>Same as <literal>%p</literal>, but with escaping undone.</entry>
1762 </row>
1763 <row>
1764 <entry><literal>%s</literal></entry>
1765 <entry>User shell</entry>
1766 <entry>This is the shell of the user running the service manager instance. In case of the system manager this resolves to <literal>/bin/sh</literal>.</entry>
1767 </row>
1768 <row>
1769 <entry><literal>%S</literal></entry>
1770 <entry>State directory root</entry>
1771 <entry>This is either <filename>/var/lib</filename> (for the system manager) or the path <literal>$XDG_CONFIG_HOME</literal> resolves to (for user managers).</entry>
1772 </row>
1773 <row>
1774 <entry><literal>%t</literal></entry>
1775 <entry>Runtime directory root</entry>
1776 <entry>This is either <filename>/run</filename> (for the system manager) or the path <literal>$XDG_RUNTIME_DIR</literal> resolves to (for user managers).</entry>
1777 </row>
1778 <row>
1779 <entry><literal>%T</literal></entry>
1780 <entry>Directory for temporary files</entry>
1781 <entry>This is either <filename>/tmp</filename> or the path <literal>$TMPDIR</literal>, <literal>$TEMP</literal> or <literal>$TMP</literal> are set to.</entry>
1782 </row>
1783 <row>
1784 <entry><literal>%g</literal></entry>
1785 <entry>User group</entry>
1786 <entry>This is the name of the group running the service manager instance. In case of the system manager this resolves to <literal>root</literal>.</entry>
1787 </row>
1788 <row>
1789 <entry><literal>%G</literal></entry>
1790 <entry>User GID</entry>
1791 <entry>This is the numeric GID of the user running the service manager instance. In case of the system manager this resolves to <literal>0</literal>.</entry>
1792 </row>
1793 <row>
1794 <entry><literal>%u</literal></entry>
1795 <entry>User name</entry>
1796 <entry>This is the name of the <emphasis>user running the service manager instance</emphasis>. In case of the system manager this resolves to <literal>root</literal>.
1797
1798 Note that this setting is <emphasis>not</emphasis> influenced by the <varname>User=</varname> setting configurable in the [Service] section of the service unit.</entry>
1799 </row>
1800 <row>
1801 <entry><literal>%U</literal></entry>
1802 <entry>User UID</entry>
1803 <entry>This is the numeric UID of the <emphasis>user running the service manager instance</emphasis>. In case of the system manager this resolves to <literal>0</literal>.
1804
1805 Note that this setting is <emphasis>not</emphasis> influenced by the <varname>User=</varname> setting configurable in the [Service] section of the service unit.</entry>
1806 </row>
1807 <row>
1808 <entry><literal>%v</literal></entry>
1809 <entry>Kernel release</entry>
1810 <entry>Identical to <command>uname -r</command> output</entry>
1811 </row>
1812 <row>
1813 <entry><literal>%V</literal></entry>
1814 <entry>Directory for larger and persistent temporary files</entry>
1815 <entry>This is either <filename>/var/tmp</filename> or the path <literal>$TMPDIR</literal>, <literal>$TEMP</literal> or <literal>$TMP</literal> are set to.</entry>
1816 </row>
1817 <row>
1818 <entry><literal>%%</literal></entry>
1819 <entry>Single percent sign</entry>
1820 <entry>Use <literal>%%</literal> in place of <literal>%</literal> to specify a single percent sign.</entry>
1821 </row>
1822 </tbody>
1823 </tgroup>
1824 </table>
1825 </refsect1>
1826
1827 <refsect1>
1828 <title>Examples</title>
1829
1830 <example>
1831 <title>Allowing units to be enabled</title>
1832
1833 <para>The following snippet (highlighted) allows a unit (e.g.
1834 <filename>foo.service</filename>) to be enabled via
1835 <command>systemctl enable</command>:</para>
1836
1837 <programlisting>[Unit]
1838 Description=Foo
1839
1840 [Service]
1841 ExecStart=/usr/sbin/foo-daemon
1842
1843 <emphasis>[Install]</emphasis>
1844 <emphasis>WantedBy=multi-user.target</emphasis></programlisting>
1845
1846 <para>After running <command>systemctl enable</command>, a
1847 symlink
1848 <filename>/etc/systemd/system/multi-user.target.wants/foo.service</filename>
1849 linking to the actual unit will be created. It tells systemd to
1850 pull in the unit when starting
1851 <filename>multi-user.target</filename>. The inverse
1852 <command>systemctl disable</command> will remove that symlink
1853 again.</para>
1854 </example>
1855
1856 <example>
1857 <title>Overriding vendor settings</title>
1858
1859 <para>There are two methods of overriding vendor settings in
1860 unit files: copying the unit file from
1861 <filename>/usr/lib/systemd/system</filename> to
1862 <filename>/etc/systemd/system</filename> and modifying the
1863 chosen settings. Alternatively, one can create a directory named
1864 <filename><replaceable>unit</replaceable>.d/</filename> within
1865 <filename>/etc/systemd/system</filename> and place a drop-in
1866 file <filename><replaceable>name</replaceable>.conf</filename>
1867 there that only changes the specific settings one is interested
1868 in. Note that multiple such drop-in files are read if
1869 present, processed in lexicographic order of their filename.</para>
1870
1871 <para>The advantage of the first method is that one easily
1872 overrides the complete unit, the vendor unit is not parsed at
1873 all anymore. It has the disadvantage that improvements to the
1874 unit file by the vendor are not automatically incorporated on
1875 updates.</para>
1876
1877 <para>The advantage of the second method is that one only
1878 overrides the settings one specifically wants, where updates to
1879 the unit by the vendor automatically apply. This has the
1880 disadvantage that some future updates by the vendor might be
1881 incompatible with the local changes.</para>
1882
1883 <para>This also applies for user instances of systemd, but with
1884 different locations for the unit files. See the section on unit
1885 load paths for further details.</para>
1886
1887 <para>Suppose there is a vendor-supplied unit
1888 <filename>/usr/lib/systemd/system/httpd.service</filename> with
1889 the following contents:</para>
1890
1891 <programlisting>[Unit]
1892 Description=Some HTTP server
1893 After=remote-fs.target sqldb.service
1894 Requires=sqldb.service
1895 AssertPathExists=/srv/webserver
1896
1897 [Service]
1898 Type=notify
1899 ExecStart=/usr/sbin/some-fancy-httpd-server
1900 Nice=5
1901
1902 [Install]
1903 WantedBy=multi-user.target</programlisting>
1904
1905 <para>Now one wants to change some settings as an administrator:
1906 firstly, in the local setup, <filename>/srv/webserver</filename>
1907 might not exist, because the HTTP server is configured to use
1908 <filename>/srv/www</filename> instead. Secondly, the local
1909 configuration makes the HTTP server also depend on a memory
1910 cache service, <filename>memcached.service</filename>, that
1911 should be pulled in (<varname>Requires=</varname>) and also be
1912 ordered appropriately (<varname>After=</varname>). Thirdly, in
1913 order to harden the service a bit more, the administrator would
1914 like to set the <varname>PrivateTmp=</varname> setting (see
1915 <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
1916 for details). And lastly, the administrator would like to reset
1917 the niceness of the service to its default value of 0.</para>
1918
1919 <para>The first possibility is to copy the unit file to
1920 <filename>/etc/systemd/system/httpd.service</filename> and
1921 change the chosen settings:</para>
1922
1923 <programlisting>[Unit]
1924 Description=Some HTTP server
1925 After=remote-fs.target sqldb.service <emphasis>memcached.service</emphasis>
1926 Requires=sqldb.service <emphasis>memcached.service</emphasis>
1927 AssertPathExists=<emphasis>/srv/www</emphasis>
1928
1929 [Service]
1930 Type=notify
1931 ExecStart=/usr/sbin/some-fancy-httpd-server
1932 <emphasis>Nice=0</emphasis>
1933 <emphasis>PrivateTmp=yes</emphasis>
1934
1935 [Install]
1936 WantedBy=multi-user.target</programlisting>
1937
1938 <para>Alternatively, the administrator could create a drop-in
1939 file
1940 <filename>/etc/systemd/system/httpd.service.d/local.conf</filename>
1941 with the following contents:</para>
1942
1943 <programlisting>[Unit]
1944 After=memcached.service
1945 Requires=memcached.service
1946 # Reset all assertions and then re-add the condition we want
1947 AssertPathExists=
1948 AssertPathExists=/srv/www
1949
1950 [Service]
1951 Nice=0
1952 PrivateTmp=yes</programlisting>
1953
1954 <para>Note that for drop-in files, if one wants to remove
1955 entries from a setting that is parsed as a list (and is not a
1956 dependency), such as <varname>AssertPathExists=</varname> (or
1957 e.g. <varname>ExecStart=</varname> in service units), one needs
1958 to first clear the list before re-adding all entries except the
1959 one that is to be removed. Dependencies (<varname>After=</varname>, etc.)
1960 cannot be reset to an empty list, so dependencies can only be
1961 added in drop-ins. If you want to remove dependencies, you have
1962 to override the entire unit.</para>
1963
1964 </example>
1965 </refsect1>
1966
1967 <refsect1>
1968 <title>See Also</title>
1969 <para>
1970 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1971 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1972 <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1973 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1974 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1975 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1976 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1977 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1978 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1979 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1980 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1981 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1982 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1983 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1984 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1985 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1986 <citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
1987 <citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1988 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1989 <citerefentry project='man-pages'><refentrytitle>uname</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1990 </para>
1991 </refsect1>
1992
1993 </refentry>