HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

man/systemd.exec.xml

343,875 bytesGit mode 100644Download original fileLGPL-2.1-or-later

Git blob: 151cff518a70dc4761d7305857f83b6888834572

Lines 1001–2000 of 5,316

 
        <xi:include href="version-info.xml" xpointer="v210"/>
        </listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SmackProcessLabel=</varname></term>
 
        <listitem><para>Takes a <option>SMACK64</option> security label as argument. The process executed by the unit
        will be started under this label and SMACK will decide whether the process is allowed to run or not, based on
        it. The process will continue to run under the label specified here unless the executable has its own
        <option>SMACK64EXEC</option> label, in which case the process will transition to run under that label. When not
        specified, the label that systemd is running under is used. This directive is ignored if SMACK is
        disabled.</para>
 
        <para>The value may be prefixed by <literal>-</literal>, in which case all errors will be ignored. An empty
        value may be specified to unset previous assignments. This does not affect commands prefixed with
        <literal>+</literal>.</para>
 
        <xi:include href="system-only.xml" xpointer="singular"/>
 
        <xi:include href="version-info.xml" xpointer="v218"/></listitem>
      </varlistentry>
 
    </variablelist>
  </refsect1>
 
  <refsect1>
    <title>Process Properties</title>
 
    <variablelist class='unit-directives'>
 
      <varlistentry>
        <term><varname>LimitCPU=</varname></term>
        <term><varname>LimitFSIZE=</varname></term>
        <term><varname>LimitDATA=</varname></term>
        <term><varname>LimitSTACK=</varname></term>
        <term><varname>LimitCORE=</varname></term>
        <term><varname>LimitRSS=</varname></term>
        <term><varname>LimitNOFILE=</varname></term>
        <term><varname>LimitAS=</varname></term>
        <term><varname>LimitNPROC=</varname></term>
        <term><varname>LimitMEMLOCK=</varname></term>
        <term><varname>LimitLOCKS=</varname></term>
        <term><varname>LimitSIGPENDING=</varname></term>
        <term><varname>LimitMSGQUEUE=</varname></term>
        <term><varname>LimitNICE=</varname></term>
        <term><varname>LimitRTPRIO=</varname></term>
        <term><varname>LimitRTTIME=</varname></term>
 
        <listitem><para>Set soft and hard limits on various resources for executed processes. See
        <citerefentry><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
        details on the process resource limit concept. Process resource limits may be specified in two formats:
        either as single value to set a specific soft and hard limit to the same value, or as colon-separated
        pair <option>soft:hard</option> to set both limits individually
        (e.g. <literal>LimitAS=4G:16G</literal>).  Use the string <option>infinity</option> to configure no
        limit on a specific resource. The multiplicative suffixes K, M, G, T, P and E (to the base 1024) may
        be used for resource limits measured in bytes (e.g. <literal>LimitAS=16G</literal>). For the limits
        referring to time values, the usual time units ms, s, min, h and so on may be used (see
        <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
        details). Note that if no time unit is specified for <varname>LimitCPU=</varname> the default unit of
        seconds is implied, while for <varname>LimitRTTIME=</varname> the default unit of microseconds is
        implied. Also, note that the effective granularity of the limits might influence their
        enforcement. For example, time limits specified for <varname>LimitCPU=</varname> will be rounded up
        implicitly to multiples of 1s. For <varname>LimitNICE=</varname> the value may be specified in two
        syntaxes: if prefixed with <literal>+</literal> or <literal>-</literal>, the value is understood as
        regular Linux nice value in the range -20…19. If not prefixed like this the value is understood as
        raw resource limit parameter in the range 0…40 (with 0 being equivalent to 1).</para>
 
        <para>Note that most process resource limits configured with these options are per-process, and
        processes may fork in order to acquire a new set of resources that are accounted independently of the
        original process, and may thus escape limits set. Also note that <varname>LimitRSS=</varname> is not
        implemented on Linux, and setting it has no effect. Often it is advisable to prefer the resource
        controls listed in
        <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        over these per-process limits, as they apply to services as a whole, may be altered dynamically at
        runtime, and are generally more expressive. For example, <varname>MemoryMax=</varname> is a more
        powerful (and working) replacement for <varname>LimitRSS=</varname>.</para>
 
        <para>Note that <varname>LimitNPROC=</varname> will limit the number of processes from one (real) UID and
        not the number of processes started (forked) by the service. Therefore the limit is cumulative for all
        processes running under the same UID. Please also note that the <varname>LimitNPROC=</varname> will not be
        enforced if the service is running as root (and not dropping privileges). Due to these limitations,
        <varname>TasksMax=</varname> (see <citerefentry><refentrytitle>systemd.resource-control</refentrytitle>
        <manvolnum>5</manvolnum></citerefentry>) is typically a better choice than <varname>LimitNPROC=</varname>.
        </para>
 
        <para>These settings, including the defaults described below, do not affect commands prefixed with
        <literal>+</literal>. Such commands inherit the resource limits of the service manager itself, which may be
        different.</para>
 
        <para>Resource limits not configured explicitly for a unit default to the value configured in the various
        <varname>DefaultLimitCPU=</varname>, <varname>DefaultLimitFSIZE=</varname>, … options available in
        <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, and –
        if not configured there – the kernel or per-user defaults, as defined by the OS (the latter only for user
        services, see below).</para>
 
        <para>For system units these resource limits may be chosen freely. When these settings are configured
        in a user service (i.e. a service run by the per-user instance of the service manager) they cannot be
        used to raise the limits above those set for the user manager itself when it was first invoked, as
        the user's service manager generally lacks the privileges to do so. In user context these
        configuration options are hence only useful to lower the limits passed in or to raise the soft limit
        to the maximum of the hard limit as configured for the user. To raise the user's limits further, the
        available configuration mechanisms differ between operating systems, but typically require
        privileges. In most cases it is possible to configure higher per-user resource limits via PAM or by
        setting limits on the system service encapsulating the user's service manager, i.e. the user's
        instance of <filename>user@.service</filename>. After making such changes, make sure to restart the
        user's service manager.</para>
 
        <table>
          <title>Resource limit directives, their equivalent <command>ulimit</command> shell commands and the unit used</title>
 
          <tgroup cols='4'>
            <colspec colname='directive' />
            <colspec colname='equivalent' />
            <colspec colname='unit' />
            <colspec colname='notes' />
            <thead>
              <row>
                <entry>Directive</entry>
                <entry><command>ulimit</command> equivalent</entry>
                <entry>Unit</entry>
                <entry>Notes</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>LimitCPU=</entry>
                <entry>ulimit -t</entry>
                <entry>Seconds</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitFSIZE=</entry>
                <entry>ulimit -f</entry>
                <entry>Bytes</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitDATA=</entry>
                <entry>ulimit -d</entry>
                <entry>Bytes</entry>
                <entry>Do not use. This limits the allowed address range, not memory use! Defaults to unlimited and should not be lowered. To limit memory use, see <varname>MemoryMax=</varname> in <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</entry>
              </row>
              <row>
                <entry>LimitSTACK=</entry>
                <entry>ulimit -s</entry>
                <entry>Bytes</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitCORE=</entry>
                <entry>ulimit -c</entry>
                <entry>Bytes</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitRSS=</entry>
                <entry>ulimit -m</entry>
                <entry>Bytes</entry>
                <entry>Do not use. No effect on Linux.</entry>
              </row>
              <row>
                <entry>LimitNOFILE=</entry>
                <entry>ulimit -n</entry>
                <entry>Number of File Descriptors</entry>
                <entry>Do not use. Be careful when raising the soft limit above 1024, since <citerefentry project='man-pages'><refentrytitle>select</refentrytitle><manvolnum>2</manvolnum></citerefentry> cannot function with file descriptors above 1023 on Linux. Nowadays, the hard limit defaults to 524288, a very high value compared to historical defaults. Typically applications should increase their soft limit to the hard limit on their own, if they are OK with working with file descriptors above 1023, i.e. do not use <citerefentry project='man-pages'><refentrytitle>select</refentrytitle><manvolnum>2</manvolnum></citerefentry>. Note that file descriptors are nowadays accounted like any other form of memory, thus there should not be any need to lower the hard limit. Use <varname>MemoryMax=</varname> to control overall service memory use, including file descriptor memory.</entry>
              </row>
              <row>
                <entry>LimitAS=</entry>
                <entry>ulimit -v</entry>
                <entry>Bytes</entry>
                <entry>Do not use. This limits the allowed address range, not memory use! Defaults to unlimited and should not be lowered. To limit memory use, see <varname>MemoryMax=</varname> in <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</entry>
              </row>
              <row>
                <entry>LimitNPROC=</entry>
                <entry>ulimit -u</entry>
                <entry>Number of Processes</entry>
                <entry>This limit is enforced based on the number of processes belonging to the user. Typically it is better to track processes per service, i.e. use <varname>TasksMax=</varname>, see <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</entry>
              </row>
              <row>
                <entry>LimitMEMLOCK=</entry>
                <entry>ulimit -l</entry>
                <entry>Bytes</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitLOCKS=</entry>
                <entry>ulimit -x</entry>
                <entry>Number of Locks</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitSIGPENDING=</entry>
                <entry>ulimit -i</entry>
                <entry>Number of Queued Signals</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitMSGQUEUE=</entry>
                <entry>ulimit -q</entry>
                <entry>Bytes</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitNICE=</entry>
                <entry>ulimit -e</entry>
                <entry>Nice Level</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitRTPRIO=</entry>
                <entry>ulimit -r</entry>
                <entry>Realtime Priority</entry>
                <entry>-</entry>
              </row>
              <row>
                <entry>LimitRTTIME=</entry>
                <entry>ulimit -R</entry>
                <entry>Microseconds</entry>
                <entry>-</entry>
              </row>
            </tbody>
          </tgroup>
        </table></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>UMask=</varname></term>
 
        <listitem><para>Controls the file mode creation mask. Takes an access mode in octal notation. See
        <citerefentry><refentrytitle>umask</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
        details. Defaults to 0022 for system units. For user units the default value is inherited from the
        per-user service manager (whose default is in turn inherited from the system service manager, and
        thus typically also is 0022 — unless overridden by a PAM module). In order to change the per-user mask
        for all user services, consider setting the <varname>UMask=</varname> setting of the user's
        <filename>user@.service</filename> system service instance. The per-user umask may also be set via
        the <varname>umask</varname> field of a user's <ulink url="https://systemd.io/USER_RECORD">JSON User
        Record</ulink> (for users managed by
        <citerefentry><refentrytitle>systemd-homed.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
        this field may be controlled via <command>homectl --umask=</command>). It may also be set via a PAM
        module, such as <citerefentry
        project='man-pages'><refentrytitle>pam_umask</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>CoredumpFilter=</varname></term>
 
        <listitem><para>Controls which types of memory mappings will be saved if the process dumps core
        (using the <filename>/proc/<replaceable>pid</replaceable>/coredump_filter</filename> file). Takes a
        whitespace-separated combination of mapping type names or numbers (with the default base 16). Mapping
        type names are <constant>private-anonymous</constant>, <constant>shared-anonymous</constant>,
        <constant>private-file-backed</constant>, <constant>shared-file-backed</constant>,
        <constant>elf-headers</constant>, <constant>private-huge</constant>,
        <constant>shared-huge</constant>, <constant>private-dax</constant>, <constant>shared-dax</constant>,
        and the special values <constant>all</constant> (all types) and <constant>default</constant> (the
        kernel default of <literal><constant>private-anonymous</constant>
        <constant>shared-anonymous</constant> <constant>elf-headers</constant>
        <constant>private-huge</constant></literal>). See
        <citerefentry project='man-pages'><refentrytitle>core</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        for the meaning of the mapping types. When specified multiple times, all specified masks are
        ORed. When not set, or if the empty value is assigned, the inherited value is not changed.</para>
 
        <example>
          <title>Add DAX pages to the dump filter</title>
 
          <programlisting>CoredumpFilter=default private-dax shared-dax</programlisting>
        </example>
 
          <xi:include href="version-info.xml" xpointer="v246"/>
        </listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>KeyringMode=</varname></term>
 
        <listitem><para>Controls how the kernel session keyring is set up for the service (see <citerefentry
        project='man-pages'><refentrytitle>session-keyring</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
        details on the session keyring). Takes one of <option>inherit</option>, <option>private</option>,
        <option>shared</option>. If set to <option>inherit</option> no special keyring setup is done, and the kernel's
        default behaviour is applied. If <option>private</option> is used a new session keyring is allocated when a
        service process is invoked, and it is not linked up with any user keyring. This is the recommended setting for
        system services, as this ensures that multiple services running under the same system user ID (in particular
        the root user) do not share their key material among each other. If <option>shared</option> is used a new
        session keyring is allocated as for <option>private</option>, but the user keyring of the user configured with
        <varname>User=</varname> is linked into it, so that keys assigned to the user may be requested by the unit's
        processes. In this mode multiple units running processes under the same user ID may share key material. Unless
        <option>inherit</option> is selected the unique invocation ID for the unit (see below) is added as a protected
        key by the name <literal>invocation_id</literal> to the newly created session keyring. Defaults to
        <option>private</option> for services of the system service manager and to <option>inherit</option> for
        non-service units and for services of the user service manager.</para>
 
        <xi:include href="version-info.xml" xpointer="v235"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>OOMScoreAdjust=</varname></term>
 
        <listitem><para>Sets the adjustment value for the Linux kernel's Out-Of-Memory (OOM) killer score for
        executed processes. Takes an integer between -1000 (to disable OOM killing of processes of this unit)
        and 1000 (to make killing of processes of this unit under memory pressure very likely). See <ulink
        url="https://docs.kernel.org/filesystems/proc.html">The /proc Filesystem</ulink> for
        details. If not specified, defaults to the OOM score adjustment level of the service manager itself,
        which is normally at 0.</para>
 
        <para>Use the <varname>OOMPolicy=</varname> setting of service units to configure how the service
        manager shall react to the kernel OOM killer or <command>systemd-oomd</command> terminating a process of the service. See
        <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        for details.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TimerSlackNSec=</varname></term>
        <listitem><para>Sets the timer slack in nanoseconds for the executed processes. The timer slack controls the
        accuracy of wake-ups triggered by timers. See
        <citerefentry><refentrytitle>prctl</refentrytitle><manvolnum>2</manvolnum></citerefentry> for more
        information. Note that in contrast to most other time span definitions this parameter takes an integer value in
        nano-seconds if no unit is specified. The usual time units are understood too.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>Personality=</varname></term>
 
        <listitem><para>Controls which kernel architecture <citerefentry
        project='man-pages'><refentrytitle>uname</refentrytitle><manvolnum>2</manvolnum></citerefentry> shall
        report, when invoked by unit processes. Takes one of the architecture identifiers
        <constant>arm64</constant>, <constant>arm64-be</constant>, <constant>arm</constant>,
        <constant>arm-be</constant>, <constant>x86</constant>, <constant>x86-64</constant>,
        <constant>ppc</constant>, <constant>ppc-le</constant>, <constant>ppc64</constant>,
        <constant>ppc64-le</constant>, <constant>s390</constant> or <constant>s390x</constant>. Which
        personality architectures are supported depends on the kernel's native architecture. Usually the
        64-bit versions of the various system architectures support their immediate 32-bit personality
        architecture counterpart, but no others. For example, <constant>x86-64</constant> systems support the
        <constant>x86-64</constant> and <constant>x86</constant> personalities but no others. The personality
        feature is useful when running 32-bit services on a 64-bit host system. If not specified, the
        personality is left unmodified and thus reflects the personality of the host system's kernel. This
        option is not useful on architectures for which only one native word width was ever available, such
        as <constant>m68k</constant> (32-bit only) or <constant>alpha</constant> (64-bit only).</para>
 
        <xi:include href="version-info.xml" xpointer="v209"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>IgnoreSIGPIPE=</varname></term>
 
        <listitem><para>Takes a boolean argument. If true, <constant>SIGPIPE</constant> is ignored in the
        executed process. Defaults to true since <constant>SIGPIPE</constant> is generally only useful in
        shell pipelines.</para></listitem>
      </varlistentry>
 
    </variablelist>
  </refsect1>
 
  <refsect1>
    <title>Scheduling</title>
 
    <variablelist class='unit-directives'>
 
      <varlistentry>
        <term><varname>Nice=</varname></term>
 
        <listitem><para>Sets the default nice level (scheduling priority) for executed processes. Takes an
        integer between -20 (highest priority) and 19 (lowest priority). In case of resource contention,
        smaller values mean more resources will be made available to the unit's processes, larger values mean
        less resources will be made available. See
        <citerefentry><refentrytitle>setpriority</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
        details.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>CPUSchedulingPolicy=</varname></term>
 
        <listitem><para>Sets the CPU scheduling policy for executed processes. Takes one of <option>other</option>,
        <option>batch</option>, <option>idle</option>, <option>fifo</option>, <option>rr</option> or <option>ext</option>. See
        <citerefentry project='man-pages'><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
        details.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>CPUSchedulingPriority=</varname></term>
 
        <listitem><para>Sets the CPU scheduling priority for executed processes. The available priority range
        depends on the selected CPU scheduling policy (see above). For real-time scheduling policies an
        integer between 1 (lowest priority) and 99 (highest priority) can be used. In case of CPU resource
        contention, smaller values mean less CPU time is made available to the service, larger values mean
        more. See <citerefentry
        project='man-pages'><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry>
        for details. </para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>CPUSchedulingResetOnFork=</varname></term>
 
        <listitem><para>Takes a boolean argument. If true, elevated CPU scheduling priorities and policies
        will be reset when the executed processes call
        <citerefentry project='man-pages'><refentrytitle>fork</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
        and can hence not leak into child processes. See
        <citerefentry project='man-pages'><refentrytitle>sched_setscheduler</refentrytitle><manvolnum>2</manvolnum></citerefentry>
        for details. Defaults to false.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>CPUAffinity=</varname></term>
 
        <listitem><para>Controls the CPU affinity of the executed processes. Takes a list of CPU indices or ranges
        separated by either whitespace or commas. Alternatively, takes a special "numa" value in which case systemd
        automatically derives allowed CPU range based on the value of <varname>NUMAMask=</varname> option. CPU ranges
        are specified by the lower and upper CPU indices separated by a dash. This option may be specified more than
        once, in which case the specified CPU affinity masks are merged. If the empty string is assigned, the mask
        is reset, all assignments prior to this will have no effect. See
        <citerefentry project='man-pages'><refentrytitle>sched_setaffinity</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
        details.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>NUMAPolicy=</varname></term>
 
        <listitem><para>Controls the NUMA memory policy of the executed processes. Takes a policy type, one of:
        <option>default</option>, <option>preferred</option>, <option>bind</option>, <option>interleave</option>,
        <option>local</option>, <option>preferred-many</option> (requires Linux 5.15 or newer) and
        <option>weighted-interleave</option> (requires Linux 6.9 or newer, weights are configured via
        <filename>/sys/kernel/mm/mempolicy/weighted_interleave/</filename>). A list of NUMA nodes that should be
        associated with the policy must be specified in <varname>NUMAMask=</varname>. For more details on each
        policy please see,
        <citerefentry><refentrytitle>set_mempolicy</refentrytitle><manvolnum>2</manvolnum></citerefentry>. For overall
        overview of NUMA support in Linux see,
        <citerefentry project='man-pages'><refentrytitle>numa</refentrytitle><manvolnum>7</manvolnum></citerefentry>.
        If the kernel does not support the requested policy, a warning is logged and the setting is ignored.
        </para>
 
        <xi:include href="version-info.xml" xpointer="v243"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>NUMAMask=</varname></term>
 
        <listitem><para>Controls the NUMA node list which will be applied alongside with selected NUMA policy.
        Takes a list of NUMA nodes and has the same syntax as a list of CPUs for <varname>CPUAffinity=</varname>
        option or special "all" value which will include all available NUMA nodes in the mask. Note that the list
        of NUMA nodes is not required for <option>default</option> and <option>local</option>
        policies and for <option>preferred</option> policy we expect a single NUMA node.</para>
 
        <xi:include href="version-info.xml" xpointer="v243"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>IOSchedulingClass=</varname></term>
 
        <listitem><para>Sets the I/O scheduling class for executed processes. Takes one of the strings
        <option>realtime</option>, <option>best-effort</option> or <option>idle</option>. The kernel's
        default scheduling class is <option>best-effort</option> at a priority of 4. If the empty string is
        assigned to this option, all prior assignments to both <varname>IOSchedulingClass=</varname> and
        <varname>IOSchedulingPriority=</varname> have no effect. See
        <citerefentry><refentrytitle>ioprio_set</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
        details.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>IOSchedulingPriority=</varname></term>
 
        <listitem><para>Sets the I/O scheduling priority for executed processes. Takes an integer between 0
        (highest priority) and 7 (lowest priority). In case of I/O contention, smaller values mean more I/O
        bandwidth is made available to the unit's processes, larger values mean less bandwidth. The available
        priorities depend on the selected I/O scheduling class (see above). If the empty string is assigned
        to this option, all prior assignments to both <varname>IOSchedulingClass=</varname> and
        <varname>IOSchedulingPriority=</varname> have no effect. For the kernel's default scheduling class
        (<option>best-effort</option>) this defaults to 4. See
        <citerefentry><refentrytitle>ioprio_set</refentrytitle><manvolnum>2</manvolnum></citerefentry> for
        details.</para></listitem>
      </varlistentry>
 
    </variablelist>
  </refsect1>
 
  <refsect1>
    <title>Sandboxing</title>
 
    <para>The following sandboxing options are an effective way to limit the exposure of the system towards the unit's
    processes. It is recommended to turn on as many of these options for each unit as is possible without negatively
    affecting the process' ability to operate. Note that many of these sandboxing features are gracefully turned off on
    systems where the underlying security mechanism is not available. For example, <varname>ProtectSystem=</varname>
    has no effect if the kernel is built without file system namespacing or if the service manager runs in a container
    manager that makes file system namespacing unavailable to its payload. Similarly,
    <varname>RestrictRealtime=</varname> has no effect on systems that lack support for SECCOMP system call filtering,
    or in containers where support for this is turned off.</para>
 
    <para>Also note that some sandboxing functionality is generally not available in user services (i.e. services run
    by the per-user service manager). Specifically, the various settings requiring file system namespacing support
    (such as <varname>ProtectSystem=</varname>) are not available, as the underlying kernel functionality is only
    accessible to privileged processes. However, most namespacing settings, that will not work on their own in user
    services, will work when used in conjunction with <varname>PrivateUsers=</varname><option>true</option>.</para>
 
    <para>Note that the various options that turn directories read-only (such as
    <varname>ProtectSystem=</varname>, <varname>ReadOnlyPaths=</varname>, …) do not affect the ability for
    programs to connect to and communicate with <constant>AF_UNIX</constant> sockets in these
    directories. These options cannot be used to lock down access to IPC services hence.</para>
 
    <variablelist class='unit-directives'>
 
      <varlistentry>
        <term><varname>ProtectSystem=</varname></term>
 
        <listitem><para>Takes a boolean argument or the special values <literal>full</literal> or
        <literal>strict</literal>. If true, mounts the <filename>/usr/</filename> and the boot loader
        directories (<filename>/boot</filename> and <filename>/efi</filename>) read-only for processes
        invoked by this unit. If set to <literal>full</literal>, the <filename>/etc/</filename> directory is
        mounted read-only, too. If set to <literal>strict</literal> the entire file system hierarchy is
        mounted read-only, except for the API file system subtrees <filename>/dev/</filename>,
        <filename>/proc/</filename> and <filename>/sys/</filename> (protect these directories using
        <varname>PrivateDevices=</varname>, <varname>ProtectKernelTunables=</varname>,
        <varname>ProtectControlGroups=</varname>). This setting ensures that any modification of the
        vendor-supplied operating system (and optionally its configuration, and local mounts) is prohibited
        for the service. It is recommended to enable this setting for all long-running services, unless they
        are involved with system updates or need to modify the operating system in other ways. If this option
        is used, <varname>ReadWritePaths=</varname> may be used to exclude specific directories from being
        made read-only. Similar, <varname>StateDirectory=</varname>, <varname>LogsDirectory=</varname>, … and
        related directory settings (see below) also exclude the specific directories from the effect of
        <varname>ProtectSystem=</varname>. This setting is implied if <varname>DynamicUser=</varname> is
        set. This setting cannot ensure protection in all cases. In general it has the same limitations as
        <varname>ReadOnlyPaths=</varname>, see below. Defaults to off.</para>
 
        <para>Note that if <varname>ProtectSystem=</varname> is set to <literal>strict</literal> and
        <varname>PrivateTmp=</varname> is enabled, then <filename>/tmp/</filename> and
        <filename>/var/tmp/</filename> will be writable.</para>
 
        <xi:include href="version-info.xml" xpointer="v214"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>ProtectHome=</varname></term>
 
        <listitem><para>Takes a boolean argument or the special values <literal>read-only</literal> or
        <literal>tmpfs</literal>. If true, the directories <filename>/home/</filename>,
        <filename>/root</filename>, and <filename>/run/user</filename> are made inaccessible and empty for
        processes invoked by this unit. If set to <literal>read-only</literal>, the three directories are
        made read-only instead. If set to <literal>tmpfs</literal>, temporary file systems are mounted on the
        three directories in read-only mode. The value <literal>tmpfs</literal> is useful to hide home
        directories not relevant to the processes invoked by the unit, while still allowing necessary
        directories to be made visible when listed in <varname>BindPaths=</varname> or
        <varname>BindReadOnlyPaths=</varname>.</para>
 
        <para>Setting this to <literal>yes</literal> is mostly equivalent to setting the three directories in
        <varname>InaccessiblePaths=</varname>. Similarly, <literal>read-only</literal> is mostly equivalent to
        <varname>ReadOnlyPaths=</varname>, and <literal>tmpfs</literal> is mostly equivalent to
        <varname>TemporaryFileSystem=</varname> with <literal>:ro</literal>.</para>
 
        <para>It is recommended to enable this setting for all long-running services (in particular
        network-facing ones), to ensure they cannot get access to private user data, unless the services
        actually require access to the user's private data. This setting is implied if
        <varname>DynamicUser=</varname> is set. This setting cannot ensure protection in all cases. In
        general it has the same limitations as <varname>ReadOnlyPaths=</varname>, see below.</para>
 
        <para>Note that this setting provides no protection if home directories are placed at a non-standard
        location, i.e. outside of the hierarchies listed above.</para>
 
        <xi:include href="system-or-user-ns.xml" xpointer="singular"/>
 
        <xi:include href="version-info.xml" xpointer="v214"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>RuntimeDirectory=</varname></term>
        <term><varname>StateDirectory=</varname></term>
        <term><varname>CacheDirectory=</varname></term>
        <term><varname>LogsDirectory=</varname></term>
        <term><varname>ConfigurationDirectory=</varname></term>
 
        <listitem><para>These options take a whitespace-separated list of directory names. The specified
        directory names must be relative, and may not include <literal>..</literal>. If set, when the unit is
        started, one or more directories by the specified names will be created (including their parents)
        below the locations defined in the following table. Also, the corresponding environment variable will
        be defined with the full paths of the directories. If multiple directories are set, then in the
        environment variable the paths are concatenated with colon (<literal>:</literal>).</para>
 
        <para>If <varname>DynamicUser=</varname> is used, and if the kernel version supports
        <ulink url="https://lwn.net/Articles/896255/">id-mapped mounts</ulink>, the specified directories will
        be owned by "nobody" in the host namespace and will be mapped to (and will be owned by) the service's
        UID/GID in its own namespace. For backward compatibility, existing directories created without id-mapped
        mounts will be kept untouched.</para>
 
        <table>
          <title>Automatic directory creation and environment variables</title>
          <tgroup cols='4'>
            <thead>
              <row>
                <entry>Directory</entry>
                <entry>Below path for system units</entry>
                <entry>Below path for user units</entry>
                <entry>Environment variable set</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry><varname>RuntimeDirectory=</varname></entry>
                <entry><filename>/run/</filename></entry>
                <entry><varname>$XDG_RUNTIME_DIR</varname></entry>
                <entry><varname>$RUNTIME_DIRECTORY</varname></entry>
              </row>
              <row>
                <entry><varname>StateDirectory=</varname></entry>
                <entry><filename>/var/lib/</filename></entry>
                <entry><varname>$XDG_STATE_HOME</varname></entry>
                <entry><varname>$STATE_DIRECTORY</varname></entry>
              </row>
              <row>
                <entry><varname>CacheDirectory=</varname></entry>
                <entry><filename>/var/cache/</filename></entry>
                <entry><varname>$XDG_CACHE_HOME</varname></entry>
                <entry><varname>$CACHE_DIRECTORY</varname></entry>
              </row>
              <row>
                <entry><varname>LogsDirectory=</varname></entry>
                <entry><filename>/var/log/</filename></entry>
                <entry><varname>$XDG_STATE_HOME</varname><filename>/log/</filename></entry>
                <entry><varname>$LOGS_DIRECTORY</varname></entry>
              </row>
              <row>
                <entry><varname>ConfigurationDirectory=</varname></entry>
                <entry><filename>/etc/</filename></entry>
                <entry><varname>$XDG_CONFIG_HOME</varname></entry>
                <entry><varname>$CONFIGURATION_DIRECTORY</varname></entry>
              </row>
            </tbody>
          </tgroup>
        </table>
 
        <para>In case of <varname>RuntimeDirectory=</varname> the innermost subdirectories are removed when
        the unit is stopped. It is possible to preserve the specified directories in this case if
        <varname>RuntimeDirectoryPreserve=</varname> is configured to <option>restart</option> or
        <option>yes</option> (see below). The directories specified with <varname>StateDirectory=</varname>,
        <varname>CacheDirectory=</varname>, <varname>LogsDirectory=</varname>,
        <varname>ConfigurationDirectory=</varname> are not removed when the unit is stopped.</para>
 
        <para>Except in case of <varname>ConfigurationDirectory=</varname>, the innermost specified directories will be
        owned by the user and group specified in <varname>User=</varname> and <varname>Group=</varname>. If the
        specified directories already exist and their owning user or group do not match the configured ones, all files
        and directories below the specified directories as well as the directories themselves will have their file
        ownership recursively changed to match what is configured. As an optimization, if the specified directories are
        already owned by the right user and group, files and directories below of them are left as-is, even if they do
        not match what is requested. The innermost specified directories will have their access mode adjusted to the
        what is specified in <varname>RuntimeDirectoryMode=</varname>, <varname>StateDirectoryMode=</varname>,
        <varname>CacheDirectoryMode=</varname>, <varname>LogsDirectoryMode=</varname> and
        <varname>ConfigurationDirectoryMode=</varname>.</para>
 
        <para>These options imply <varname>BindPaths=</varname> for the specified paths. When combined with
        <varname>RootDirectory=</varname> or <varname>RootImage=</varname> these paths always reside on the host and
        are mounted from there into the unit's file system namespace.</para>
 
        <para>If <varname>DynamicUser=</varname> is used, the logic for <varname>CacheDirectory=</varname>,
        <varname>LogsDirectory=</varname> and <varname>StateDirectory=</varname> is slightly altered: the directories are created below
        <filename>/var/cache/private</filename>, <filename>/var/log/private</filename> and <filename>/var/lib/private</filename>,
        respectively, which are host directories made inaccessible to
        unprivileged users, which ensures that access to these directories cannot be gained through dynamic
        user ID recycling. Symbolic links are created to hide this difference in behaviour. Both from
        perspective of the host and from inside the unit, the relevant directories hence always appear
        directly below <filename>/var/cache</filename>, <filename>/var/log</filename> and
        <filename>/var/lib</filename>.</para>
 
        <para>Use <varname>RuntimeDirectory=</varname> to manage one or more runtime directories for the unit and bind
        their lifetime to the daemon runtime. This is particularly useful for unprivileged daemons that cannot create
        runtime directories in <filename>/run/</filename> due to lack of privileges, and to make sure the runtime
        directory is cleaned up automatically after use. For runtime directories that require more complex or different
        configuration or lifetime guarantees, please consider using
        <citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>.</para>
 
        <para><varname>RuntimeDirectory=</varname>, <varname>StateDirectory=</varname>,
        <varname>CacheDirectory=</varname> and <varname>LogsDirectory=</varname>  optionally support two
        more parameters, separated by <literal>:</literal>. The second parameter will be interpreted as a
        destination path that will be created as a symlink to the directory. The symlinks will be created
        after any <varname>BindPaths=</varname> or <varname>TemporaryFileSystem=</varname> options have been
        set up, to make ephemeral symlinking possible. The same source can have multiple symlinks, by using
        the same first parameter, but a different second parameter. The third parameter is a flags field,
        and since v257 can take a value of <constant>ro</constant> to make the directory read only for the
        service. This is also supported for <varname>ConfigurationDirectory=</varname>. If multiple symlinks
        are set up, the directory will be read only if at least one is configured to be read only. To pass a
        flag without a destination symlink, the second parameter can be empty, for example:
        <programlisting>ConfigurationDirectory=foo::ro</programlisting></para>
 
        <para>The directories defined by these options are always created under the standard paths used by systemd
        (<filename>/var/</filename>, <filename>/run/</filename>, <filename>/etc/</filename>, …). If the service needs
        directories in a different location, a different mechanism has to be used to create them.</para>
 
        <para><citerefentry><refentrytitle>tmpfiles.d</refentrytitle><manvolnum>5</manvolnum></citerefentry> provides
        functionality that overlaps with these options. Using these options is recommended, because the lifetime of
        the directories is tied directly to the lifetime of the unit, and it is not necessary to ensure that the
        <filename>tmpfiles.d</filename> configuration is executed before the unit is started.</para>
 
        <para>To remove any of the directories created by these settings, use the <command>systemctl clean
        …</command> command on the relevant units, see
        <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
        details.</para>
 
        <para>Example: if a system service unit has the following,
        <programlisting>RuntimeDirectory=foo/bar baz</programlisting>
        the service manager creates <filename index='false'>/run/foo</filename> (if it does not exist),
 
        <filename index='false'>/run/foo/bar</filename>, and <filename index='false'>/run/baz</filename>. The
        directories <filename index='false'>/run/foo/bar</filename> and
        <filename index='false'>/run/baz</filename> except <filename index='false'>/run/foo</filename> are
        owned by the user and group specified in <varname>User=</varname> and <varname>Group=</varname>, and removed
        when the service is stopped.</para>
 
        <para>Example: if a system service unit has the following,
        <programlisting>RuntimeDirectory=foo/bar
StateDirectory=aaa/bbb ccc</programlisting>
        then the environment variable <literal>RUNTIME_DIRECTORY</literal> is set with <literal>/run/foo/bar</literal>, and
        <literal>STATE_DIRECTORY</literal> is set with <literal>/var/lib/aaa/bbb:/var/lib/ccc</literal>.</para>
 
        <para>Example: if a system service unit has the following,
        <programlisting>RuntimeDirectory=foo:bar foo:baz</programlisting>
        the service manager creates <filename index='false'>/run/foo</filename> (if it does not exist), and
        <filename index='false'>/run/bar</filename> plus <filename index='false'>/run/baz</filename> as symlinks to
        <filename index='false'>/run/foo</filename>.</para>
 
        <xi:include href="version-info.xml" xpointer="v211"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>RuntimeDirectoryMode=</varname></term>
        <term><varname>StateDirectoryMode=</varname></term>
        <term><varname>CacheDirectoryMode=</varname></term>
        <term><varname>LogsDirectoryMode=</varname></term>
        <term><varname>ConfigurationDirectoryMode=</varname></term>
 
        <listitem><para>Specifies the access mode of the directories specified in <varname>RuntimeDirectory=</varname>,
        <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>, <varname>LogsDirectory=</varname>, or
        <varname>ConfigurationDirectory=</varname>, respectively, as an octal number. Defaults to
        <constant>0755</constant>. See "Permissions" in <citerefentry
        project='man-pages'><refentrytitle>path_resolution</refentrytitle><manvolnum>7</manvolnum></citerefentry> for a
        discussion of the meaning of permission bits.</para>
 
        <xi:include href="version-info.xml" xpointer="v234"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>StateDirectoryQuota=</varname></term>
        <term><varname>CacheDirectoryQuota=</varname></term>
        <term><varname>LogsDirectoryQuota=</varname></term>
 
        <listitem><para>Specifies the storage limits for the directories specified in <varname>StateDirectory=</varname>,
        <varname>CacheDirectory=</varname>, or <varname>LogsDirectory=</varname> respectively.</para>
 
        <para>The storage quota is defined in terms of disk blocks and inodes, as per
        <ulink url="https://man7.org/linux/man-pages/man2/quotactl.2.html">quotactl</ulink>. Takes an absolute size limit
        in bytes. If the value is suffixed with K, M, G or T, the specified size is parsed as Kilobytes, Megabytes, Gigabytes,
        or Terabytes (with the base 1024), respectively. If an absolute size limit is specified, only the block quota is set
        (rounded up to the nearest block). Alternatively, a percentage value may be specified, which applies the same percent
        quota to both blocks and inodes. Defaults to <constant>off</constant>, in which case no storage limits will be set.</para>
 
        <para>Only hard limits are set, not soft limits. If the underlying filesystem for the specified directories does not
        support project quotas, the specified storage limits will not be set. In addition to enabling per-unit quotas with
        these settings, it is necessary to enable <constant>prjquota</constant> on the file system level as well
        (i.e. <command>tune2fs -Q prjquota</command>). Quotas must also be turned on with
        <ulink url="https://linux.die.net/man/8/quotaon">quotaon.</ulink></para>
 
        <xi:include href="version-info.xml" xpointer="v258"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>StateDirectoryAccounting=</varname></term>
        <term><varname>CacheDirectoryAccounting=</varname></term>
        <term><varname>LogsDirectoryAccounting=</varname></term>
 
        <listitem><para>Takes a boolean argument. If true, a project ID is assigned to the directories specified in
        <varname>StateDirectory=</varname>, <varname>CacheDirectory=</varname>, or <varname>LogsDirectory=</varname>
        respectively, which is used for tracking disk usage when disk quotas are turned on
        (see <ulink url="https://man7.org/linux/man-pages/man8/repquota.8.html">repquota</ulink>). Defaults to false.</para>
 
        <para>To set and enforce disk quotas, <varname>StateDirectoryQuota=</varname>, <varname>CacheDirectoryQuota=</varname>,
        or <varname>LogsDirectoryQuota=</varname> must be specified.</para>
 
        <xi:include href="version-info.xml" xpointer="v258"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>RuntimeDirectoryPreserve=</varname></term>
 
        <listitem><para>Takes a boolean argument or <option>restart</option>. If set to <option>no</option> (the
        default), the directories specified in <varname>RuntimeDirectory=</varname> are always removed when the service
        stops. If set to <option>restart</option> the directories are preserved when the service is both automatically
        and manually restarted. Here, the automatic restart means the operation specified in
        <varname>Restart=</varname>, and manual restart means the one triggered by <command>systemctl restart
        foo.service</command>. If set to <option>yes</option>, then the directories are not removed when the service is
        stopped. Note that since the runtime directory <filename>/run/</filename> is a mount point of
        <literal>tmpfs</literal>, then for system services the directories specified in
        <varname>RuntimeDirectory=</varname> are removed when the system is rebooted.</para>
 
        <para>If <varname>DynamicUser=</varname> is used together with
        <varname>RuntimeDirectoryPreserve=</varname> set to values other than <option>no</option>, the logic
        is slightly altered: the <varname>RuntimeDirectory=</varname> directories are created below
        <filename>/run/private/</filename>, which is a host directory made inaccessible to unprivileged
        users, which ensures that access to these directories cannot be gained through dynamic user ID
        recycling. Symbolic links are created to hide this difference in behaviour. Both from the
        perspective of the host and from inside the unit, the relevant directories hence always appear
        directly below <filename>/run/</filename>.</para>
 
        <xi:include href="version-info.xml" xpointer="v235"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TimeoutCleanSec=</varname></term>
        <listitem><para>Configures a timeout on the clean-up operation requested through <command>systemctl
        clean …</command>, see
        <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry> for
        details. Takes the usual time values and defaults to <constant>infinity</constant>, i.e. by default
        no timeout is applied. If a timeout is configured the clean operation will be aborted forcibly when
        the timeout is reached, potentially leaving resources on disk.</para>
 
        <xi:include href="version-info.xml" xpointer="v244"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>ReadWritePaths=</varname></term>
        <term><varname>ReadOnlyPaths=</varname></term>
        <term><varname>InaccessiblePaths=</varname></term>
        <term><varname>ExecPaths=</varname></term>
        <term><varname>NoExecPaths=</varname></term>
 
        <listitem><para>Sets up a new file system namespace for executed processes. These options may be used
        to limit access a process has to the file system. Each setting takes a space-separated list of paths
        relative to the host's root directory (i.e. the system running the service manager). Note that if
        paths contain symlinks, they are resolved relative to the root directory set with
        <varname>RootDirectory=</varname>/<varname>RootImage=</varname>.</para>
 
        <para>Paths listed in <varname>ReadWritePaths=</varname> are accessible from within the namespace
        with the same access modes as from outside of it. Paths listed in <varname>ReadOnlyPaths=</varname>
        are accessible for reading only, writing will be refused even if the usual file access controls would
        permit this. Nest <varname>ReadWritePaths=</varname> inside of <varname>ReadOnlyPaths=</varname> in
        order to provide writable subdirectories within read-only directories. Use
        <varname>ReadWritePaths=</varname> in order to allow-list specific paths for write access if
        <varname>ProtectSystem=strict</varname> is used. Note that <varname>ReadWritePaths=</varname> cannot
        be used to gain write access to a file system whose superblock is mounted read-only. On Linux, for
        each mount point write access is granted only if the mount point itself <emphasis>and</emphasis> the
        file system superblock backing it are not marked read-only. <varname>ReadWritePaths=</varname> only
        controls the former, not the latter, hence a read-only file system superblock remains
        protected.</para>
 
        <para>Paths listed in <varname>InaccessiblePaths=</varname> will be made inaccessible for processes inside
        the namespace along with everything below them in the file system hierarchy. This may be more restrictive than
        desired, because it is not possible to nest <varname>ReadWritePaths=</varname>, <varname>ReadOnlyPaths=</varname>,
        <varname>BindPaths=</varname>, or <varname>BindReadOnlyPaths=</varname> inside it. For a more flexible option,
        see <varname>TemporaryFileSystem=</varname>.</para>
 
        <para>Content in paths listed in <varname>NoExecPaths=</varname> are not executable even if the usual
        file access controls would permit this. Nest <varname>ExecPaths=</varname> inside of
        <varname>NoExecPaths=</varname> in order to provide executable content within non-executable
        directories.</para>
 
        <para>Non-directory paths may be specified as well. These options may be specified more than once,
        in which case all paths listed will have limited access from within the namespace. If the empty string is
        assigned to this option, the specific list is reset, and all prior assignments have no effect.</para>
 
        <para>Paths in <varname>ReadWritePaths=</varname>, <varname>ReadOnlyPaths=</varname>,
        <varname>InaccessiblePaths=</varname>, <varname>ExecPaths=</varname> and
        <varname>NoExecPaths=</varname> may be prefixed with <literal>-</literal>, in which case they will be
        ignored when they do not exist. If prefixed with <literal>+</literal> the paths are taken relative to the root
        directory of the unit, as configured with <varname>RootDirectory=</varname>/<varname>RootImage=</varname>,
        instead of relative to the root directory of the host (see above). When combining <literal>-</literal> and
        <literal>+</literal> on the same path make sure to specify <literal>-</literal> first, and <literal>+</literal>
        second.</para>
 
        <para>Note that these settings will disconnect propagation of mounts from the unit's processes to the
        host. This means that this setting may not be used for services which shall be able to install mount points in
        the main mount namespace. For <varname>ReadWritePaths=</varname> and <varname>ReadOnlyPaths=</varname>,
        propagation in the other direction is not affected, i.e. mounts created on the host generally appear in the
        unit processes' namespace, and mounts removed on the host also disappear there too. In particular, note that
        mount propagation from host to unit will result in unmodified mounts to be created in the unit's namespace,
        i.e. writable mounts appearing on the host will be writable in the unit's namespace too, even when propagated
        below a path marked with <varname>ReadOnlyPaths=</varname>! Restricting access with these options hence does
        not extend to submounts of a directory that are created later on. This means the lock-down offered by that
        setting is not complete, and does not offer full protection.</para>
 
        <para>Note that the effect of these settings may be undone by privileged processes. In order to set up an
        effective sandboxed environment for a unit it is thus recommended to combine these settings with either
        <varname>CapabilityBoundingSet=~CAP_SYS_ADMIN</varname> or <varname>SystemCallFilter=~@mount</varname>.</para>
 
        <para>Please be extra careful when applying these options to API file systems (a list of them could be
        found in <varname>MountAPIVPS=</varname>), since they may be required for basic system functionalities.
        Moreover, <filename>/run/</filename> needs to be writable for setting up mount namespace and propagation.</para>
 
        <para>Simple allow-list example using these directives:
        <programlisting>[Service]
ReadOnlyPaths=/
ReadWritePaths=/var /run
InaccessiblePaths=-/lost+found
NoExecPaths=/
ExecPaths=/usr/sbin/my_daemon /usr/lib /usr/lib64
</programlisting></para>
 
        <xi:include href="system-or-user-ns.xml" xpointer="plural"/>
 
        <xi:include href="version-info.xml" xpointer="v231"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TemporaryFileSystem=</varname></term>
 
        <listitem><para>Takes a space-separated list of mount points for temporary file systems (tmpfs). If set, a new file
        system namespace is set up for executed processes, and a temporary file system is mounted on each mount point.
        This option may be specified more than once, in which case temporary file systems are mounted on all listed mount
        points. If the empty string is assigned to this option, the list is reset, and all prior assignments have no effect.
        Each mount point may optionally be suffixed with a colon (<literal>:</literal>) and mount options such as
        <literal>size=10%</literal> or <literal>ro</literal>. By default, each temporary file system is mounted
        with <literal>nodev,strictatime,mode=0755</literal>. These can be disabled by explicitly specifying the corresponding
        mount options, e.g., <literal>dev</literal> or <literal>nostrictatime</literal>.</para>
 
        <para>This is useful to hide files or directories not relevant to the processes invoked by the unit, while necessary
        files or directories can be still accessed by combining with <varname>BindPaths=</varname> or
        <varname>BindReadOnlyPaths=</varname>:</para>
 
        <para>Example: if a unit has the following,
        <programlisting>TemporaryFileSystem=/var:ro
BindReadOnlyPaths=/var/lib/systemd</programlisting>
        then the invoked processes by the unit cannot see any files or directories under <filename>/var/</filename> except for
        <filename>/var/lib/systemd</filename> or its contents.</para>
 
        <xi:include href="system-or-user-ns.xml" xpointer="singular"/>
 
        <xi:include href="version-info.xml" xpointer="v238"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>PrivateTmp=</varname></term>
 
        <listitem><para>Takes a boolean argument, or <literal>disconnected</literal>. If enabled, a new
        file system namespace will be set up for the executed processes, and <filename>/tmp/</filename>
        and <filename>/var/tmp/</filename> directories inside it are not shared with processes outside of
        the namespace, plus all temporary files created by a service in these directories will be removed
        after the service is stopped. For this setting, the same restrictions regarding mount propagation
        and privileges apply as for <varname>ReadOnlyPaths=</varname> and related calls, see above. This
        setting is useful to secure access to temporary files of the process, but makes sharing between
        processes via <filename>/tmp/</filename> or <filename>/var/tmp/</filename> impossible. If
        <varname>DynamicUser=</varname> is enabled, <literal>disconnected</literal> is implied. Otherwise,
        defaults to false.</para>
 
        <para>If <literal>true</literal>, the backing storage of the private temporary directories will
        remain on the host's <filename>/tmp/</filename> and <filename>/var/tmp/</filename> directories. It is
        possible to run two or more units within the same private <filename>/tmp/</filename> and
        <filename>/var/tmp/</filename> namespace by using the <varname>JoinsNamespaceOf=</varname> directive,
        see <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        for details. This has the side effect of adding <varname>Wants=</varname> and
        <varname>After=</varname> dependencies on all mount units necessary to access
        <filename>/tmp/</filename> and <filename>/var/tmp/</filename> on the host. Moreover, an implicit
        <varname>After=</varname> ordering on
        <citerefentry><refentrytitle>systemd-tmpfiles-setup.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
        is added.</para>
 
        <para>If <literal>disconnected</literal>, the directories will be backed by a completely new tmpfs
        instance, meaning that the storage is fully disconnected from the host namespace. The tmpfs instance
        does not shared with other units even if the <varname>JoinsNamespaceOf=</varname> directive is used.
        If <varname>DefaultDependencies=no</varname> is specified,
        <varname>RequiresMountsFor=/WantsMountsFor=</varname> for <filename>/var/</filename> is not
        specified, and <varname>RootDirectory=/RootImage=</varname> is not specified, then a new tmpfs is
        mounted <emphasis>only</emphasis> on <filename>/tmp/</filename>, hence the host's
        <filename>/var/tmp</filename> is still accessible from the unit. In that case,
        <varname>$TMPDIR</varname> environment variable is set to <literal>/tmp</literal> to suggest the
        processes in the unit to use <filename>/tmp/</filename>. This automatically adds
        <varname>WantsMountsFor=/var/</varname> dependency, unless <varname>DefaultDependencies=no</varname>
        and/or <varname>RootDirectory=/RootImage=</varname> are specified.</para>
 
        <table>
          <title>Summary for <varname>PrivateTmp=disconnected</varname></title>
          <tgroup cols='4' align='left' colsep='1' rowsep='1'>
            <colspec colname="other settings" />
            <colspec colname="tmpfs instance on /var/tmp/" />
            <colspec colname="$TMPVAR" />
            <colspec colname="implied dependencies" />
            <thead>
              <row>
                <entry>Other Settings</entry>
                <entry>tmpfs on /var/tmp/</entry>
                <entry>$TMPVAR</entry>
                <entry>implied dependencies</entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>(none)</entry>
                <entry>yes</entry>
                <entry>(unset)</entry>
                <entry><varname>WantsMountsFor=/var/</varname></entry>
              </row>
              <row>
                <entry><varname>RootDirectory=/RootImage=</varname></entry>
                <entry>yes</entry>
                <entry>(unset)</entry>
                <entry>(none)</entry>
              </row>
              <row>
                <entry><varname>DefaultDependency=no</varname>, <varname>RequiresMountsFor=/var/</varname></entry>
                <entry>yes</entry>
                <entry>(unset)</entry>
                <entry>(none)</entry>
              </row>
              <row>
                <entry><varname>DefaultDependency=no</varname>, <varname>WantsMountsFor=/var/</varname></entry>
                <entry>yes</entry>
                <entry>(unset)</entry>
                <entry>(none)</entry>
              </row>