]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd.unit.xml
man: wording and grammar updates
[thirdparty/systemd.git] / man / systemd.unit.xml
CommitLineData
d1ab0ca0
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
1a13e31d
ZJS
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4<!ENTITY % entities SYSTEM "custom-entities.ent" >
5%entities;
6]>
d1ab0ca0
LP
7
8<!--
9 This file is part of systemd.
10
11 Copyright 2010 Lennart Poettering
12
13 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
d1ab0ca0
LP
16 (at your option) any later version.
17
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5430f7f2 21 Lesser General Public License for more details.
d1ab0ca0 22
5430f7f2 23 You should have received a copy of the GNU Lesser General Public License
d1ab0ca0
LP
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25-->
26
27<refentry id="systemd.unit">
28
29 <refentryinfo>
30 <title>systemd.unit</title>
31 <productname>systemd</productname>
32
33 <authorgroup>
34 <author>
35 <contrib>Developer</contrib>
36 <firstname>Lennart</firstname>
37 <surname>Poettering</surname>
38 <email>lennart@poettering.net</email>
39 </author>
40 </authorgroup>
41 </refentryinfo>
42
43 <refmeta>
44 <refentrytitle>systemd.unit</refentrytitle>
45 <manvolnum>5</manvolnum>
46 </refmeta>
47
48 <refnamediv>
49 <refname>systemd.unit</refname>
34511ca7 50 <refpurpose>Unit configuration</refpurpose>
d1ab0ca0
LP
51 </refnamediv>
52
53 <refsynopsisdiv>
13219b7f
ZJS
54 <para><filename><replaceable>service</replaceable>.service</filename>,
55 <filename><replaceable>socket</replaceable>.socket</filename>,
56 <filename><replaceable>device</replaceable>.device</filename>,
57 <filename><replaceable>mount</replaceable>.mount</filename>,
58 <filename><replaceable>automount</replaceable>.automount</filename>,
59 <filename><replaceable>swap</replaceable>.swap</filename>,
60 <filename><replaceable>target</replaceable>.target</filename>,
61 <filename><replaceable>path</replaceable>.path</filename>,
62 <filename><replaceable>timer</replaceable>.timer</filename>,
e73eebfd
LP
63 <filename><replaceable>snapshot</replaceable>.snapshot</filename>,
64 <filename><replaceable>slice</replaceable>.slice</filename>,
65 <filename><replaceable>scope</replaceable>.scope</filename></para>
13219b7f
ZJS
66
67 <para><literallayout><filename>/etc/systemd/system/*</filename>
68<filename>/run/systemd/system/*</filename>
69<filename>/usr/lib/systemd/system/*</filename>
70<filename>...</filename>
71 </literallayout></para>
72
6f47d17c
LP
73 <para><literallayout><filename>$HOME/.config/systemd/user/*</filename>
74<filename>/etc/systemd/user/*</filename>
13219b7f
ZJS
75<filename>/run/systemd/user/*</filename>
76<filename>/usr/lib/systemd/user/*</filename>
77<filename>...</filename>
78 </literallayout></para>
d1ab0ca0
LP
79 </refsynopsisdiv>
80
81 <refsect1>
82 <title>Description</title>
83
84 <para>A unit configuration file encodes information
771610b0 85 about a service, a socket, a device, a mount point, an
436c44a5 86 automount point, a swap file or partition, a start-up
e73eebfd
LP
87 target, a watched file system path, a timer controlled
88 and supervised by
89 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
90 a temporary system state snapshot, a resource
91 management slice or a group of externally created
92 processes. The syntax is inspired by <ulink
11e29955 93 url="http://standards.freedesktop.org/desktop-entry-spec/latest/">XDG
e73eebfd
LP
94 Desktop Entry Specification</ulink>
95 <filename>.desktop</filename> files, which are in turn
11e29955
LP
96 inspired by Microsoft Windows
97 <filename>.ini</filename> files.</para>
d1ab0ca0 98
bb31a4ac 99 <para>This man page lists the common configuration
58c16a1a 100 options of all the unit types. These options need to
16dad32e
AE
101 be configured in the [Unit] or [Install]
102 sections of the unit files.</para>
11e29955
LP
103
104 <para>In addition to the generic [Unit] and [Install]
8afbb8e1 105 sections described here, each unit may have a
11e29955
LP
106 type-specific section, e.g. [Service] for a service
107 unit. See the respective man pages for more
13219b7f
ZJS
108 information:
109 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
110 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
111 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
112 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
113 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
114 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
115 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
116 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
117 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
118 <citerefentry><refentrytitle>systemd.snapshot</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
e73eebfd
LP
119 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
120 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
13219b7f
ZJS
121 </para>
122
123 <para>Unit files are loaded from a set of paths
124 determined during compilation, described in the next section.
125 </para>
11e29955
LP
126
127 <para>Unit files may contain additional options on top
128 of those listed here. If systemd encounters an unknown
79640424 129 option, it will write a warning log message but
11e29955 130 continue loading the unit. If an option is prefixed
79640424 131 with <option>X-</option>, it is ignored completely by
11e29955
LP
132 systemd. Applications may use this to include
133 additional information in the unit files.</para>
134
135 <para>Boolean arguments used in unit files can be
6cbdbc5f 136 written in various formats. For positive settings the
11e29955
LP
137 strings <option>1</option>, <option>yes</option>,
138 <option>true</option> and <option>on</option> are
79640424 139 equivalent. For negative settings, the strings
11e29955
LP
140 <option>0</option>, <option>no</option>,
141 <option>false</option> and <option>off</option> are
142 equivalent.</para>
143
0d624a78
LP
144 <para>Time span values encoded in unit files can be
145 written in various formats. A stand-alone number
146 specifies a time in seconds. If suffixed with a time
8afbb8e1
LP
147 unit, the unit is honored. A concatenation of multiple
148 values with units is supported, in which case the
149 values are added up. Example: "50" refers to 50
0d624a78
LP
150 seconds; "2min 200ms" refers to 2 minutes plus 200
151 milliseconds, i.e. 120200ms. The following time units
8afbb8e1
LP
152 are understood: s, min, h, d, w, ms, us. For details
153 see
154 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
0d624a78 155
11e29955 156 <para>Empty lines and lines starting with # or ; are
b3eaa628
LP
157 ignored. This may be used for commenting. Lines ending
158 in a backslash are concatenated with the following
159 line while reading and the backslash is replaced by a
160 space character. This may be used to wrap long lines.</para>
11e29955 161
11e29955 162 <para>Along with a unit file
79640424 163 <filename>foo.service</filename>, the directory
11e29955 164 <filename>foo.service.wants/</filename> may exist. All
8afbb8e1
LP
165 unit files symlinked from such a directory are
166 implicitly added as dependencies of type
11e29955
LP
167 <varname>Wanted=</varname> to the unit. This is useful
168 to hook units into the start-up of other units,
8afbb8e1 169 without having to modify their unit files. For details
79640424 170 about the semantics of <varname>Wanted=</varname>, see
8afbb8e1
LP
171 below. The preferred way to create symlinks in the
172 <filename>.wants/</filename> directory of a unit file
173 is with the <command>enable</command> command of the
ee5762e3 174 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
11e29955 175 tool which reads information from the [Install]
8afbb8e1 176 section of unit files (see below). A similar
0732ec00
LP
177 functionality exists for <varname>Requires=</varname>
178 type dependencies as well, the directory suffix is
179 <filename>.requires/</filename> in this case.</para>
11e29955 180
8afbb8e1 181 <para>Along with a unit file
79640424 182 <filename>foo.service</filename>, a directory
8afbb8e1 183 <filename>foo.service.d/</filename> may exist. All
479fe882 184 files with the suffix <literal>.conf</literal> from
8afbb8e1
LP
185 this directory will be parsed after the file itself is
186 parsed. This is useful to alter or add configuration
187 settings to a unit, without having to modify their
188 unit files. Make sure that the file that is included
189 has the appropriate section headers before any
190 directive.</para>
191
192 <para>If a line starts with <option>.include</option>
e9dd9f95 193 followed by a filename, the specified file will be
8afbb8e1
LP
194 parsed at this point. Make sure that the file that is
195 included has the appropriate section headers before
196 any directives.</para>
197
11e29955
LP
198 <para>Note that while systemd offers a flexible
199 dependency system between units it is recommended to
e65c85ab 200 use this functionality only sparingly and instead rely
11e29955 201 on techniques such as bus-based or socket-based
e65c85ab
ZJS
202 activation which make dependencies implicit, resulting
203 in a both simpler and more flexible system.</para>
1f812fea
LP
204
205 <para>Some unit names reflect paths existing in the
12f25b6e 206 file system namespace. Example: a device unit
1f812fea 207 <filename>dev-sda.device</filename> refers to a device
845c5324 208 with the device node <filename noindex='true'>/dev/sda</filename> in
79640424 209 the file system namespace. If this applies, a special
085b94ee 210 way to escape the path name is used, so that the
e9dd9f95 211 result is usable as part of a filename. Basically,
085b94ee
LP
212 given a path, "/" is replaced by "-", and all
213 unprintable characters and the "-" are replaced by
214 C-style "\x20" escapes. The root directory "/" is
215 encoded as single dash, while otherwise the initial
216 and ending "/" is removed from all paths during
217 transformation. This escaping is reversible.</para>
1f812fea
LP
218
219 <para>Optionally, units may be instantiated from a
220 template file at runtime. This allows creation of
221 multiple units from a single configuration file. If
79640424 222 systemd looks for a unit configuration file, it will
1f812fea
LP
223 first search for the literal unit name in the
224 filesystem. If that yields no success and the unit
05cc7267 225 name contains an <literal>@</literal> character, systemd will look for a
1f812fea 226 unit template that shares the same name but with the
05cc7267 227 instance string (i.e. the part between the <literal>@</literal> character
1f812fea
LP
228 and the suffix) removed. Example: if a service
229 <filename>getty@tty3.service</filename> is requested
230 and no file by that name is found, systemd will look
231 for <filename>getty@.service</filename> and
232 instantiate a service from that configuration file if
0e89268b
MB
233 it is found.</para>
234
235 <para>To refer to the instance string from
1f812fea
LP
236 within the configuration file you may use the special
237 <literal>%i</literal> specifier in many of the
8afbb8e1 238 configuration options. See below for details.</para>
b9aea954 239
6daf4f90 240 <para>If a unit file is empty (i.e. has the file size
79640424 241 0) or is symlinked to <filename>/dev/null</filename>,
6daf4f90
LP
242 its configuration will not be loaded and it appears
243 with a load state of <literal>masked</literal>, and
244 cannot be activated. Use this as an effective way to
245 fully disable a unit, making it impossible to start it
246 even manually.</para>
247
b9aea954
LP
248 <para>The unit file format is covered by the
249 <ulink
250 url="http://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise">Interface
251 Stability Promise</ulink>.</para>
8afbb8e1 252
d1ab0ca0
LP
253 </refsect1>
254
13219b7f 255 <refsect1>
00d1818b 256 <title>Unit Load Path</title>
13219b7f
ZJS
257
258 <para>Unit files are loaded from a set of paths
259 determined during compilation, described in the two
6f47d17c
LP
260 tables below. Unit files found in directories listed
261 earlier override files with the same name in
262 directories lower in the list.</para>
13219b7f 263
00d1818b 264 <para>When systemd is running in user mode
13219b7f
ZJS
265 (<option>--user</option>) and the variable
266 <varname>$SYSTEMD_UNIT_PATH</varname> is set, this
267 contents of this variable overrides the unit load
268 path.
269 </para>
270
271 <table>
272 <title>
273 Load path when running in system mode (<option>--system</option>).
274 </title>
275
276 <tgroup cols='2'>
277 <colspec colname='path' />
278 <colspec colname='expl' />
279 <thead>
280 <row>
281 <entry>Path</entry>
282 <entry>Description</entry>
283 </row>
284 </thead>
285 <tbody>
13219b7f
ZJS
286 <row>
287 <entry><filename>/etc/systemd/system</filename></entry>
00d1818b 288 <entry>Local configuration</entry>
13219b7f
ZJS
289 </row>
290 <row>
6f88df57 291 <entry><filename>/run/systemd/system</filename></entry>
6f47d17c 292 <entry>Runtime units</entry>
13219b7f 293 </row>
13219b7f
ZJS
294 <row>
295 <entry><filename>/usr/lib/systemd/system</filename></entry>
6f47d17c 296 <entry>Units of installed packages</entry>
13219b7f
ZJS
297 </row>
298 </tbody>
299 </tgroup>
300 </table>
301
302 <table>
303 <title>
42539b5e 304 Load path when running in user mode (<option>--user</option>).
13219b7f
ZJS
305 </title>
306
307 <tgroup cols='2'>
308 <colspec colname='path' />
309 <colspec colname='expl' />
310 <thead>
311 <row>
312 <entry>Path</entry>
313 <entry>Description</entry>
314 </row>
315 </thead>
316 <tbody>
317 <row>
6f47d17c
LP
318 <entry><filename>$HOME/.config/systemd/user</filename></entry>
319 <entry>User configuration</entry>
13219b7f
ZJS
320 </row>
321 <row>
322 <entry><filename>/etc/systemd/user</filename></entry>
00d1818b 323 <entry>Local configuration</entry>
13219b7f
ZJS
324 </row>
325 <row>
326 <entry><filename>/run/systemd/user</filename></entry>
6f47d17c 327 <entry>Runtime units</entry>
13219b7f
ZJS
328 </row>
329 <row>
330 <entry><filename>/usr/lib/systemd/user</filename></entry>
6f47d17c 331 <entry>Units of installed packages</entry>
13219b7f
ZJS
332 </row>
333 </tbody>
334 </tgroup>
335 </table>
336
13219b7f
ZJS
337 <para>Additional units might be loaded into systemd
338 ("linked") from directories not on the unit load
339 path. See the <command>link</command> command for
6f47d17c
LP
340 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. Also,
341 some units are dynamically created via generators
342 <ulink
343 url="http://www.freedesktop.org/wiki/Software/systemd/Generators/">Generators</ulink>.
13219b7f
ZJS
344 </para>
345 </refsect1>
346
d1ab0ca0
LP
347 <refsect1>
348 <title>Options</title>
349
771610b0
LP
350 <para>Unit file may include a [Unit] section, which
351 carries generic information about the unit that is not
352 dependent on the type of unit:</para>
353
ccc9a4f9 354 <variablelist class='unit-directives'>
11e29955
LP
355
356 <varlistentry>
357 <term><varname>Description=</varname></term>
358 <listitem><para>A free-form string
62adf224
LP
359 describing the unit. This is intended
360 for use in UIs to show descriptive
361 information along with the unit
693093c6
MS
362 name. The description should contain a name
363 that means something to the end user.
364 <literal>Apache2 Web Server</literal> is a good
365 example. Bad examples are
366 <literal>high-performance light-weight HTTP
367 server</literal> (too generic) or
368 <literal>Apache2</literal> (too specific and
369 meaningless for people who do not know
370 Apache).</para></listitem>
11e29955
LP
371 </varlistentry>
372
49dbfa7b
LP
373 <varlistentry>
374 <term><varname>Documentation=</varname></term>
e9dd9f95 375 <listitem><para>A space-separated list
49dbfa7b
LP
376 of URIs referencing documentation for
377 this unit or its
378 configuration. Accepted are only URIs
379 of the types
380 <literal>http://</literal>,
381 <literal>https://</literal>,
382 <literal>file:</literal>,
383 <literal>info:</literal>,
384 <literal>man:</literal>. For more
385 information about the syntax of these
e9dd9f95 386 URIs, see
f8a2ebbc
LP
387 <citerefentry><refentrytitle>uri</refentrytitle><manvolnum>7</manvolnum></citerefentry>. The
388 URIs should be listed in order of
389 relevance, starting with the most
390 relevant. It is a good idea to first
391 reference documentation that explains
392 what the unit's purpose is, followed
393 by how it is configured, followed by
74051b9b
LP
394 any other related documentation. This
395 option may be specified more than once
396 in which case the specified list of
397 URIs is merged. If the empty string is
e9dd9f95 398 assigned to this option, the list is
74051b9b
LP
399 reset and all prior assignments will
400 have no effect.</para></listitem>
49dbfa7b
LP
401 </varlistentry>
402
d1ab0ca0 403 <varlistentry>
9f235308 404 <term><varname>Requires=</varname></term>
771610b0 405
11e29955 406 <listitem><para>Configures requirement
771610b0 407 dependencies on other units. If this
58c16a1a 408 unit gets activated, the units listed
771610b0
LP
409 here will be activated as well. If one
410 of the other units gets deactivated or
411 its activation fails, this unit will
412 be deactivated. This option may be
413 specified more than once, in which
414 case requirement dependencies for all
11e29955
LP
415 listed names are created. Note that
416 requirement dependencies do not
417 influence the order in which services
418 are started or stopped. This has to be
419 configured independently with the
420 <varname>After=</varname> or
421 <varname>Before=</varname> options. If
422 a unit
423 <filename>foo.service</filename>
424 requires a unit
425 <filename>bar.service</filename> as
426 configured with
427 <varname>Requires=</varname> and no
428 ordering is configured with
429 <varname>After=</varname> or
430 <varname>Before=</varname>, then both
431 units will be started simultaneously
432 and without any delay between them if
433 <filename>foo.service</filename> is
434 activated. Often it is a better choice
435 to use <varname>Wants=</varname>
436 instead of
437 <varname>Requires=</varname> in order
438 to achieve a system that is more
439 robust when dealing with failing
5c315b4f
ZJS
440 services.</para>
441
442 <para>Note that dependencies of this
443 type may also be configured outside of
444 the unit configuration file by
445 adding a symlink to a
446 <filename>.requires/</filename> directory
447 accompanying the unit file. For
448 details see above.</para></listitem>
d1ab0ca0 449 </varlistentry>
11e29955 450
11e29955
LP
451 <varlistentry>
452 <term><varname>RequiresOverridable=</varname></term>
453
454 <listitem><para>Similar to
455 <varname>Requires=</varname>.
456 Dependencies listed in
457 <varname>RequiresOverridable=</varname>
458 which cannot be fulfilled or fail to
58c16a1a 459 start are ignored if the startup was
11e29955
LP
460 explicitly requested by the user. If
461 the start-up was pulled in indirectly
462 by some dependency or automatic
463 start-up of units that is not
79640424 464 requested by the user, this dependency
11e29955
LP
465 must be fulfilled and otherwise the
466 transaction fails. Hence, this option
467 may be used to configure dependencies
4176e530 468 that are normally honored unless the
11e29955
LP
469 user explicitly starts up the unit, in
470 which case whether they failed or not
471 is irrelevant.</para></listitem>
472
473 </varlistentry>
474 <varlistentry>
475 <term><varname>Requisite=</varname></term>
476 <term><varname>RequisiteOverridable=</varname></term>
477
478 <listitem><para>Similar to
479 <varname>Requires=</varname>
16dad32e 480 and <varname>RequiresOverridable=</varname>, respectively. However,
11e29955
LP
481 if a unit listed here is not started
482 already it will not be started and the
483 transaction fails
484 immediately.</para></listitem>
485 </varlistentry>
486
487 <varlistentry>
488 <term><varname>Wants=</varname></term>
489
490 <listitem><para>A weaker version of
491 <varname>Requires=</varname>. A unit
492 listed in this option will be started
493 if the configuring unit is. However,
58c16a1a 494 if the listed unit fails to start up
11e29955
LP
495 or cannot be added to the transaction
496 this has no impact on the validity of
497 the transaction as a whole. This is
498 the recommended way to hook start-up
499 of one unit to the start-up of another
5c315b4f
ZJS
500 unit.</para>
501
502 <para>Note that dependencies of this
11e29955
LP
503 type may also be configured outside of
504 the unit configuration file by
505 adding a symlink to a
506 <filename>.wants/</filename> directory
507 accompanying the unit file. For
508 details see above.</para></listitem>
509 </varlistentry>
510
b81884e7 511 <varlistentry>
7f2cddae 512 <term><varname>BindsTo=</varname></term>
b81884e7
LP
513
514 <listitem><para>Configures requirement
515 dependencies, very similar in style to
516 <varname>Requires=</varname>, however
c5315881 517 in addition to this behavior it also
b81884e7
LP
518 declares that this unit is stopped
519 when any of the units listed suddenly
520 disappears. Units can suddenly,
521 unexpectedly disappear if a service
522 terminates on its own choice, a device
523 is unplugged or a mount point
21931dbe 524 unmounted without involvement of
b81884e7
LP
525 systemd.</para></listitem>
526 </varlistentry>
527
85e9a101
MS
528 <varlistentry>
529 <term><varname>PartOf=</varname></term>
530
f3d52e8c
MS
531 <listitem><para>Configures dependencies
532 similar to <varname>Requires=</varname>,
533 but limited to stopping and restarting
534 of units. When systemd stops or restarts
535 the units listed here, the action is
536 propagated to this unit.
537 Note that this is a one way dependency -
538 changes to this unit do not affect the
539 listed units.
540 </para></listitem>
85e9a101
MS
541 </varlistentry>
542
11e29955
LP
543 <varlistentry>
544 <term><varname>Conflicts=</varname></term>
545
546 <listitem><para>Configures negative
547 requirement dependencies. If a unit
58c16a1a 548 has a
11e29955 549 <varname>Conflicts=</varname> setting
58c16a1a 550 on another unit, starting the former
11e29955
LP
551 will stop the latter and vice
552 versa. Note that this setting is
553 independent of and orthogonal to the
554 <varname>After=</varname> and
555 <varname>Before=</varname> ordering
69dd2852
LP
556 dependencies.</para>
557
558 <para>If a unit A that conflicts with
559 a unit B is scheduled to be started at
560 the same time as B, the transaction
561 will either fail (in case both are
562 required part of the transaction) or
563 be modified to be fixed (in case one
564 or both jobs are not a required part
565 of the transaction). In the latter
566 case the job that is not the required
567 will be removed, or in case both are
568 not required the unit that conflicts
569 will be started and the unit that is
570 conflicted is
571 stopped.</para></listitem>
11e29955
LP
572 </varlistentry>
573
574 <varlistentry>
575 <term><varname>Before=</varname></term>
576 <term><varname>After=</varname></term>
577
578 <listitem><para>Configures ordering
579 dependencies between units. If a unit
580 <filename>foo.service</filename>
581 contains a setting
582 <option>Before=bar.service</option>
58c16a1a 583 and both units are being started,
11e29955
LP
584 <filename>bar.service</filename>'s
585 start-up is delayed until
586 <filename>foo.service</filename> is
587 started up. Note that this setting is
588 independent of and orthogonal to the
589 requirement dependencies as configured
590 by <varname>Requires=</varname>. It is
591 a common pattern to include a unit
592 name in both the
593 <varname>After=</varname> and
594 <varname>Requires=</varname> option in
595 which case the unit listed will be
596 started before the unit that is
597 configured with these options. This
598 option may be specified more than
599 once, in which case ordering
600 dependencies for all listed names are
601 created. <varname>After=</varname> is
602 the inverse of
603 <varname>Before=</varname>, i.e. while
604 <varname>After=</varname> ensures that
605 the configured unit is started after
606 the listed unit finished starting up,
607 <varname>Before=</varname> ensures the
608 opposite, i.e. that the configured
609 unit is fully started up before the
610 listed unit is started. Note that when
611 two units with an ordering dependency
612 between them are shut down, the
58c16a1a 613 inverse of the start-up order is
11e29955
LP
614 applied. i.e. if a unit is configured
615 with <varname>After=</varname> on
616 another unit, the former is stopped
617 before the latter if both are shut
618 down. If one unit with an ordering
619 dependency on another unit is shut
620 down while the latter is started up,
621 the shut down is ordered before the
622 start-up regardless whether the
623 ordering dependency is actually of
624 type <varname>After=</varname> or
625 <varname>Before=</varname>. If two
626 units have no ordering dependencies
79640424 627 between them, they are shut down
16dad32e 628 or started up simultaneously, and
11e29955
LP
629 no ordering takes
630 place. </para></listitem>
631 </varlistentry>
632
b9975629
LP
633 <varlistentry>
634 <term><varname>OnFailure=</varname></term>
635
636 <listitem><para>Lists one or more
637 units that are activated when this
74ac3cbd 638 unit enters the
909f413d 639 <literal>failed</literal>
74ac3cbd 640 state.</para></listitem>
b9975629
LP
641 </varlistentry>
642
4dcc1cb4 643 <varlistentry>
7f2cddae
LP
644 <term><varname>PropagatesReloadTo=</varname></term>
645 <term><varname>ReloadPropagatedFrom=</varname></term>
4dcc1cb4
LP
646
647 <listitem><para>Lists one or more
648 units where reload requests on the
649 unit will be propagated to/on the
650 other unit will be propagated
651 from. Issuing a reload request on a
652 unit will automatically also enqueue a
653 reload request on all units that the
654 reload request shall be propagated to
655 via these two
656 settings.</para></listitem>
657 </varlistentry>
658
7c8fa05c
LP
659 <varlistentry>
660 <term><varname>RequiresMountsFor=</varname></term>
661
e9dd9f95
JSJ
662 <listitem><para>Takes a space-separated
663 list of absolute paths. Automatically
7c8fa05c
LP
664 adds dependencies of type
665 <varname>Requires=</varname> and
666 <varname>After=</varname> for all
667 mount units required to access the
668 specified path.</para></listitem>
669 </varlistentry>
670
222ae6a8
LP
671 <varlistentry>
672 <term><varname>OnFailureIsolate=</varname></term>
673
674 <listitem><para>Takes a boolean
79640424 675 argument. If <option>true</option>, the
222ae6a8
LP
676 unit listed in
677 <varname>OnFailure=</varname> will be
678 enqueued in isolation mode, i.e. all
679 units that are not its dependency will
79640424 680 be stopped. If this is set, only a
222ae6a8
LP
681 single unit may be listed in
682 <varname>OnFailure=</varname>. Defaults
683 to
684 <option>false</option>.</para></listitem>
685 </varlistentry>
686
c8f4d764
LP
687 <varlistentry>
688 <term><varname>IgnoreOnIsolate=</varname></term>
689
690 <listitem><para>Takes a boolean
79640424 691 argument. If <option>true</option>,
c8f4d764
LP
692 this unit will not be stopped when
693 isolating another unit. Defaults to
694 <option>false</option>.</para></listitem>
695 </varlistentry>
696
7a6000a6
LP
697 <varlistentry>
698 <term><varname>IgnoreOnSnapshot=</varname></term>
699
700 <listitem><para>Takes a boolean
79640424 701 argument. If <option>true</option>,
7a6000a6
LP
702 this unit will not be included in
703 snapshots. Defaults to
4e7f8bc8
ZJS
704 <option>true</option> for device and
705 snapshot units, <option>false</option>
7a6000a6
LP
706 for the others.</para></listitem>
707 </varlistentry>
708
11e29955
LP
709 <varlistentry>
710 <term><varname>StopWhenUnneeded=</varname></term>
711
712 <listitem><para>Takes a boolean
79640424 713 argument. If <option>true</option>,
11e29955
LP
714 this unit will be stopped when it is
715 no longer used. Note that in order to
58c16a1a
716 minimize the work to be executed,
717 systemd will not stop units by default
11e29955
LP
718 unless they are conflicting with other
719 units, or the user explicitly
720 requested their shut down. If this
58c16a1a 721 option is set, a unit will be
11e29955
LP
722 automatically cleaned up if no other
723 active unit requires it. Defaults to
724 <option>false</option>.</para></listitem>
725 </varlistentry>
726
727 <varlistentry>
b5e9dba8
LP
728 <term><varname>RefuseManualStart=</varname></term>
729 <term><varname>RefuseManualStop=</varname></term>
11e29955
LP
730
731 <listitem><para>Takes a boolean
79640424 732 argument. If <option>true</option>,
58c16a1a 733 this unit can only be activated
16dad32e 734 or deactivated indirectly. In
79640424 735 this case, explicit start-up
16dad32e 736 or termination requested by the
b5e9dba8 737 user is denied, however if it is
16dad32e 738 started or stopped as a
58c16a1a 739 dependency of another unit, start-up
16dad32e 740 or termination will succeed. This
b5e9dba8
LP
741 is mostly a safety feature to ensure
742 that the user does not accidentally
743 activate units that are not intended
744 to be activated explicitly, and not
745 accidentally deactivate units that are
746 not intended to be deactivated.
747 These options default to
11e29955
LP
748 <option>false</option>.</para></listitem>
749 </varlistentry>
750
2528a7a6
LP
751 <varlistentry>
752 <term><varname>AllowIsolate=</varname></term>
753
754 <listitem><para>Takes a boolean
79640424 755 argument. If <option>true</option>,
2528a7a6
LP
756 this unit may be used with the
757 <command>systemctl isolate</command>
79640424 758 command. Otherwise, this will be
2528a7a6
LP
759 refused. It probably is a good idea to
760 leave this disabled except for target
761 units that shall be used similar to
762 runlevels in SysV init systems, just
763 as a precaution to avoid unusable
764 system states. This option defaults to
765 <option>false</option>.</para></listitem>
766 </varlistentry>
767
62adf224
LP
768 <varlistentry>
769 <term><varname>DefaultDependencies=</varname></term>
770
771 <listitem><para>Takes a boolean
79640424 772 argument. If <option>true</option>,
62adf224
LP
773 (the default), a few default
774 dependencies will implicitly be
775 created for the unit. The actual
776 dependencies created depend on the
777 unit type. For example, for service
778 units, these dependencies ensure that
779 the service is started only after
780 basic system initialization is
58c16a1a 781 completed and is properly terminated on
62adf224
LP
782 system shutdown. See the respective
783 man pages for details. Generally, only
784 services involved with early boot or
785 late shutdown should set this option
786 to <option>false</option>. It is
787 highly recommended to leave this
788 option enabled for the majority of
789 common units. If set to
409dee2e 790 <option>false</option>, this option
62adf224
LP
791 does not disable all implicit
792 dependencies, just non-essential
793 ones.</para></listitem>
794 </varlistentry>
795
b9975629
LP
796 <varlistentry>
797 <term><varname>JobTimeoutSec=</varname></term>
798
799 <listitem><para>When clients are
800 waiting for a job of this unit to
801 complete, time out after the specified
79640424 802 time. If this time limit is reached,
b9975629
LP
803 the job will be cancelled, the unit
804 however will not change state or even
909f413d 805 enter the <literal>failed</literal>
74ac3cbd
MM
806 mode. This value defaults to 0 (job
807 timeouts disabled), except for device
808 units. NB: this timeout is independent
809 from any unit-specific timeout (for
810 example, the timeout set with
b9975629 811 <varname>Timeout=</varname> in service
74ac3cbd
MM
812 units) as the job timeout has no
813 effect on the unit itself, only on the
814 job that might be pending for it. Or
815 in other words: unit-specific timeouts
b9975629
LP
816 are useful to abort unit state
817 changes, and revert them. The job
818 timeout set with this option however
74ac3cbd
MM
819 is useful to abort only the job
820 waiting for the unit state to
821 change.</para></listitem>
b9975629
LP
822 </varlistentry>
823
52661efd
LP
824 <varlistentry>
825 <term><varname>ConditionPathExists=</varname></term>
8092a428 826 <term><varname>ConditionPathExistsGlob=</varname></term>
c61e77d3 827 <term><varname>ConditionPathIsDirectory=</varname></term>
0d60602c 828 <term><varname>ConditionPathIsSymbolicLink=</varname></term>
ab7f148f 829 <term><varname>ConditionPathIsMountPoint=</varname></term>
d0516109 830 <term><varname>ConditionPathIsReadWrite=</varname></term>
36af55d9 831 <term><varname>ConditionDirectoryNotEmpty=</varname></term>
742a862b 832 <term><varname>ConditionFileNotEmpty=</varname></term>
82e487c5 833 <term><varname>ConditionFileIsExecutable=</varname></term>
52661efd 834 <term><varname>ConditionKernelCommandLine=</varname></term>
039655a4 835 <term><varname>ConditionVirtualization=</varname></term>
69528c31 836 <term><varname>ConditionSecurity=</varname></term>
62590f23 837 <term><varname>ConditionCapability=</varname></term>
c0d6e764 838 <term><varname>ConditionHost=</varname></term>
240dbaa4 839 <term><varname>ConditionACPower=</varname></term>
d257ddef 840 <term><varname>ConditionNull=</varname></term>
52661efd
LP
841
842 <listitem><para>Before starting a unit
843 verify that the specified condition is
79640424 844 true. If it is not true, the starting
c0d6e764
LP
845 of the unit will be skipped, however
846 all ordering dependencies of it are
847 still respected. A failing condition
848 will not result in the unit being
849 moved into a failure state. The
850 condition is checked at the time the
851 queued start job is to be
852 executed.</para>
853
854 <para>With
52661efd 855 <varname>ConditionPathExists=</varname>
c0d6e764 856 a file existence condition is
52661efd
LP
857 checked before a unit is started. If
858 the specified absolute path name does
79640424 859 not exist, the condition will
c0d6e764
LP
860 fail. If the absolute path name passed
861 to
52661efd
LP
862 <varname>ConditionPathExists=</varname>
863 is prefixed with an exclamation mark
909f413d 864 (<literal>!</literal>), the test is negated, and the unit
418112a2 865 is only started if the path does not
c0d6e764
LP
866 exist.</para>
867
868 <para><varname>ConditionPathExistsGlob=</varname>
869 is similar to
870 <varname>ConditionPathExists=</varname>,
871 but checks for the existence of at
872 least one file or directory matching
873 the specified globbing pattern.</para>
874
875 <para><varname>ConditionPathIsDirectory=</varname>
ab7f148f
LP
876 is similar to
877 <varname>ConditionPathExists=</varname>
878 but verifies whether a certain path
8571962c 879 exists and is a
c0d6e764
LP
880 directory.</para>
881
882 <para><varname>ConditionPathIsSymbolicLink=</varname>
0d60602c
MS
883 is similar to
884 <varname>ConditionPathExists=</varname>
885 but verifies whether a certain path
8095200d 886 exists and is a symbolic
c0d6e764
LP
887 link.</para>
888
889 <para><varname>ConditionPathIsMountPoint=</varname>
ab7f148f
LP
890 is similar to
891 <varname>ConditionPathExists=</varname>
892 but verifies whether a certain path
893 exists and is a mount
c0d6e764
LP
894 point.</para>
895
896 <para><varname>ConditionPathIsReadWrite=</varname>
d0516109
LP
897 is similar to
898 <varname>ConditionPathExists=</varname>
899 but verifies whether the underlying
c0d6e764 900 file system is readable and writable
d0516109 901 (i.e. not mounted
c0d6e764
LP
902 read-only).</para>
903
742a862b 904 <para><varname>ConditionDirectoryNotEmpty=</varname>
ab7f148f
LP
905 is similar to
906 <varname>ConditionPathExists=</varname>
907 but verifies whether a certain path
742a862b
LP
908 exists and is a non-empty
909 directory.</para>
c0d6e764 910
742a862b 911 <para><varname>ConditionFileNotEmpty=</varname>
c61e77d3
LP
912 is similar to
913 <varname>ConditionPathExists=</varname>
914 but verifies whether a certain path
742a862b
LP
915 exists and refers to a regular file
916 with a non-zero size.</para>
917
918 <para><varname>ConditionFileIsExecutable=</varname>
919 is similar to
920 <varname>ConditionPathExists=</varname>
921 but verifies whether a certain path
922 exists, is a regular file and marked
923 executable.</para>
c0d6e764 924
742a862b 925 <para>Similar,
52661efd
LP
926 <varname>ConditionKernelCommandLine=</varname>
927 may be used to check whether a
928 specific kernel command line option is
929 set (or if prefixed with the
930 exclamation mark unset). The argument
931 must either be a single word, or an
5471472d 932 assignment (i.e. two words, separated
909f413d 933 <literal>=</literal>). In the former
d257ddef
LP
934 case the kernel command line is
935 searched for the word appearing as is,
936 or as left hand side of an
937 assignment. In the latter case the
938 exact assignment is looked for with
939 right and left hand side
c0d6e764
LP
940 matching.</para>
941
942 <para><varname>ConditionVirtualization=</varname>
039655a4
LP
943 may be used to check whether the
944 system is executed in a virtualized
945 environment and optionally test
946 whether it is a specific
947 implementation. Takes either boolean
267632f0 948 value to check if being executed in
8095200d
LP
949 any virtualized environment, or one of
950 <varname>vm</varname> and
62590f23 951 <varname>container</varname> to test
c0d6e764 952 against a generic type of
62590f23 953 virtualization solution, or one of
039655a4
LP
954 <varname>qemu</varname>,
955 <varname>kvm</varname>,
956 <varname>vmware</varname>,
957 <varname>microsoft</varname>,
958 <varname>oracle</varname>,
959 <varname>xen</varname>,
8095200d
LP
960 <varname>bochs</varname>,
961 <varname>chroot</varname>,
7080ea16 962 <varname>uml</varname>,
65bc2c21
LP
963 <varname>openvz</varname>,
964 <varname>lxc</varname>,
7d39db92 965 <varname>lxc-libvirt</varname>,
d0516109
LP
966 <varname>systemd-nspawn</varname> to
967 test against a specific
968 implementation. If multiple
79640424 969 virtualization technologies are nested,
d0516109
LP
970 only the innermost is considered. The
971 test may be negated by prepending an
c0d6e764
LP
972 exclamation mark.</para>
973
974 <para><varname>ConditionSecurity=</varname>
8092a428
LP
975 may be used to check whether the given
976 security module is enabled on the
9d995d54 977 system. Currently the recognized values
b62ee524 978 values are <varname>selinux</varname>,
9d995d54
AK
979 <varname>apparmor</varname>,
980 <varname>ima</varname> and
b62ee524 981 <varname>smack</varname>.
8092a428 982 The test may be negated by prepending
62590f23 983 an exclamation
c0d6e764
LP
984 mark.</para>
985
986 <para><varname>ConditionCapability=</varname>
62590f23
LP
987 may be used to check whether the given
988 capability exists in the capability
989 bounding set of the service manager
990 (i.e. this does not check whether
991 capability is actually available in
992 the permitted or effective sets, see
993 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>
994 for details). Pass a capability name
995 such as <literal>CAP_MKNOD</literal>,
996 possibly prefixed with an exclamation
c0d6e764
LP
997 mark to negate the check.</para>
998
999 <para><varname>ConditionHost=</varname>
1000 may be used to match against the
e9dd9f95
JSJ
1001 hostname or machine ID of the
1002 host. This either takes a hostname
c0d6e764
LP
1003 string (optionally with shell style
1004 globs) which is tested against the
e9dd9f95 1005 locally set hostname as returned by
c0d6e764
LP
1006 <citerefentry><refentrytitle>gethostname</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
1007 or a machine ID formatted as string
1008 (see
1009 <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
1010 The test may be negated by prepending
1011 an exclamation mark.</para>
1012
240dbaa4 1013 <para><varname>ConditionACPower=</varname>
e711d102
TA
1014 may be used to check whether the
1015 system has AC power, or is exclusively
240dbaa4
LP
1016 battery powered at the time of
1017 activation of the unit. This takes a
1018 boolean argument. If set to
79640424 1019 <varname>true</varname>, the condition
240dbaa4
LP
1020 will hold only if at least one AC
1021 connector of the system is connected
1022 to a power source, or if no AC
1023 connectors are known. Conversely, if
79640424 1024 set to <varname>false</varname>, the
240dbaa4
LP
1025 condition will hold only if there is
1026 at least one AC connector known and
1027 all AC connectors are disconnected
1028 from a power source.</para>
1029
c0d6e764 1030 <para>Finally,
d257ddef
LP
1031 <varname>ConditionNull=</varname> may
1032 be used to add a constant condition
1033 check value to the unit. It takes a
1034 boolean argument. If set to
79640424 1035 <varname>false</varname>, the condition
d257ddef 1036 will always fail, otherwise
c0d6e764
LP
1037 succeed.</para>
1038
1039 <para>If multiple conditions are
79640424 1040 specified, the unit will be executed if
267632f0
LP
1041 all of them apply (i.e. a logical AND
1042 is applied). Condition checks can be
1043 prefixed with a pipe symbol (|) in
1044 which case a condition becomes a
1045 triggering condition. If at least one
1046 triggering condition is defined for a
79640424 1047 unit, then the unit will be executed if
267632f0
LP
1048 at least one of the triggering
1049 conditions apply and all of the
1050 non-triggering conditions. If you
1051 prefix an argument with the pipe
79640424 1052 symbol and an exclamation mark, the
267632f0 1053 pipe symbol must be passed first, the
0d60602c
MS
1054 exclamation second. Except for
1055 <varname>ConditionPathIsSymbolicLink=</varname>,
74051b9b
LP
1056 all path checks follow symlinks. If
1057 any of these options is assigned the
79640424 1058 empty string, the list of conditions is
74051b9b
LP
1059 reset completely, all previous
1060 condition settings (of any kind) will
1061 have no effect.</para></listitem>
52661efd 1062 </varlistentry>
e2130f18 1063
1b64d026
LP
1064 <varlistentry>
1065 <term><varname>SourcePath=</varname></term>
1066 <listitem><para>A path to a
1067 configuration file this unit has been
1068 generated from. This is primarily
1069 useful for implementation of generator
1070 tools that convert configuration from
1071 an external configuration file format
1072 into native unit files. Thus
1073 functionality should not be used in
1074 normal units.</para></listitem>
1075 </varlistentry>
d1ab0ca0 1076 </variablelist>
771610b0
LP
1077
1078 <para>Unit file may include a [Install] section, which
1079 carries installation information for the unit. This
1080 section is not interpreted by
1081 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1082 during runtime. It is used exclusively by the
ee5762e3
LP
1083 <command>enable</command> and
1084 <command>disable</command> commands of the
1085 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
11e29955 1086 tool during installation of a unit:</para>
771610b0 1087
ccc9a4f9 1088 <variablelist class='unit-directives'>
771610b0
LP
1089 <varlistentry>
1090 <term><varname>Alias=</varname></term>
1091
0a715d97 1092 <listitem><para>Additional names this
771610b0
LP
1093 unit shall be installed under. The
1094 names listed here must have the same
1095 suffix (i.e. type) as the unit file
1096 name. This option may be specified
1097 more than once, in which case all
1098 listed names are used. At installation
af62c704 1099 time,
ee5762e3 1100 <command>systemctl enable</command>
771610b0 1101 will create symlinks from these names
e9dd9f95 1102 to the unit filename.</para></listitem>
11e29955
LP
1103 </varlistentry>
1104
1105 <varlistentry>
1106 <term><varname>WantedBy=</varname></term>
78d54bd4 1107 <term><varname>RequiredBy=</varname></term>
11e29955 1108
3eb13957
ZJS
1109 <listitem><para>A symbolic link is
1110 created in the
1111 <filename>.wants/</filename> or
fbce1139 1112 <filename>.requires/</filename> directory
3eb13957
ZJS
1113 of the listed unit when this unit is
1114 activated by <command>systemctl
1115 enable</command>. This has the effect
1116 that a dependency of type
1117 <varname>Wants=</varname> or
1118 <varname>Requires=</varname> is added
1119 from the listed unit to the current
1120 unit. The primary result is that the
1121 current unit will be started when the
1122 listed unit is started. See the
1123 description of
1124 <varname>Wants=</varname> and
1125 <varname>Requires=</varname> in the
1126 [Unit] section for details.</para>
1127
1128 <para><command>WantedBy=foo.service</command>
11e29955
LP
1129 in a service
1130 <filename>bar.service</filename> is
1131 mostly equivalent to
1132 <command>Alias=foo.service.wants/bar.service</command>
3eb13957
ZJS
1133 in the same file. In case of template
1134 units, <command>systemctl enable</command>
1135 must be called with an instance name, and
1136 this instance will be added to the
1137 <filename>.wants/</filename> or
1138 <filename>.requires/</filename> list
1139 of the listed unit.
1140 E.g. <command>WantedBy=getty.target</command>
1141 in a service
1142 <filename>getty@.service</filename>
1143 will result in <command>systemctl
1144 enable getty@tty2.service</command>
1145 creating a
1146 <filename>getty.target.wants/getty@tty2.service</filename>
1147 link to <filename>getty@.service</filename>.
1148 </para></listitem>
11e29955
LP
1149 </varlistentry>
1150
1151 <varlistentry>
1152 <term><varname>Also=</varname></term>
1153
1154 <listitem><para>Additional units to
a7be37a5
LP
1155 install/deinstall when this unit is
1156 installed/deinstalled. If the user
1157 requests installation/deinstallation
1158 of a unit with this option configured,
ee5762e3 1159 <command>systemctl enable</command>
a7be37a5
LP
1160 and <command>systemctl
1161 disable</command> will automatically
1162 install/uninstall units listed in this option as
11e29955 1163 well.</para></listitem>
771610b0
LP
1164 </varlistentry>
1165 </variablelist>
1166
7584d236 1167 <para>The following specifiers are interpreted in the
6aaa8c2f 1168 Install section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v.
7584d236
ZJS
1169 For their meaning see the next section.
1170 </para>
d1ab0ca0
LP
1171 </refsect1>
1172
8afbb8e1
LP
1173 <refsect1>
1174 <title>Specifiers</title>
1175
1176 <para>Many settings resolve specifiers which may be
1177 used to write generic unit files referring to runtime
1178 or unit parameters that are replaced when the unit
1179 files are loaded. The following specifiers are
1180 understood:</para>
1181
1182 <table>
1183 <title>Specifiers available in unit files</title>
1184 <tgroup cols='3' align='left' colsep='1' rowsep='1'>
1185 <colspec colname="spec" />
1186 <colspec colname="mean" />
1187 <colspec colname="detail" />
1188 <thead>
1189 <row>
1190 <entry>Specifier</entry>
1191 <entry>Meaning</entry>
1192 <entry>Details</entry>
1193 </row>
1194 </thead>
1195 <tbody>
1196 <row>
1197 <entry><literal>%n</literal></entry>
1198 <entry>Full unit name</entry>
1199 <entry></entry>
1200 </row>
1201 <row>
1202 <entry><literal>%N</literal></entry>
1203 <entry>Unescaped full unit name</entry>
1204 <entry></entry>
1205 </row>
1206 <row>
1207 <entry><literal>%p</literal></entry>
1208 <entry>Prefix name</entry>
1209 <entry>For instantiated units this refers to the string before the @. For non-instantiated units this refers to to the name of the unit with the type suffix removed.</entry>
1210 </row>
1211 <row>
1212 <entry><literal>%P</literal></entry>
1213 <entry>Unescaped prefix name</entry>
1214 <entry></entry>
1215 </row>
1216 <row>
1217 <entry><literal>%i</literal></entry>
1218 <entry>Instance name</entry>
05cc7267 1219 <entry>For instantiated units: this is the string between the <literal>@</literal> character and the suffix.</entry>
8afbb8e1
LP
1220 </row>
1221 <row>
1222 <entry><literal>%I</literal></entry>
1223 <entry>Unescaped instance name</entry>
1224 <entry></entry>
1225 </row>
1226 <row>
1227 <entry><literal>%f</literal></entry>
e9dd9f95 1228 <entry>Unescaped filename</entry>
0df2d38a 1229 <entry>This is either the unescaped instance name (if applicable) with <filename>/</filename> prepended (if applicable), or the prefix name similarly prepended with <filename>/</filename>.</entry>
8afbb8e1
LP
1230 </row>
1231 <row>
1232 <entry><literal>%c</literal></entry>
1233 <entry>Control group path of the unit</entry>
1234 <entry></entry>
1235 </row>
1236 <row>
1237 <entry><literal>%r</literal></entry>
0df2d38a
LP
1238 <entry>Root control group path where units are placed.</entry>
1239 <entry>For system instances this usually resolves to <filename>/system</filename>, except in containers, where the path might be prefixed with the container's root control group.</entry>
8afbb8e1
LP
1240 </row>
1241 <row>
1242 <entry><literal>%R</literal></entry>
0df2d38a
LP
1243 <entry>Parent directory of the control group path where units are placed.</entry>
1244 <entry>For system instances this usually resolves to <filename>/</filename>, except in containers, where this resolves to the container's root directory. This specifier is particularly useful in the <varname>ControlGroup=</varname> setting (see <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>).</entry>
8afbb8e1
LP
1245 </row>
1246 <row>
1247 <entry><literal>%t</literal></entry>
1248 <entry>Runtime socket dir</entry>
1249 <entry>This is either <filename>/run</filename> (for the system manager) or <literal>$XDG_RUNTIME_DIR</literal> (for user managers).</entry>
1250 </row>
1251 <row>
1252 <entry><literal>%u</literal></entry>
1253 <entry>User name</entry>
1254 <entry>This is the name of the configured user of the unit, or (if none is set) the user running the systemd instance.</entry>
1255 </row>
1256 <row>
1257 <entry><literal>%U</literal></entry>
1258 <entry>User UID</entry>
1259 <entry>This is the UID of the configured user of the unit, or (if none is set) the user running the systemd instance.</entry>
1260 </row>
1261 <row>
1262 <entry><literal>%h</literal></entry>
1263 <entry>User home directory</entry>
1264 <entry>This is the home directory of the configured user of the unit, or (if none is set) the user running the systemd instance.</entry>
1265 </row>
1266 <row>
1267 <entry><literal>%s</literal></entry>
1268 <entry>User shell</entry>
0df2d38a 1269 <entry>This is the shell of the configured user of the unit, or (if none is set) the user running the systemd instance. If the user is <literal>root</literal> (UID equal to 0), the shell configured in account database is ignored and <filename>/bin/sh</filename> is always used.</entry>
8afbb8e1
LP
1270 </row>
1271 <row>
1272 <entry><literal>%m</literal></entry>
1273 <entry>Machine ID</entry>
1274 <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>
1275 </row>
1276 <row>
1277 <entry><literal>%b</literal></entry>
1278 <entry>Boot ID</entry>
1279 <entry>The boot ID of the running system, formatted as string. See <citerefentry><refentrytitle>random</refentrytitle><manvolnum>4</manvolnum></citerefentry> for more information.</entry>
1280 </row>
1281 <row>
1282 <entry><literal>%H</literal></entry>
1283 <entry>Host name</entry>
e9dd9f95 1284 <entry>The hostname of the running system.</entry>
8afbb8e1 1285 </row>
6aaa8c2f
ZJS
1286 <row>
1287 <entry><literal>%v</literal></entry>
1288 <entry>Kernel release</entry>
1289 <entry>Identical to <command>uname -r</command> output.</entry>
1290 </row>
599391d8
ZJS
1291 <row>
1292 <entry><literal>%%</literal></entry>
1293 <entry>Escaped %</entry>
1294 <entry>Single percent sign.</entry>
1295 </row>
8afbb8e1
LP
1296 </tbody>
1297 </tgroup>
1298 </table>
1299 </refsect1>
1300
d1ab0ca0 1301 <refsect1>
160cd5c9
LP
1302 <title>See Also</title>
1303 <para>
1304 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
771610b0 1305 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
771610b0
LP
1306 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1307 <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1308 <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1309 <citerefentry><refentrytitle>systemd.device</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1310 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1311 <citerefentry><refentrytitle>systemd.automount</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1312 <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1313 <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1314 <citerefentry><refentrytitle>systemd.path</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
5f2ee303 1315 <citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
62590f23 1316 <citerefentry><refentrytitle>systemd.snapshot</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
e73eebfd
LP
1317 <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
1318 <citerefentry><refentrytitle>systemd.slice</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
7a529f63 1319 <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
9cc2c8b7 1320 <citerefentry><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
6aaa8c2f
ZJS
1321 <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
1322 <citerefentry><refentrytitle>uname</refentrytitle><manvolnum>1</manvolnum></citerefentry>
160cd5c9 1323 </para>
d1ab0ca0
LP
1324 </refsect1>
1325
1326</refentry>