1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd.unit</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 215</span><hr><div class="refentry"><a name="systemd.unit"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd.unit — Unit configuration</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename"><em class="replaceable"><code>service</code></em>.service</code>,
<code class="filename"><em class="replaceable"><code>socket</code></em>.socket</code>,
<code class="filename"><em class="replaceable"><code>device</code></em>.device</code>,
<code class="filename"><em class="replaceable"><code>mount</code></em>.mount</code>,
<code class="filename"><em class="replaceable"><code>automount</code></em>.automount</code>,
<code class="filename"><em class="replaceable"><code>swap</code></em>.swap</code>,
<code class="filename"><em class="replaceable"><code>target</code></em>.target</code>,
<code class="filename"><em class="replaceable"><code>path</code></em>.path</code>,
<code class="filename"><em class="replaceable"><code>timer</code></em>.timer</code>,
<code class="filename"><em class="replaceable"><code>snapshot</code></em>.snapshot</code>,
<code class="filename"><em class="replaceable"><code>slice</code></em>.slice</code>,
<code class="filename"><em class="replaceable"><code>scope</code></em>.scope</code></p><div class="literallayout"><p><code class="filename">/etc/systemd/system/*</code><br>
<code class="filename">/run/systemd/system/*</code><br>
<code class="filename">/usr/lib/systemd/system/*</code><br>
<code class="filename">...</code><br>
</p></div><div class="literallayout"><p><code class="filename">$XDG_CONFIG_HOME/systemd/user/*</code><br>
<code class="filename">$HOME/.config/systemd/user/*</code><br>
<code class="filename">/etc/systemd/user/*</code><br>
<code class="filename">/run/systemd/user/*</code><br>
<code class="filename">/usr/lib/systemd/user/*</code><br>
<code class="filename">...</code><br>
</p></div></div><div class="refsect1"><a name="idm214201004864"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p>A unit configuration file encodes information
about a service, a socket, a device, a mount point, an
automount point, a swap file or partition, a start-up
target, a watched file system path, a timer controlled
and supervised by
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
a temporary system state snapshot, a resource
management slice or a group of externally created
processes. The syntax is inspired by <a class="ulink" href="http://standards.freedesktop.org/desktop-entry-spec/latest/" target="_top">XDG
Desktop Entry Specification</a>
<code class="filename">.desktop</code> files, which are in turn
inspired by Microsoft Windows
<code class="filename">.ini</code> files.</p><p>This man page lists the common configuration
options of all the unit types. These options need to
be configured in the [Unit] or [Install]
sections of the unit files.</p><p>In addition to the generic [Unit] and [Install]
sections described here, each unit may have a
type-specific section, e.g. [Service] for a service
unit. See the respective man pages for more
information:
<a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a>,
<a href="systemd.socket.html"><span class="citerefentry"><span class="refentrytitle">systemd.socket</span>(5)</span></a>,
<a href="systemd.device.html"><span class="citerefentry"><span class="refentrytitle">systemd.device</span>(5)</span></a>,
<a href="systemd.mount.html"><span class="citerefentry"><span class="refentrytitle">systemd.mount</span>(5)</span></a>,
<a href="systemd.automount.html"><span class="citerefentry"><span class="refentrytitle">systemd.automount</span>(5)</span></a>,
<a href="systemd.swap.html"><span class="citerefentry"><span class="refentrytitle">systemd.swap</span>(5)</span></a>,
<a href="systemd.target.html"><span class="citerefentry"><span class="refentrytitle">systemd.target</span>(5)</span></a>,
<a href="systemd.path.html"><span class="citerefentry"><span class="refentrytitle">systemd.path</span>(5)</span></a>,
<a href="systemd.timer.html"><span class="citerefentry"><span class="refentrytitle">systemd.timer</span>(5)</span></a>,
<a href="systemd.snapshot.html"><span class="citerefentry"><span class="refentrytitle">systemd.snapshot</span>(5)</span></a>.
<a href="systemd.slice.html"><span class="citerefentry"><span class="refentrytitle">systemd.slice</span>(5)</span></a>.
<a href="systemd.scope.html"><span class="citerefentry"><span class="refentrytitle">systemd.scope</span>(5)</span></a>.
</p><p>Various settings are allowed to be specified
more than once, in which case the interpretation
depends on the setting. Often, multiple settings form
a list, and setting to an empty value "resets", which
means that previous assignments are ignored. When this
is allowed, it is mentioned in the description of the
setting. Note that using multiple assignments to the
same value makes the unit file incompatible with
parsers for the XDG <code class="filename">.desktop</code> file
format.</p><p>Unit files are loaded from a set of paths
determined during compilation, described in the next section.
</p><p>Unit files may contain additional options on top
of those listed here. If systemd encounters an unknown
option, it will write a warning log message but
continue loading the unit. If an option or section name
is prefixed with <code class="option">X-</code>, it is ignored
completely by systemd. Options within an ignored
section do not need the prefix. Applications may use
this to include additional information in the unit
files.</p><p>Boolean arguments used in unit files can be
written in various formats. For positive settings the
strings <code class="option">1</code>, <code class="option">yes</code>,
<code class="option">true</code> and <code class="option">on</code> are
equivalent. For negative settings, the strings
<code class="option">0</code>, <code class="option">no</code>,
<code class="option">false</code> and <code class="option">off</code> are
equivalent.</p><p>Time span values encoded in unit files can be
written in various formats. A stand-alone number
specifies a time in seconds. If suffixed with a time
unit, the unit is honored. A concatenation of multiple
values with units is supported, in which case the
values are added up. Example: "50" refers to 50
seconds; "2min 200ms" refers to 2 minutes plus 200
milliseconds, i.e. 120200ms. The following time units
are understood: s, min, h, d, w, ms, us. For details
see
<a href="systemd.time.html"><span class="citerefentry"><span class="refentrytitle">systemd.time</span>(7)</span></a>.</p><p>Empty lines and lines starting with # or ; are
ignored. This may be used for commenting. Lines ending
in a backslash are concatenated with the following
line while reading and the backslash is replaced by a
space character. This may be used to wrap long lines.</p><p>Along with a unit file
<code class="filename">foo.service</code>, the directory
<code class="filename">foo.service.wants/</code> may exist. All
unit files symlinked from such a directory are
implicitly added as dependencies of type
<code class="varname">Wanted=</code> to the unit. This is useful
to hook units into the start-up of other units,
without having to modify their unit files. For details
about the semantics of <code class="varname">Wanted=</code>, see
below. The preferred way to create symlinks in the
<code class="filename">.wants/</code> directory of a unit file
is with the <span class="command"><strong>enable</strong></span> command of the
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>
tool which reads information from the [Install]
section of unit files (see below). A similar
functionality exists for <code class="varname">Requires=</code>
type dependencies as well, the directory suffix is
<code class="filename">.requires/</code> in this case.</p><p>Along with a unit file
<code class="filename">foo.service</code>, a directory
<code class="filename">foo.service.d/</code> may exist. All
files with the suffix "<code class="literal">.conf</code>" from
this directory will be parsed after the file itself is
parsed. This is useful to alter or add configuration
settings to a unit, without having to modify their
unit files. Make sure that the file that is included
has the appropriate section headers before any
directive.</p><p>Note that while systemd offers a flexible
dependency system between units it is recommended to
use this functionality only sparingly and instead rely
on techniques such as bus-based or socket-based
activation which make dependencies implicit, resulting
in a both simpler and more flexible system.</p><p>Some unit names reflect paths existing in the
file system namespace. Example: a device unit
<code class="filename">dev-sda.device</code> refers to a device
with the device node <code class="filename">/dev/sda</code> in
the file system namespace. If this applies, a special
way to escape the path name is used, so that the
result is usable as part of a filename. Basically,
given a path, "/" is replaced by "-", and all
unprintable characters and the "-" are replaced by
C-style "\x20" escapes. The root directory "/" is
encoded as single dash, while otherwise the initial
and ending "/" is removed from all paths during
transformation. This escaping is reversible.</p><p>Optionally, units may be instantiated from a
template file at runtime. This allows creation of
multiple units from a single configuration file. If
systemd looks for a unit configuration file, it will
first search for the literal unit name in the
file system. If that yields no success and the unit
name contains an "<code class="literal">@</code>" character, systemd will look for a
unit template that shares the same name but with the
instance string (i.e. the part between the "<code class="literal">@</code>" character
and the suffix) removed. Example: if a service
<code class="filename">getty@tty3.service</code> is requested
and no file by that name is found, systemd will look
for <code class="filename">getty@.service</code> and
instantiate a service from that configuration file if
it is found.</p><p>To refer to the instance string from
within the configuration file you may use the special
"<code class="literal">%i</code>" specifier in many of the
configuration options. See below for details.</p><p>If a unit file is empty (i.e. has the file size
0) or is symlinked to <code class="filename">/dev/null</code>,
its configuration will not be loaded and it appears
with a load state of "<code class="literal">masked</code>", and
cannot be activated. Use this as an effective way to
fully disable a unit, making it impossible to start it
even manually.</p><p>The unit file format is covered by the
<a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/InterfaceStabilityPromise" target="_top">Interface
Stability Promise</a>.</p></div><div class="refsect1"><a name="idm214195948752"></a><h2 id="Unit Load Path">Unit Load Path<a class="headerlink" title="Permalink to this headline" href="#Unit%20Load%20Path">¶</a></h2><p>Unit files are loaded from a set of paths
determined during compilation, described in the two
tables below. Unit files found in directories listed
earlier override files with the same name in
directories lower in the list.</p><p>When systemd is running in user mode
(<code class="option">--user</code>) and the variable
<code class="varname">$SYSTEMD_UNIT_PATH</code> is set, this
contents of this variable overrides the unit load
path.
</p><div class="table"><a name="idm214195946144"></a><p class="title"><b>Table 1.
Load path when running in system mode (<code class="option">--system</code>).
</b></p><div class="table-contents"><table summary="
Load path when running in system mode (--system).
" border="1"><colgroup><col class="path"><col class="expl"></colgroup><thead><tr><th>Path</th><th>Description</th></tr></thead><tbody><tr><td><code class="filename">/etc/systemd/system</code></td><td>Local configuration</td></tr><tr><td><code class="filename">/run/systemd/system</code></td><td>Runtime units</td></tr><tr><td><code class="filename">/usr/lib/systemd/system</code></td><td>Units of installed packages</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="idm214195936896"></a><p class="title"><b>Table 2.
Load path when running in user mode (<code class="option">--user</code>).
</b></p><div class="table-contents"><table summary="
Load path when running in user mode (--user).
" border="1"><colgroup><col class="path"><col class="expl"></colgroup><thead><tr><th>Path</th><th>Description</th></tr></thead><tbody><tr><td><code class="filename">$XDG_CONFIG_HOME/systemd/user</code></td><td>User configuration (only used when $XDG_CONFIG_HOME is set)</td></tr><tr><td><code class="filename">$HOME/.config/systemd/user</code></td><td>User configuration (only used when $XDG_CONFIG_HOME is not set)</td></tr><tr><td><code class="filename">/etc/systemd/user</code></td><td>Local configuration</td></tr><tr><td><code class="filename">/run/systemd/user</code></td><td>Runtime units</td></tr><tr><td><code class="filename">/usr/lib/systemd/user</code></td><td>Units of installed packages</td></tr></tbody></table></div></div><br class="table-break"><p>Additional units might be loaded into systemd
("linked") from directories not on the unit load
path. See the <span class="command"><strong>link</strong></span> command for
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>. Also,
some units are dynamically created via generators
<a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/Generators/" target="_top">Generators</a>.
</p></div><div class="refsect1"><a name="idm214195921808"></a><h2 id="[Unit] Section Options">[Unit] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BUnit%5D%20Section%20Options">¶</a></h2><p>Unit file may include a [Unit] section, which
carries generic information about the unit that is not
dependent on the type of unit:</p><div class="variablelist"><dl class="variablelist"><dt id="Description="><span class="term"><code class="varname">Description=</code></span><a class="headerlink" title="Permalink to this term" href="#Description=">¶</a></dt><dd><p>A free-form string
describing the unit. This is intended
for use in UIs to show descriptive
information along with the unit
name. The description should contain a name
that means something to the end user.
"<code class="literal">Apache2 Web Server</code>" is a good
example. Bad examples are
"<code class="literal">high-performance light-weight HTTP
server</code>" (too generic) or
"<code class="literal">Apache2</code>" (too specific and
meaningless for people who do not know
Apache).</p></dd><dt id="Documentation="><span class="term"><code class="varname">Documentation=</code></span><a class="headerlink" title="Permalink to this term" href="#Documentation=">¶</a></dt><dd><p>A space-separated list
of URIs referencing documentation for
this unit or its
configuration. Accepted are only URIs
of the types
"<code class="literal">http://</code>",
"<code class="literal">https://</code>",
"<code class="literal">file:</code>",
"<code class="literal">info:</code>",
"<code class="literal">man:</code>". For more
information about the syntax of these
URIs, see
<a href="uri.html"><span class="citerefentry"><span class="refentrytitle">uri</span>(7)</span></a>. The
URIs should be listed in order of
relevance, starting with the most
relevant. It is a good idea to first
reference documentation that explains
what the unit's purpose is, followed
by how it is configured, followed by
any other related documentation. This
option may be specified more than once,
in which case the specified list of
URIs is merged. If the empty string is
assigned to this option, the list is
reset and all prior assignments will
have no effect.</p></dd><dt id="Requires="><span class="term"><code class="varname">Requires=</code></span><a class="headerlink" title="Permalink to this term" href="#Requires=">¶</a></dt><dd><p>Configures requirement
dependencies on other units. If this
unit gets activated, the units listed
here will be activated as well. If one
of the other units gets deactivated or
its activation fails, this unit will
be deactivated. This option may be
specified more than once or multiple
space-separated units may be specified
in one option in which case
requirement dependencies for all
listed names will be created. Note
that requirement dependencies do not
influence the order in which services
are started or stopped. This has to be
configured independently with the
<code class="varname">After=</code> or
<code class="varname">Before=</code> options. If
a unit
<code class="filename">foo.service</code>
requires a unit
<code class="filename">bar.service</code> as
configured with
<code class="varname">Requires=</code> and no
ordering is configured with
<code class="varname">After=</code> or
<code class="varname">Before=</code>, then both
units will be started simultaneously
and without any delay between them if
<code class="filename">foo.service</code> is
activated. Often it is a better choice
to use <code class="varname">Wants=</code>
instead of
<code class="varname">Requires=</code> in order
to achieve a system that is more
robust when dealing with failing
services.</p><p>Note that dependencies of this
type may also be configured outside of
the unit configuration file by
adding a symlink to a
<code class="filename">.requires/</code> directory
accompanying the unit file. For
details see above.</p></dd><dt id="RequiresOverridable="><span class="term"><code class="varname">RequiresOverridable=</code></span><a class="headerlink" title="Permalink to this term" href="#RequiresOverridable=">¶</a></dt><dd><p>Similar to
<code class="varname">Requires=</code>.
Dependencies listed in
<code class="varname">RequiresOverridable=</code>
which cannot be fulfilled or fail to
start are ignored if the startup was
explicitly requested by the user. If
the start-up was pulled in indirectly
by some dependency or automatic
start-up of units that is not
requested by the user, this dependency
must be fulfilled and otherwise the
transaction fails. Hence, this option
may be used to configure dependencies
that are normally honored unless the
user explicitly starts up the unit, in
which case whether they failed or not
is irrelevant.</p></dd><dt id="Requisite="><span class="term"><code class="varname">Requisite=</code>, </span><span class="term"><code class="varname">RequisiteOverridable=</code></span><a class="headerlink" title="Permalink to this term" href="#Requisite=">¶</a></dt><dd><p>Similar to
<code class="varname">Requires=</code> and
<code class="varname">RequiresOverridable=</code>,
respectively. However, if the units
listed here are not started already,
they will not be started and the
transaction will fail immediately.
</p></dd><dt id="Wants="><span class="term"><code class="varname">Wants=</code></span><a class="headerlink" title="Permalink to this term" href="#Wants=">¶</a></dt><dd><p>A weaker version of
<code class="varname">Requires=</code>. Units
listed in this option will be started
if the configuring unit is. However,
if the listed units fail to start
or cannot be added to the transaction,
this has no impact on the validity of
the transaction as a whole. This is
the recommended way to hook start-up
of one unit to the start-up of another
unit.</p><p>Note that dependencies of this
type may also be configured outside of
the unit configuration file by adding
symlinks to a
<code class="filename">.wants/</code> directory
accompanying the unit file. For
details, see above.</p></dd><dt id="BindsTo="><span class="term"><code class="varname">BindsTo=</code></span><a class="headerlink" title="Permalink to this term" href="#BindsTo=">¶</a></dt><dd><p>Configures requirement
dependencies, very similar in style to
<code class="varname">Requires=</code>, however
in addition to this behavior, it also
declares that this unit is stopped
when any of the units listed suddenly
disappears. Units can suddenly,
unexpectedly disappear if a service
terminates on its own choice, a device
is unplugged or a mount point
unmounted without involvement of
systemd.</p></dd><dt id="PartOf="><span class="term"><code class="varname">PartOf=</code></span><a class="headerlink" title="Permalink to this term" href="#PartOf=">¶</a></dt><dd><p>Configures dependencies
similar to <code class="varname">Requires=</code>,
but limited to stopping and restarting
of units. When systemd stops or restarts
the units listed here, the action is
propagated to this unit.
Note that this is a one-way dependency —
changes to this unit do not affect the
listed units.
</p></dd><dt id="Conflicts="><span class="term"><code class="varname">Conflicts=</code></span><a class="headerlink" title="Permalink to this term" href="#Conflicts=">¶</a></dt><dd><p>A space-separated list
of unit names. Configures negative
requirement dependencies. If a unit
has a <code class="varname">Conflicts=</code>
setting on another unit, starting the
former will stop the latter and vice
versa. Note that this setting is
independent of and orthogonal to the
<code class="varname">After=</code> and
<code class="varname">Before=</code> ordering
dependencies.</p><p>If a unit A that conflicts with
a unit B is scheduled to be started at
the same time as B, the transaction
will either fail (in case both are
required part of the transaction) or
be modified to be fixed (in case one
or both jobs are not a required part
of the transaction). In the latter
case, the job that is not the required
will be removed, or in case both are
not required, the unit that conflicts
will be started and the unit that is
conflicted is
stopped.</p></dd><dt id="Before="><span class="term"><code class="varname">Before=</code>, </span><span class="term"><code class="varname">After=</code></span><a class="headerlink" title="Permalink to this term" href="#Before=">¶</a></dt><dd><p>A space-separated list
of unit names. Configures ordering
dependencies between units. If a unit
<code class="filename">foo.service</code>
contains a setting
<code class="option">Before=bar.service</code>
and both units are being started,
<code class="filename">bar.service</code>'s
start-up is delayed until
<code class="filename">foo.service</code> is
started up. Note that this setting is
independent of and orthogonal to the
requirement dependencies as configured
by <code class="varname">Requires=</code>. It is
a common pattern to include a unit
name in both the
<code class="varname">After=</code> and
<code class="varname">Requires=</code> option, in
which case the unit listed will be
started before the unit that is
configured with these options. This
option may be specified more than
once, in which case ordering
dependencies for all listed names are
created. <code class="varname">After=</code> is
the inverse of
<code class="varname">Before=</code>, i.e. while
<code class="varname">After=</code> ensures that
the configured unit is started after
the listed unit finished starting up,
<code class="varname">Before=</code> ensures the
opposite, i.e. that the configured
unit is fully started up before the
listed unit is started. Note that when
two units with an ordering dependency
between them are shut down, the
inverse of the start-up order is
applied. i.e. if a unit is configured
with <code class="varname">After=</code> on
another unit, the former is stopped
before the latter if both are shut
down. If one unit with an ordering
dependency on another unit is shut
down while the latter is started up,
the shut down is ordered before the
start-up regardless of whether the
ordering dependency is actually of
type <code class="varname">After=</code> or
<code class="varname">Before=</code>. If two
units have no ordering dependencies
between them, they are shut down or
started up simultaneously, and no
ordering takes
place. </p></dd><dt id="OnFailure="><span class="term"><code class="varname">OnFailure=</code></span><a class="headerlink" title="Permalink to this term" href="#OnFailure=">¶</a></dt><dd><p>A space-separated list
of one or more units that are
activated when this unit enters the
"<code class="literal">failed</code>"
state.</p></dd><dt id="PropagatesReloadTo="><span class="term"><code class="varname">PropagatesReloadTo=</code>, </span><span class="term"><code class="varname">ReloadPropagatedFrom=</code></span><a class="headerlink" title="Permalink to this term" href="#PropagatesReloadTo=">¶</a></dt><dd><p>A space-separated list
of one or more units where reload
requests on this unit will be
propagated to, or reload requests on
the other unit will be propagated to
this unit, respectively. Issuing a
reload request on a unit will
automatically also enqueue a reload
request on all units that the reload
request shall be propagated to via
these two settings.</p></dd><dt id="JoinsNamespaceOf="><span class="term"><code class="varname">JoinsNamespaceOf=</code></span><a class="headerlink" title="Permalink to this term" href="#JoinsNamespaceOf=">¶</a></dt><dd><p>For units that start
processes (such as service units),
lists one or more other units whose
network and/or temporary file
namespace to join. This only applies
to unit types which support the
<code class="varname">PrivateNetwork=</code> and
<code class="varname">PrivateTmp=</code>
directives (see
<a href="systemd.exec.html"><span class="citerefentry"><span class="refentrytitle">systemd.exec</span>(5)</span></a>
for details). If a unit that has this
setting set is started, its processes
will see the same
<code class="filename">/tmp</code>,
<code class="filename">/tmp/var</code> and
network namespace as one listed unit
that is started. If multiple listed
units are already started, it is not
defined which namespace is
joined. Note that this setting only
has an effect if
<code class="varname">PrivateNetwork=</code>
and/or <code class="varname">PrivateTmp=</code>
is enabled for both the unit that
joins the namespace and the unit whose
namespace is joined.</p></dd><dt id="RequiresMountsFor="><span class="term"><code class="varname">RequiresMountsFor=</code></span><a class="headerlink" title="Permalink to this term" href="#RequiresMountsFor=">¶</a></dt><dd><p>Takes a
space-separated list of absolute
paths. Automatically adds dependencies
of type <code class="varname">Requires=</code>
and <code class="varname">After=</code> for all
mount units required to access the
specified path.</p><p>Mount points marked with
<code class="option">noauto</code> are not
mounted automatically and will be
ignored for the purposes of this
option. If such a mount should be a
requirement for this unit,
direct dependencies on the mount
units may be added
(<code class="varname">Requires=</code> and
<code class="varname">After=</code> or
some other combination).
</p></dd><dt id="OnFailureJobMode="><span class="term"><code class="varname">OnFailureJobMode=</code></span><a class="headerlink" title="Permalink to this term" href="#OnFailureJobMode=">¶</a></dt><dd><p>Takes a value of
"<code class="literal">fail</code>",
"<code class="literal">replace</code>",
"<code class="literal">replace-irreversibly</code>",
"<code class="literal">isolate</code>",
"<code class="literal">flush</code>",
"<code class="literal">ignore-dependencies</code>"
or
"<code class="literal">ignore-requirements</code>". Defaults
to
"<code class="literal">replace</code>". Specifies
how the units listed in
<code class="varname">OnFailure=</code> will be
enqueued. See
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>'s
<code class="option">--job-mode=</code> option
for details on the possible values. If
this is set to
"<code class="literal">isolate</code>", only a
single unit may be listed in
<code class="varname">OnFailure=</code>..</p></dd><dt id="IgnoreOnIsolate="><span class="term"><code class="varname">IgnoreOnIsolate=</code></span><a class="headerlink" title="Permalink to this term" href="#IgnoreOnIsolate=">¶</a></dt><dd><p>Takes a boolean
argument. If <code class="option">true</code>,
this unit will not be stopped when
isolating another unit. Defaults to
<code class="option">false</code>.</p></dd><dt id="IgnoreOnSnapshot="><span class="term"><code class="varname">IgnoreOnSnapshot=</code></span><a class="headerlink" title="Permalink to this term" href="#IgnoreOnSnapshot=">¶</a></dt><dd><p>Takes a boolean
argument. If <code class="option">true</code>,
this unit will not be included in
snapshots. Defaults to
<code class="option">true</code> for device and
snapshot units, <code class="option">false</code>
for the others.</p></dd><dt id="StopWhenUnneeded="><span class="term"><code class="varname">StopWhenUnneeded=</code></span><a class="headerlink" title="Permalink to this term" href="#StopWhenUnneeded=">¶</a></dt><dd><p>Takes a boolean
argument. If <code class="option">true</code>,
this unit will be stopped when it is
no longer used. Note that in order to
minimize the work to be executed,
systemd will not stop units by default
unless they are conflicting with other
units, or the user explicitly
requested their shut down. If this
option is set, a unit will be
automatically cleaned up if no other
active unit requires it. Defaults to
<code class="option">false</code>.</p></dd><dt id="RefuseManualStart="><span class="term"><code class="varname">RefuseManualStart=</code>, </span><span class="term"><code class="varname">RefuseManualStop=</code></span><a class="headerlink" title="Permalink to this term" href="#RefuseManualStart=">¶</a></dt><dd><p>Takes a boolean
argument. If <code class="option">true</code>,
this unit can only be activated
or deactivated indirectly. In
this case, explicit start-up
or termination requested by the
user is denied, however if it is
started or stopped as a
dependency of another unit, start-up
or termination will succeed. This
is mostly a safety feature to ensure
that the user does not accidentally
activate units that are not intended
to be activated explicitly, and not
accidentally deactivate units that are
not intended to be deactivated.
These options default to
<code class="option">false</code>.</p></dd><dt id="AllowIsolate="><span class="term"><code class="varname">AllowIsolate=</code></span><a class="headerlink" title="Permalink to this term" href="#AllowIsolate=">¶</a></dt><dd><p>Takes a boolean
argument. If <code class="option">true</code>,
this unit may be used with the
<span class="command"><strong>systemctl isolate</strong></span>
command. Otherwise, this will be
refused. It probably is a good idea to
leave this disabled except for target
units that shall be used similar to
runlevels in SysV init systems, just
as a precaution to avoid unusable
system states. This option defaults to
<code class="option">false</code>.</p></dd><dt id="DefaultDependencies="><span class="term"><code class="varname">DefaultDependencies=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultDependencies=">¶</a></dt><dd><p>Takes a boolean
argument. If <code class="option">true</code>,
(the default), a few default
dependencies will implicitly be
created for the unit. The actual
dependencies created depend on the
unit type. For example, for service
units, these dependencies ensure that
the service is started only after
basic system initialization is
completed and is properly terminated on
system shutdown. See the respective
man pages for details. Generally, only
services involved with early boot or
late shutdown should set this option
to <code class="option">false</code>. It is
highly recommended to leave this
option enabled for the majority of
common units. If set to
<code class="option">false</code>, this option
does not disable all implicit
dependencies, just non-essential
ones.</p></dd><dt id="JobTimeoutSec="><span class="term"><code class="varname">JobTimeoutSec=</code></span><a class="headerlink" title="Permalink to this term" href="#JobTimeoutSec=">¶</a></dt><dd><p>When clients are
waiting for a job of this unit to
complete, time out after the specified
time. If this time limit is reached,
the job will be cancelled, the unit
however will not change state or even
enter the "<code class="literal">failed</code>"
mode. This value defaults to 0 (job
timeouts disabled), except for device
units. NB: this timeout is independent
from any unit-specific timeout (for
example, the timeout set with
<code class="varname">Timeout=</code> in service
units) as the job timeout has no
effect on the unit itself, only on the
job that might be pending for it. Or
in other words: unit-specific timeouts
are useful to abort unit state
changes, and revert them. The job
timeout set with this option however
is useful to abort only the job
waiting for the unit state to
change.</p></dd><dt id="ConditionArchitecture="><span class="term"><code class="varname">ConditionArchitecture=</code>, </span><span class="term"><code class="varname">ConditionVirtualization=</code>, </span><span class="term"><code class="varname">ConditionHost=</code>, </span><span class="term"><code class="varname">ConditionKernelCommandLine=</code>, </span><span class="term"><code class="varname">ConditionSecurity=</code>, </span><span class="term"><code class="varname">ConditionCapability=</code>, </span><span class="term"><code class="varname">ConditionACPower=</code>, </span><span class="term"><code class="varname">ConditionNeedsUpdate=</code>, </span><span class="term"><code class="varname">ConditionPathExists=</code>, </span><span class="term"><code class="varname">ConditionPathExistsGlob=</code>, </span><span class="term"><code class="varname">ConditionPathIsDirectory=</code>, </span><span class="term"><code class="varname">ConditionPathIsSymbolicLink=</code>, </span><span class="term"><code class="varname">ConditionPathIsMountPoint=</code>, </span><span class="term"><code class="varname">ConditionPathIsReadWrite=</code>, </span><span class="term"><code class="varname">ConditionDirectoryNotEmpty=</code>, </span><span class="term"><code class="varname">ConditionFileNotEmpty=</code>, </span><span class="term"><code class="varname">ConditionFileIsExecutable=</code>, </span><span class="term"><code class="varname">ConditionNull=</code></span><a class="headerlink" title="Permalink to this term" href="#ConditionArchitecture=">¶</a></dt><dd><p>Before starting a unit
verify that the specified condition is
true. If it is not true, the starting
of the unit will be skipped, however
all ordering dependencies of it are
still respected. A failing condition
will not result in the unit being
moved into a failure state. The
condition is checked at the time the
queued start job is to be
executed.</p><p><code class="varname">ConditionArchitecture=</code>
may be used to check whether the
system is running on a specific
architecture. Takes one of
<code class="varname">x86</code>,
<code class="varname">x86-64</code>,
<code class="varname">ppc</code>,
<code class="varname">ppc64</code>,
<code class="varname">ia64</code>,
<code class="varname">parisc</code>,
<code class="varname">parisc64</code>,
<code class="varname">s390</code>,
<code class="varname">s390x</code>,
<code class="varname">sparc</code>,
<code class="varname">sparc64</code>,
<code class="varname">mips</code>,
<code class="varname">mips64</code>,
<code class="varname">alpha</code>,
<code class="varname">arm</code>,
<code class="varname">arm-be</code>,
<code class="varname">arm64</code>,
<code class="varname">arm64-be</code>,
<code class="varname">sh</code>,
<code class="varname">sh64</code>,
<code class="varname">m86k</code> to test
against a specific architecture. The
architecture is determined from the
information returned by
<a href="uname.html"><span class="citerefentry"><span class="refentrytitle">uname</span>(2)</span></a>
and is thus subject to
<a href="personality.html"><span class="citerefentry"><span class="refentrytitle">personality</span>(2)</span></a>. Note
that a <code class="varname">Personality=</code>
setting in the same unit file has no
effect on this condition. A special
architecture name
<code class="varname">native</code> is mapped to
the architecture the system manager
itself is compiled for. The test may
be negated by prepending an
exclamation mark.</p><p><code class="varname">ConditionVirtualization=</code>
may be used to check whether the
system is executed in a virtualized
environment and optionally test
whether it is a specific
implementation. Takes either boolean
value to check if being executed in
any virtualized environment, or one of
<code class="varname">vm</code> and
<code class="varname">container</code> to test
against a generic type of
virtualization solution, or one of
<code class="varname">qemu</code>,
<code class="varname">kvm</code>,
<code class="varname">vmware</code>,
<code class="varname">microsoft</code>,
<code class="varname">oracle</code>,
<code class="varname">xen</code>,
<code class="varname">bochs</code>,
<code class="varname">chroot</code>,
<code class="varname">uml</code>,
<code class="varname">openvz</code>,
<code class="varname">lxc</code>,
<code class="varname">lxc-libvirt</code>,
<code class="varname">systemd-nspawn</code> to
test against a specific
implementation. If multiple
virtualization technologies are nested,
only the innermost is considered. The
test may be negated by prepending an
exclamation mark.</p><p><code class="varname">ConditionHost=</code>
may be used to match against the
hostname or machine ID of the
host. This either takes a hostname
string (optionally with shell style
globs) which is tested against the
locally set hostname as returned by
<a href="gethostname.html"><span class="citerefentry"><span class="refentrytitle">gethostname</span>(2)</span></a>,
or a machine ID formatted as string
(see
<a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a>).
The test may be negated by prepending
an exclamation mark.</p><p><code class="varname">ConditionKernelCommandLine=</code>
may be used to check whether a
specific kernel command line option is
set (or if prefixed with the
exclamation mark unset). The argument
must either be a single word, or an
assignment (i.e. two words, separated
"<code class="literal">=</code>"). In the former
case the kernel command line is
searched for the word appearing as is,
or as left hand side of an
assignment. In the latter case, the
exact assignment is looked for with
right and left hand side
matching.</p><p><code class="varname">ConditionSecurity=</code>
may be used to check whether the given
security module is enabled on the
system. Currently the recognized values
values are <code class="varname">selinux</code>,
<code class="varname">apparmor</code>,
<code class="varname">ima</code> and
<code class="varname">smack</code>.
The test may be negated by prepending
an exclamation
mark.</p><p><code class="varname">ConditionCapability=</code>
may be used to check whether the given
capability exists in the capability
bounding set of the service manager
(i.e. this does not check whether
capability is actually available in
the permitted or effective sets, see
<a href="capabilities.html"><span class="citerefentry"><span class="refentrytitle">capabilities</span>(7)</span></a>
for details). Pass a capability name
such as "<code class="literal">CAP_MKNOD</code>",
possibly prefixed with an exclamation
mark to negate the check.</p><p><code class="varname">ConditionACPower=</code>
may be used to check whether the
system has AC power, or is exclusively
battery powered at the time of
activation of the unit. This takes a
boolean argument. If set to
<code class="varname">true</code>, the condition
will hold only if at least one AC
connector of the system is connected
to a power source, or if no AC
connectors are known. Conversely, if
set to <code class="varname">false</code>, the
condition will hold only if there is
at least one AC connector known and
all AC connectors are disconnected
from a power source.</p><p><code class="varname">ConditionNeedsUpdate=</code>
takes one of <code class="filename">/var</code>
or <code class="filename">/etc</code> as
argument, possibly prefixed with a
"<code class="literal">!</code>" (for inverting
the condition). This condition may be
used to conditionalize units on
whether the specified directory
requires an update because
<code class="filename">/usr</code>'s
modification time is newer than the
stamp file
<code class="filename">.updated</code> in the
specified directory. This is useful to
implement offline updates of the
vendor operating system resources in
<code class="filename">/usr</code> that require
updating of <code class="filename">/etc</code>
or <code class="filename">/var</code> on the
next following boot. Units making use
of this condition should order
themselves before
<a href="systemd-update-done.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-update-done.service</span>(8)</span></a>,
to make sure they run before the stamp
files's modification time gets reset
indicating a completed update.</p><p>With
<code class="varname">ConditionPathExists=</code>
a file existence condition is
checked before a unit is started. If
the specified absolute path name does
not exist, the condition will
fail. If the absolute path name passed
to
<code class="varname">ConditionPathExists=</code>
is prefixed with an exclamation mark
("<code class="literal">!</code>"), the test is negated, and the unit
is only started if the path does not
exist.</p><p><code class="varname">ConditionPathExistsGlob=</code>
is similar to
<code class="varname">ConditionPathExists=</code>,
but checks for the existence of at
least one file or directory matching
the specified globbing pattern.</p><p><code class="varname">ConditionPathIsDirectory=</code>
is similar to
<code class="varname">ConditionPathExists=</code>
but verifies whether a certain path
exists and is a
directory.</p><p><code class="varname">ConditionPathIsSymbolicLink=</code>
is similar to
<code class="varname">ConditionPathExists=</code>
but verifies whether a certain path
exists and is a symbolic
link.</p><p><code class="varname">ConditionPathIsMountPoint=</code>
is similar to
<code class="varname">ConditionPathExists=</code>
but verifies whether a certain path
exists and is a mount
point.</p><p><code class="varname">ConditionPathIsReadWrite=</code>
is similar to
<code class="varname">ConditionPathExists=</code>
but verifies whether the underlying
file system is readable and writable
(i.e. not mounted
read-only).</p><p><code class="varname">ConditionDirectoryNotEmpty=</code>
is similar to
<code class="varname">ConditionPathExists=</code>
but verifies whether a certain path
exists and is a non-empty
directory.</p><p><code class="varname">ConditionFileNotEmpty=</code>
is similar to
<code class="varname">ConditionPathExists=</code>
but verifies whether a certain path
exists and refers to a regular file
with a non-zero size.</p><p><code class="varname">ConditionFileIsExecutable=</code>
is similar to
<code class="varname">ConditionPathExists=</code>
but verifies whether a certain path
exists, is a regular file and marked
executable.</p><p>Finally,
<code class="varname">ConditionNull=</code> may
be used to add a constant condition
check value to the unit. It takes a
boolean argument. If set to
<code class="varname">false</code>, the condition
will always fail, otherwise
succeed.</p><p>If multiple conditions are
specified, the unit will be executed if
all of them apply (i.e. a logical AND
is applied). Condition checks can be
prefixed with a pipe symbol (|) in
which case a condition becomes a
triggering condition. If at least one
triggering condition is defined for a
unit, then the unit will be executed if
at least one of the triggering
conditions apply and all of the
non-triggering conditions. If you
prefix an argument with the pipe
symbol and an exclamation mark, the
pipe symbol must be passed first, the
exclamation second. Except for
<code class="varname">ConditionPathIsSymbolicLink=</code>,
all path checks follow symlinks. If
any of these options is assigned the
empty string, the list of conditions is
reset completely, all previous
condition settings (of any kind) will
have no effect.</p></dd><dt id="SourcePath="><span class="term"><code class="varname">SourcePath=</code></span><a class="headerlink" title="Permalink to this term" href="#SourcePath=">¶</a></dt><dd><p>A path to a
configuration file this unit has been
generated from. This is primarily
useful for implementation of generator
tools that convert configuration from
an external configuration file format
into native unit files. This
functionality should not be used in
normal units.</p></dd></dl></div></div><div class="refsect1"><a name="idm214195738800"></a><h2 id="[Install] Section Options">[Install] Section Options<a class="headerlink" title="Permalink to this headline" href="#%5BInstall%5D%20Section%20Options">¶</a></h2><p>Unit file may include a [Install] section, which
carries installation information for the unit. This
section is not interpreted by
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>
during runtime. It is used exclusively by the
<span class="command"><strong>enable</strong></span> and
<span class="command"><strong>disable</strong></span> commands of the
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>
tool during installation of a unit:</p><div class="variablelist"><dl class="variablelist"><dt id="Alias="><span class="term"><code class="varname">Alias=</code></span><a class="headerlink" title="Permalink to this term" href="#Alias=">¶</a></dt><dd><p>A space-seperated list
of additional names this unit shall be
installed under. The names listed here
must have the same suffix (i.e. type)
as the unit file name. This option may
be specified more than once, in which
case all listed names are used. At
installation time, <span class="command"><strong>systemctl
enable</strong></span> will create symlinks
from these names to the unit
filename.</p></dd><dt id="WantedBy="><span class="term"><code class="varname">WantedBy=</code>, </span><span class="term"><code class="varname">RequiredBy=</code></span><a class="headerlink" title="Permalink to this term" href="#WantedBy=">¶</a></dt><dd><p>This option may be
used more than once, or a
space-separated list of unit names may
be given. A symbolic link is created
in the <code class="filename">.wants/</code> or
<code class="filename">.requires/</code>
directory of each of the listed units
when this unit is installed by
<span class="command"><strong>systemctl enable</strong></span>.
This has the effect that a dependency
of type <code class="varname">Wants=</code> or
<code class="varname">Requires=</code> is added
from the listed unit to the current
unit. The primary result is that the
current unit will be started when the
listed unit is started. See the
description of
<code class="varname">Wants=</code> and
<code class="varname">Requires=</code> in the
[Unit] section for details.</p><p><span class="command"><strong>WantedBy=foo.service</strong></span>
in a service
<code class="filename">bar.service</code> is
mostly equivalent to
<span class="command"><strong>Alias=foo.service.wants/bar.service</strong></span>
in the same file. In case of template
units, <span class="command"><strong>systemctl enable</strong></span>
must be called with an instance name, and
this instance will be added to the
<code class="filename">.wants/</code> or
<code class="filename">.requires/</code> list
of the listed unit.
E.g. <span class="command"><strong>WantedBy=getty.target</strong></span>
in a service
<code class="filename">getty@.service</code>
will result in <span class="command"><strong>systemctl
enable getty@tty2.service</strong></span>
creating a
<code class="filename">getty.target.wants/getty@tty2.service</code>
link to <code class="filename">getty@.service</code>.
</p></dd><dt id="Also="><span class="term"><code class="varname">Also=</code></span><a class="headerlink" title="Permalink to this term" href="#Also=">¶</a></dt><dd><p>Additional units to
install/deinstall when this unit is
installed/deinstalled. If the user
requests installation/deinstallation
of a unit with this option configured,
<span class="command"><strong>systemctl enable</strong></span>
and <span class="command"><strong>systemctl
disable</strong></span> will automatically
install/uninstall units listed in this option as
well.</p><p>This option may be used more
than once, or a space-separated list
of unit names may be
given.</p></dd><dt id="DefaultInstance="><span class="term"><code class="varname">DefaultInstance=</code></span><a class="headerlink" title="Permalink to this term" href="#DefaultInstance=">¶</a></dt><dd><p>In template unit files,
this specifies for which instance the
unit shall be enabled if the template
is enabled without any explicitly set
instance. This option has no effect in
non-template unit files. The specified
string must be usable as instance
identifier.</p></dd></dl></div><p>The following specifiers are interpreted in the
Install section: %n, %N, %p, %i, %U, %u, %m, %H, %b, %v.
For their meaning see the next section.
</p></div><div class="refsect1"><a name="idm214195710624"></a><h2 id="Specifiers">Specifiers<a class="headerlink" title="Permalink to this headline" href="#Specifiers">¶</a></h2><p>Many settings resolve specifiers which may be
used to write generic unit files referring to runtime
or unit parameters that are replaced when the unit
files are loaded. The following specifiers are
understood:</p><div class="table"><a name="idm214195709312"></a><p class="title"><b>Table 3. Specifiers available in unit files</b></p><div class="table-contents"><table summary="Specifiers available in unit files" border="1"><colgroup><col align="left" class="spec"><col align="left" class="mean"><col align="left" class="detail"></colgroup><thead><tr><th align="left">Specifier</th><th align="left">Meaning</th><th align="left">Details</th></tr></thead><tbody><tr><td align="left">"<code class="literal">%n</code>"</td><td align="left">Full unit name</td><td align="left"> </td></tr><tr><td align="left">"<code class="literal">%N</code>"</td><td align="left">Unescaped full unit name</td><td align="left">Same as "<code class="literal">%n</code>", but with escaping undone</td></tr><tr><td align="left">"<code class="literal">%p</code>"</td><td align="left">Prefix name</td><td align="left">For instantiated units, this refers to the string before the "<code class="literal">@</code>" character of the unit name. For non-instantiated units, this refers to the name of the unit with the type suffix removed.</td></tr><tr><td align="left">"<code class="literal">%P</code>"</td><td align="left">Unescaped prefix name</td><td align="left">Same as "<code class="literal">%p</code>", but with escaping undone</td></tr><tr><td align="left">"<code class="literal">%i</code>"</td><td align="left">Instance name</td><td align="left">For instantiated units: this is the string between the "<code class="literal">@</code>" character and the suffix of the unit name.</td></tr><tr><td align="left">"<code class="literal">%I</code>"</td><td align="left">Unescaped instance name</td><td align="left">Same as "<code class="literal">%i</code>", but with escaping undone</td></tr><tr><td align="left">"<code class="literal">%f</code>"</td><td align="left">Unescaped filename</td><td align="left">This is either the unescaped instance name (if applicable) with <code class="filename">/</code> prepended (if applicable), or the prefix name prepended with <code class="filename">/</code>.</td></tr><tr><td align="left">"<code class="literal">%c</code>"</td><td align="left">Control group path of the unit</td><td align="left">This path does not include the <code class="filename">/sys/fs/cgroup/systemd/</code> prefix.</td></tr><tr><td align="left">"<code class="literal">%r</code>"</td><td align="left">Control group path of the slice the unit is placed in</td><td align="left">This usually maps to the parent cgroup path of "<code class="literal">%c</code>".</td></tr><tr><td align="left">"<code class="literal">%R</code>"</td><td align="left">Root control group path below which slices and units are placed</td><td align="left">For system instances, this resolves to <code class="filename">/</code>, except in containers, where this maps to the container's root control group path.</td></tr><tr><td align="left">"<code class="literal">%t</code>"</td><td align="left">Runtime directory</td><td align="left">This is either <code class="filename">/run</code> (for the system manager) or the path "<code class="literal">$XDG_RUNTIME_DIR</code>" resolves to (for user managers).</td></tr><tr><td align="left">"<code class="literal">%u</code>"</td><td align="left">User name</td><td align="left">This is the name of the configured user of the unit, or (if none is set) the user running the systemd instance.</td></tr><tr><td align="left">"<code class="literal">%U</code>"</td><td align="left">User UID</td><td align="left">This is the numeric UID of the configured user of the unit, or (if none is set) the user running the systemd user instance. Note that this specifier is not available for units run by the systemd system instance (as opposed to those run by a systemd user instance), unless the user has been configured as a numeric UID in the first place or the configured user is the root user.</td></tr><tr><td align="left">"<code class="literal">%h</code>"</td><td align="left">User home directory</td><td align="left">This is the home directory of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to "<code class="literal">%U</code>", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user.</td></tr><tr><td align="left">"<code class="literal">%s</code>"</td><td align="left">User shell</td><td align="left">This is the shell of the configured user of the unit, or (if none is set) the user running the systemd user instance. Similar to "<code class="literal">%U</code>", this specifier is not available for units run by the systemd system instance, unless the configured user is the root user.</td></tr><tr><td align="left">"<code class="literal">%m</code>"</td><td align="left">Machine ID</td><td align="left">The machine ID of the running system, formatted as string. See <a href="machine-id.html"><span class="citerefentry"><span class="refentrytitle">machine-id</span>(5)</span></a> for more information.</td></tr><tr><td align="left">"<code class="literal">%b</code>"</td><td align="left">Boot ID</td><td align="left">The boot ID of the running system, formatted as string. See <a href="random.html"><span class="citerefentry"><span class="refentrytitle">random</span>(4)</span></a> for more information.</td></tr><tr><td align="left">"<code class="literal">%H</code>"</td><td align="left">Host name</td><td align="left">The hostname of the running system at the point in time the unit configuation is loaded.</td></tr><tr><td align="left">"<code class="literal">%v</code>"</td><td align="left">Kernel release</td><td align="left">Identical to <span class="command"><strong>uname -r</strong></span> output</td></tr><tr><td align="left">"<code class="literal">%%</code>"</td><td align="left">Single percent sign</td><td align="left">Use "<code class="literal">%%</code>" in place of "<code class="literal">%</code>" to specify a single percent sign.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idm214195651232"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(8)</span></a>,
<a href="systemd.special.html"><span class="citerefentry"><span class="refentrytitle">systemd.special</span>(7)</span></a>,
<a href="systemd.service.html"><span class="citerefentry"><span class="refentrytitle">systemd.service</span>(5)</span></a>,
<a href="systemd.socket.html"><span class="citerefentry"><span class="refentrytitle">systemd.socket</span>(5)</span></a>,
<a href="systemd.device.html"><span class="citerefentry"><span class="refentrytitle">systemd.device</span>(5)</span></a>,
<a href="systemd.mount.html"><span class="citerefentry"><span class="refentrytitle">systemd.mount</span>(5)</span></a>,
<a href="systemd.automount.html"><span class="citerefentry"><span class="refentrytitle">systemd.automount</span>(5)</span></a>,
<a href="systemd.swap.html"><span class="citerefentry"><span class="refentrytitle">systemd.swap</span>(5)</span></a>,
<a href="systemd.target.html"><span class="citerefentry"><span class="refentrytitle">systemd.target</span>(5)</span></a>,
<a href="systemd.path.html"><span class="citerefentry"><span class="refentrytitle">systemd.path</span>(5)</span></a>,
<a href="systemd.timer.html"><span class="citerefentry"><span class="refentrytitle">systemd.timer</span>(5)</span></a>,
<a href="systemd.snapshot.html"><span class="citerefentry"><span class="refentrytitle">systemd.snapshot</span>(5)</span></a>,
<a href="systemd.scope.html"><span class="citerefentry"><span class="refentrytitle">systemd.scope</span>(5)</span></a>,
<a href="systemd.slice.html"><span class="citerefentry"><span class="refentrytitle">systemd.slice</span>(5)</span></a>,
<a href="systemd.time.html"><span class="citerefentry"><span class="refentrytitle">systemd.time</span>(7)</span></a>,
<a href="capabilities.html"><span class="citerefentry"><span class="refentrytitle">capabilities</span>(7)</span></a>,
<a href="systemd.directives.html"><span class="citerefentry"><span class="refentrytitle">systemd.directives</span>(7)</span></a>,
<a href="uname.html"><span class="citerefentry"><span class="refentrytitle">uname</span>(1)</span></a>
</p></div></div></body></html>
|