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 3001–4000 of 5,316

                <entry>System calls for basic I/O: reading, writing, seeking, file descriptor duplication and closing (<citerefentry project='man-pages'><refentrytitle>read</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>write</refentrytitle><manvolnum>2</manvolnum></citerefentry>, and related calls)</entry>
              </row>
              <row>
                <entry>@chown</entry>
                <entry>Changing file ownership (<citerefentry project='man-pages'><refentrytitle>chown</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>fchownat</refentrytitle><manvolnum>2</manvolnum></citerefentry>, and related calls)</entry>
              </row>
              <row>
                <entry>@clock</entry>
                <entry>System calls for changing the system clock (<citerefentry project='man-pages'><refentrytitle>adjtimex</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>settimeofday</refentrytitle><manvolnum>2</manvolnum></citerefentry>, and related calls)</entry>
              </row>
              <row>
                <entry>@cpu-emulation</entry>
                <entry>System calls for CPU emulation functionality (<citerefentry project='man-pages'><refentrytitle>vm86</refentrytitle><manvolnum>2</manvolnum></citerefentry> and related calls)</entry>
              </row>
              <row>
                <entry>@debug</entry>
                <entry>Debugging, performance monitoring and tracing functionality (<citerefentry project='man-pages'><refentrytitle>ptrace</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>perf_event_open</refentrytitle><manvolnum>2</manvolnum></citerefentry> and related calls)</entry>
              </row>
              <row>
                <entry>@file-system</entry>
                <entry>File system operations: opening, creating files and directories for read and write, renaming and removing them, reading file properties, or creating hard and symbolic links</entry>
              </row>
              <row>
                <entry>@io-event</entry>
                <entry>Event loop system calls (<citerefentry project='man-pages'><refentrytitle>poll</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>select</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>epoll</refentrytitle><manvolnum>7</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>eventfd</refentrytitle><manvolnum>2</manvolnum></citerefentry> and related calls)</entry>
              </row>
              <row>
                <entry>@ipc</entry>
                <entry>Pipes, SysV IPC, POSIX Message Queues and other IPC (<citerefentry project='man-pages'><refentrytitle>mq_overview</refentrytitle><manvolnum>7</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>svipc</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
              </row>
              <row>
                <entry>@keyring</entry>
                <entry>Kernel keyring access (<citerefentry project='man-pages'><refentrytitle>keyctl</refentrytitle><manvolnum>2</manvolnum></citerefentry> and related calls)</entry>
              </row>
              <row>
                <entry>@memlock</entry>
                <entry>Locking of memory in RAM (<citerefentry project='man-pages'><refentrytitle>mlock</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>mlockall</refentrytitle><manvolnum>2</manvolnum></citerefentry> and related calls)</entry>
              </row>
              <row>
                <entry>@module</entry>
                <entry>Loading and unloading of kernel modules (<citerefentry project='man-pages'><refentrytitle>init_module</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>delete_module</refentrytitle><manvolnum>2</manvolnum></citerefentry> and related calls)</entry>
              </row>
              <row>
                <entry>@mount</entry>
                <entry>Mounting and unmounting of file systems (<citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>chroot</refentrytitle><manvolnum>2</manvolnum></citerefentry>, and related calls)</entry>
              </row>
              <row>
                <entry>@network-io</entry>
                <entry>Socket I/O (including local AF_UNIX): <citerefentry project='man-pages'><refentrytitle>socket</refentrytitle><manvolnum>7</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>unix</refentrytitle><manvolnum>7</manvolnum></citerefentry></entry>
              </row>
              <row>
                <entry>@obsolete</entry>
                <entry>Unusual, obsolete or unimplemented (<citerefentry project='man-pages'><refentrytitle>create_module</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>gtty</refentrytitle><manvolnum>2</manvolnum></citerefentry>, …)</entry>
              </row>
              <row>
                <entry>@pkey</entry>
                <entry>System calls that deal with memory protection keys (<citerefentry project='man-pages'><refentrytitle>pkeys</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
              </row>
              <row>
                <entry>@privileged</entry>
                <entry>All system calls which need super-user capabilities (<citerefentry project='man-pages'><refentrytitle>capabilities</refentrytitle><manvolnum>7</manvolnum></citerefentry>)</entry>
              </row>
              <row>
                <entry>@process</entry>
                <entry>Process control, execution, namespacing operations (<citerefentry project='man-pages'><refentrytitle>clone</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>kill</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>namespaces</refentrytitle><manvolnum>7</manvolnum></citerefentry>, …)</entry>
              </row>
              <row>
                <entry>@raw-io</entry>
                <entry>Raw I/O port access (<citerefentry project='man-pages'><refentrytitle>ioperm</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>iopl</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <function>pciconfig_read()</function>, …)</entry>
              </row>
              <row>
                <entry>@reboot</entry>
                <entry>System calls for rebooting and reboot preparation (<citerefentry project='man-pages'><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <function>kexec()</function>, …)</entry>
              </row>
              <row>
                <entry>@resources</entry>
                <entry>System calls for changing resource limits, memory and scheduling parameters (<citerefentry project='man-pages'><refentrytitle>setrlimit</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>setpriority</refentrytitle><manvolnum>2</manvolnum></citerefentry>, …)</entry>
              </row>
              <row>
                <entry>@sandbox</entry>
                <entry>System calls for sandboxing programs (<citerefentry project='man-pages'><refentrytitle>seccomp</refentrytitle><manvolnum>2</manvolnum></citerefentry>, Landlock system calls, …)</entry>
              </row>
              <row>
                <entry>@setuid</entry>
                <entry>System calls for changing user ID and group ID credentials, (<citerefentry project='man-pages'><refentrytitle>setuid</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>setgid</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>setresuid</refentrytitle><manvolnum>2</manvolnum></citerefentry>, …)</entry>
              </row>
              <row>
                <entry>@signal</entry>
                <entry>System calls for manipulating and handling process signals (<citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>sigprocmask</refentrytitle><manvolnum>2</manvolnum></citerefentry>, …)</entry>
              </row>
              <row>
                <entry>@swap</entry>
                <entry>System calls for enabling/disabling swap devices (<citerefentry project='man-pages'><refentrytitle>swapon</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>swapoff</refentrytitle><manvolnum>2</manvolnum></citerefentry>)</entry>
              </row>
              <row>
                <entry>@sync</entry>
                <entry>Synchronizing files and memory to disk (<citerefentry project='man-pages'><refentrytitle>fsync</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>msync</refentrytitle><manvolnum>2</manvolnum></citerefentry>, and related calls)</entry>
              </row>
              <row>
                <entry>@system-service</entry>
                <entry>A reasonable set of system calls used by common system services, excluding any special purpose calls. This is the recommended starting point for allow-listing system calls for system services, as it contains what is typically needed by system services, but excludes overly specific interfaces. For example, the following APIs are excluded: <literal>@clock</literal>, <literal>@mount</literal>, <literal>@swap</literal>, <literal>@reboot</literal>.</entry>
              </row>
              <row>
                <entry>@timer</entry>
                <entry>System calls for scheduling operations by time (<citerefentry project='man-pages'><refentrytitle>alarm</refentrytitle><manvolnum>2</manvolnum></citerefentry>, <citerefentry project='man-pages'><refentrytitle>timer_create</refentrytitle><manvolnum>2</manvolnum></citerefentry>, …)</entry>
              </row>
              <row>
                <entry>@known</entry>
                <entry>All system calls defined by the kernel. This list is defined statically in systemd based on a kernel version that was available when this systemd version was released. It will become progressively more out-of-date as the kernel is updated.</entry>
              </row>
            </tbody>
          </tgroup>
        </table>
 
        Note, that as new system calls are added to the kernel, additional system calls might be added to the groups
        above. Contents of the sets may also change between systemd versions. In addition, the list of system calls
        depends on the kernel version and architecture for which systemd was compiled. Use
        <command>systemd-analyze syscall-filter</command> to list the actual list of system calls in each
        filter.</para>
 
        <para>Generally, allow-listing system calls (rather than deny-listing) is the safer mode of
        operation. It is recommended to enforce system call allow lists for all long-running system
        services. Specifically, the following lines are a relatively safe basic choice for the majority of
        system services:</para>
 
        <programlisting>[Service]
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM</programlisting>
 
        <para>Note that various kernel system calls are defined redundantly: there are multiple system calls
        for executing the same operation. For example, the <function>pidfd_send_signal()</function> system
        call may be used to execute operations similar to what can be done with the older
        <function>kill()</function> system call, hence blocking the latter without the former only provides
        weak protection. Since new system calls are added regularly to the kernel as development progresses,
        keeping system call deny lists comprehensive requires constant work. It is thus recommended to use
        allow-listing instead, which offers the benefit that new system calls are by default implicitly
        blocked until the allow list is updated.</para>
 
        <para>Also note that a number of system calls are required to be accessible for the dynamic linker to
        work. The dynamic linker is required for running most regular programs (specifically: all dynamic ELF
        binaries, which is how most distributions build packaged programs). This means that blocking these
        system calls (which include <function>open()</function>, <function>openat()</function> or
        <function>mmap()</function>) will make most programs typically shipped with generic distributions
        unusable.</para>
 
        <para>It is recommended to combine the file system namespacing related options with
        <varname>SystemCallFilter=~@mount</varname>, in order to prohibit the unit's processes to undo the
        mappings. Specifically these are the options <varname>PrivateTmp=</varname>,
        <varname>PrivateDevices=</varname>, <varname>ProtectSystem=</varname>, <varname>ProtectHome=</varname>,
        <varname>ProtectKernelTunables=</varname>, <varname>ProtectControlGroups=</varname>,
        <varname>ProtectKernelLogs=</varname>, <varname>ProtectClock=</varname>, <varname>ReadOnlyPaths=</varname>,
        <varname>InaccessiblePaths=</varname> and <varname>ReadWritePaths=</varname>.</para>
 
        <xi:include href="version-info.xml" xpointer="v187"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SystemCallErrorNumber=</varname></term>
 
        <listitem><para>Takes an <literal>errno</literal> error number (between 1 and 4095) or errno name
        such as <constant>EPERM</constant>, <constant>EACCES</constant> or <constant>EUCLEAN</constant>, to
        return when the system call filter configured with <varname>SystemCallFilter=</varname> is triggered,
        instead of terminating the process immediately. See <citerefentry
        project='man-pages'><refentrytitle>errno</refentrytitle><manvolnum>3</manvolnum></citerefentry> for a
        full list of error codes. When this setting is not used, or when the empty string or the special
        setting <literal>kill</literal> is assigned, the process will be terminated immediately when the
        filter is triggered.</para>
 
        <xi:include href="version-info.xml" xpointer="v209"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SystemCallArchitectures=</varname></term>
 
        <listitem><para>Takes a space-separated list of architecture identifiers to include in the system call
        filter. The known architecture identifiers are the same as for <varname>ConditionArchitecture=</varname>
        described in <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
        as well as <constant>x32</constant>, <constant>mips64-n32</constant>, <constant>mips64-le-n32</constant>, and
        the special identifier <constant>native</constant>. The special identifier <constant>native</constant>
        implicitly maps to the native architecture of the system (or more precisely: to the architecture the system
        manager is compiled for). By default, this option is set to the empty list, i.e. no filtering is applied.</para>
 
        <para>If this setting is used, processes of this unit will only be permitted to call native system calls, and
        system calls of the specified architectures. For the purposes of this option, the x32 architecture is treated
        as including x86-64 system calls. However, this setting still fulfills its purpose, as explained below, on
        x32.</para>
 
        <para>System call filtering is not equally effective on all architectures. For example, on x86
        filtering of network socket-related calls is not possible, due to ABI limitations — a limitation that x86-64
        does not have, however. On systems supporting multiple ABIs at the same time — such as x86/x86-64 — it is hence
        recommended to limit the set of permitted system call architectures so that secondary ABIs may not be used to
        circumvent the restrictions applied to the native ABI of the system. In particular, setting
        <varname>SystemCallArchitectures=native</varname> is a good choice for disabling non-native ABIs.</para>
 
        <para>System call architectures may also be restricted system-wide via the
        <varname>SystemCallArchitectures=</varname> option in the global configuration. See
        <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
        details.</para>
 
        <xi:include href="version-info.xml" xpointer="v209"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SystemCallLog=</varname></term>
 
        <listitem><para>Takes a space-separated list of system call names. If this setting is used, all
        system calls executed by the unit processes for the listed ones will be logged. If the first
        character of the list is <literal>~</literal>, the effect is inverted: all system calls except the
        listed system calls will be logged. This feature makes use of the Secure Computing Mode 2 interfaces
        of the kernel ('seccomp filtering') and is useful for auditing or setting up a minimal sandboxing
        environment. This option may be specified more than once, in which case the filter masks are merged.
        If the empty string is assigned, the filter is reset, all prior assignments will have no effect.
        This does not affect commands prefixed with <literal>+</literal>.</para>
 
        <xi:include href="version-info.xml" xpointer="v247"/></listitem>
      </varlistentry>
 
    </variablelist>
  </refsect1>
 
  <refsect1>
    <title>Environment</title>
 
    <variablelist class='unit-directives'>
 
      <varlistentry>
        <term><varname>Environment=</varname></term>
 
        <listitem><para>Sets environment variables for executed processes. Each line is unquoted using the
        rules described in "Quoting" section in
        <citerefentry><refentrytitle>systemd.syntax</refentrytitle><manvolnum>7</manvolnum></citerefentry>
        and becomes a list of variable assignments. If you need to assign a value containing spaces or the
        equals sign to a variable, put quotes around the whole assignment. Variable expansion is not
        performed inside the strings and the <literal>$</literal> character has no special meaning. Specifier
        expansion is performed, see the "Specifiers" section in
        <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
        </para>
 
        <para>This option may be specified more than once, in which case all listed variables will be set. If
        the same variable is listed twice, the later setting will override the earlier setting. If the empty
        string is assigned to this option, the list of environment variables is reset, all prior assignments
        have no effect.</para>
 
        <para>The names of the variables can contain ASCII letters, digits, and the underscore character.
        Variable names cannot be empty or start with a digit. In variable values, most characters are
        allowed, but non-printable characters are currently rejected.</para>
 
        <para>Example:
        <programlisting>Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"</programlisting>
        gives three variables <literal>VAR1</literal>,
        <literal>VAR2</literal>, <literal>VAR3</literal>
        with the values <literal>word1 word2</literal>,
        <literal>word3</literal>, <literal>$word 5 6</literal>.
        </para>
 
        <para>See <citerefentry
        project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
        details about environment variables.</para>
 
        <para>Note that environment variables are not suitable for passing secrets (such as passwords, key
        material, …)  to service processes. Environment variables set for a unit are exposed to unprivileged
        clients via D-Bus IPC, and generally not understood as being data that requires protection. Moreover,
        environment variables are propagated down the process tree, including across security boundaries
        (such as setuid/setgid executables), and hence might leak to processes that should not have access to
        the secret data. Use <varname>LoadCredential=</varname>, <varname>LoadCredentialEncrypted=</varname>
        or <varname>SetCredentialEncrypted=</varname> (see below) to pass data to unit processes
        securely.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>EnvironmentFile=</varname></term>
 
        <listitem><para>Similar to <varname>Environment=</varname>, but reads the environment variables from
        a text file. The text file should contain newline-separated variable assignments. Empty lines, lines
        without an <literal>=</literal> separator, or lines starting with <literal>;</literal> or
        <literal>#</literal> will be ignored, which may be used for commenting. The file must be encoded with
        UTF-8. Valid characters are
        <ulink url="https://www.unicode.org/glossary/#unicode_scalar_value">unicode scalar values</ulink>
        other than
        <ulink url="https://www.unicode.org/glossary/#noncharacter">unicode noncharacters</ulink>,
        <constant>U+0000</constant> <constant>NUL</constant>, and <constant>U+FEFF</constant>
        <ulink url="https://www.unicode.org/glossary/#byte_order_mark">unicode byte order mark</ulink>.
        Control codes other than <constant>NUL</constant> are allowed.</para>
 
        <para>In the file, an unquoted value after the <literal>=</literal> is parsed with the same backslash-escape
        rules as <ulink
        url="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_01">POSIX shell unquoted
        text</ulink>, but unlike in a shell, interior whitespace is preserved and quotes after the
        first non-whitespace character are preserved. Leading and trailing whitespace (space, tab, carriage return) is
        discarded, but interior whitespace within the line is preserved verbatim. A line ending with a backslash will be
        continued to the following one, with the newline itself discarded. A backslash
        <literal>\</literal> followed by any character other than newline will preserve the following character, so that
        <literal>\\</literal> will become the value <literal>\</literal>.</para>
 
        <para>In the file, a <literal>'</literal>-quoted value after the <literal>=</literal> can span
        multiple lines and contain any character verbatim other than single quote, like <ulink
        url="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_02">POSIX
        shell single-quoted text</ulink>. No backslash-escape sequences are recognized. Leading and trailing
        whitespace outside of the single quotes is discarded.</para>
 
        <para>In the file, a <literal>"</literal>-quoted value after the <literal>=</literal> can span
        multiple lines, and the same escape sequences are recognized as in <ulink
        url="https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_02_03">POSIX
        shell double-quoted text</ulink>. Backslash (<literal>\</literal>) followed by any of
        <literal>"\`$</literal> will preserve that character. A backslash followed by newline is a line
        continuation, and the newline itself is discarded. A backslash followed by any other character is
        ignored; both the backslash and the following character are preserved verbatim. Leading and trailing
        whitespace outside of the double quotes is discarded.</para>
 
        <para>The argument passed should be an absolute filename or wildcard expression. If the file does not
        exist, cannot be read, or contains invalid content, the service will fail to start. To make the file
        optional, prefix the path with <literal>-</literal>, which causes all errors related to the file to be
        silently ignored. This option may be specified more than once in which case all specified files are read.
        If the empty string is assigned to this option, the list of files to read is reset, all prior assignments
        have no effect.</para>
 
        <para>Note that shell variables such as <literal>$HOME</literal> are not expanded in this path.
        Use <literal>%</literal>-specifiers instead; for example, <literal>%h</literal> expands to the
        user's home directory.</para>
 
        <para>The files listed with this directive will be read shortly before the process is executed (more
        specifically, after all processes from a previous unit state terminated. This means you can generate these
        files in one unit state, and read it with this option in the next. The files are read from the file
        system of the service manager, before any file system changes like bind mounts take place).</para>
 
        <para>Settings from these files override settings made with <varname>Environment=</varname>. If the same
        variable is set twice from these files, the files will be read in the order they are specified and the later
        setting will override the earlier setting.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>PassEnvironment=</varname></term>
 
        <listitem><para>Pass environment variables set for the system service manager to executed processes. Takes a
        space-separated list of variable names. This option may be specified more than once, in which case all listed
        variables will be passed. If the empty string is assigned to this option, the list of environment variables to
        pass is reset, all prior assignments have no effect. Variables specified that are not set for the system
        manager will not be passed and will be silently ignored. Note that this option is only relevant for the system
        service manager, as system services by default do not automatically inherit any environment variables set for
        the service manager itself. However, in case of the user service manager all environment variables are passed
        to the executed processes anyway, hence this option is without effect for the user service manager.</para>
 
        <para>Variables set for invoked processes due to this setting are subject to being overridden by those
        configured with <varname>Environment=</varname> or <varname>EnvironmentFile=</varname>.</para>
 
        <para>Example:
        <programlisting>PassEnvironment=VAR1 VAR2 VAR3</programlisting>
        passes three variables <literal>VAR1</literal>,
        <literal>VAR2</literal>, <literal>VAR3</literal>
        with the values set for those variables in PID1.</para>
 
        <para>
        See <citerefentry
        project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for details
        about environment variables.</para>
 
        <xi:include href="version-info.xml" xpointer="v228"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>UnsetEnvironment=</varname></term>
 
        <listitem><para>Explicitly unset environment variable assignments that would normally be passed from the
        service manager to invoked processes of this unit. Takes a space-separated list of variable names or variable
        assignments. This option may be specified more than once, in which case all listed variables/assignments will
        be unset. If the empty string is assigned to this option, the list of environment variables/assignments to
        unset is reset. If a variable assignment is specified (that is: a variable name, followed by
        <literal>=</literal>, followed by its value), then any environment variable matching this precise assignment is
        removed. If a variable name is specified (that is a variable name without any following <literal>=</literal> or
        value), then any assignment matching the variable name, regardless of its value is removed. Note that the
        effect of <varname>UnsetEnvironment=</varname> is applied as final step when the environment list passed to
        executed processes is compiled. That means it may undo assignments from any configuration source, including
        assignments made through <varname>Environment=</varname> or <varname>EnvironmentFile=</varname>, inherited from
        the system manager's global set of environment variables, inherited via <varname>PassEnvironment=</varname>,
        set by the service manager itself (such as <varname>$NOTIFY_SOCKET</varname> and such), or set by a PAM module
        (in case <varname>PAMName=</varname> is used). Note that variable expansion in the command lines of
        <varname>ExecStart=</varname> and friends is not affected by this option, as it happens before the
        unsetting is applied.</para>
 
        <para>See "Environment Variables in Spawned Processes" below for a description of how those
        settings combine to form the inherited environment. See <citerefentry
        project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for general
        information about environment variables.</para>
 
        <xi:include href="version-info.xml" xpointer="v235"/></listitem>
      </varlistentry>
 
    </variablelist>
  </refsect1>
 
  <refsect1>
    <title>Logging and Standard Input/Output</title>
 
    <variablelist class='unit-directives'>
      <varlistentry>
 
        <term><varname>StandardInput=</varname></term>
 
        <listitem><para>Controls where file descriptor 0 (STDIN) of the executed processes is connected to. Takes one
        of <option>null</option>, <option>tty</option>, <option>tty-force</option>, <option>tty-fail</option>,
        <option>data</option>, <option>file:<replaceable>path</replaceable></option>, <option>socket</option> or
        <option>fd:<replaceable>name</replaceable></option>.</para>
 
        <para>If <option>null</option> is selected, standard input will be connected to <filename>/dev/null</filename>,
        i.e. all read attempts by the process will result in immediate EOF.</para>
 
        <para>If <option>tty</option> is selected, standard input is connected to a TTY (as configured by
        <varname>TTYPath=</varname>, see below) and the executed process becomes the controlling process of the
        terminal. If the terminal is already being controlled by another process, the executed process waits until the
        current controlling process releases the terminal.</para>
 
        <para><option>tty-force</option> is similar to <option>tty</option>, but the executed process is forcefully and
        immediately made the controlling process of the terminal, potentially removing previous controlling processes
        from the terminal.</para>
 
        <para><option>tty-fail</option> is similar to <option>tty</option>, but if the terminal already has a
        controlling process start-up of the executed process fails.</para>
 
        <para>The <option>data</option> option may be used to configure arbitrary textual or binary data to pass via
        standard input to the executed process. The data to pass is configured via
        <varname>StandardInputText=</varname>/<varname>StandardInputData=</varname> (see below). Note that the actual
        file descriptor type passed (memory file, regular file, UNIX pipe, …) might depend on the kernel and available
        privileges. In any case, the file descriptor is read-only, and when read returns the specified data followed by
        EOF.</para>
 
        <para>The <option>file:<replaceable>path</replaceable></option> option may be used to connect a specific file
        system object to standard input. An absolute path following the <literal>:</literal> character is expected,
        which may refer to a regular file, a FIFO or special file. If an <constant>AF_UNIX</constant> socket in the
        file system is specified, a stream socket is connected to it. The latter is useful for connecting standard
        input of processes to arbitrary system services. Note that the file system object is opened by the
        service manager before the executable is invoked; see the note on the security context this
        happens in for <varname>StandardOutput=</varname> below.</para>
 
        <para>The <option>socket</option> option is valid in socket-activated services only, and requires the relevant
        socket unit file (see
        <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry> for details)
        to have <varname>Accept=yes</varname> set, or to specify a single socket only. If this option is set, standard
        input will be connected to the socket the service was activated from, which is primarily useful for
        compatibility with daemons designed for use with the traditional <citerefentry
        project='freebsd'><refentrytitle>inetd</refentrytitle><manvolnum>8</manvolnum></citerefentry> socket activation
        daemon (<varname>$LISTEN_FDS</varname> (and related) environment variables are not passed when
        <option>socket</option> value is configured).</para>
 
        <para>The <option>fd:<replaceable>name</replaceable></option> option connects standard input to a specific,
        named file descriptor provided by a socket unit. The name may be specified as part of this option, following a
        <literal>:</literal> character (e.g. <literal>fd:foobar</literal>). If no name is specified, the name
        <literal>stdin</literal> is implied (i.e. <literal>fd</literal> is equivalent to <literal>fd:stdin</literal>).
        At least one socket unit defining the specified name must be provided via the <varname>Sockets=</varname>
        option, and the file descriptor name may differ from the name of its containing socket unit. If multiple
        matches are found, the first one will be used. See <varname>FileDescriptorName=</varname> in
        <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry> for more
        details about named file descriptors and their ordering.</para>
 
        <para>This setting defaults to <option>null</option>, unless
        <varname>StandardInputText=</varname>/<varname>StandardInputData=</varname> are set, in which case it
        defaults to <option>data</option>.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>StandardOutput=</varname></term>
 
        <listitem><para>Controls where file descriptor 1 (stdout) of the executed processes is connected
        to. Takes one of <option>inherit</option>, <option>null</option>, <option>tty</option>,
        <option>journal</option>, <option>kmsg</option>, <option>journal+console</option>,
        <option>kmsg+console</option>, <option>file:<replaceable>path</replaceable></option>,
        <option>append:<replaceable>path</replaceable></option>, <option>truncate:<replaceable>path</replaceable></option>,
        <option>socket</option> or <option>fd:<replaceable>name</replaceable></option>.</para>
 
        <para><option>inherit</option> duplicates the file descriptor of standard input for standard output.</para>
 
        <para><option>null</option> connects standard output to <filename>/dev/null</filename>, i.e. everything written
        to it will be lost.</para>
 
        <para><option>tty</option> connects standard output to a tty (as configured via <varname>TTYPath=</varname>,
        see below). If the TTY is used for output only, the executed process will not become the controlling process of
        the terminal, and will not fail or wait for other processes to release the terminal. Note: if a unit
        tries to print multiple lines to a TTY during bootup or shutdown, then there's a chance that those
        lines will be broken up by status messages. <function>SetShowStatus()</function> can be used to
        prevent this problem. See
        <citerefentry project="man-pages"><refentrytitle>org.freedesktop.systemd1</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        for details.</para>
 
        <para><option>journal</option> connects standard output with the journal, which is accessible via
        <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>. Note
        that everything that is written to kmsg (see below) is implicitly stored in the journal as well, the
        specific option listed below is hence a superset of this one. (Also note that any external,
        additional syslog daemons receive their log data from the journal, too, hence this is the option to
        use when logging shall be processed with such a daemon.)</para>
 
        <para><option>kmsg</option> connects standard output with the kernel log buffer which is accessible via
        <citerefentry project='man-pages'><refentrytitle>dmesg</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
        in addition to the journal. The journal daemon might be configured to send all logs to kmsg anyway, in which
        case this option is no different from <option>journal</option>.</para>
 
        <para><option>journal+console</option> and <option>kmsg+console</option> work in a similar way as the
        two options above but copy the output to the system console as well.</para>
 
        <para>The <option>file:<replaceable>path</replaceable></option> option may be used to connect a specific file
        system object to standard output. The semantics are similar to the same option of
        <varname>StandardInput=</varname>, see above. If <replaceable>path</replaceable> refers to a regular file
        on the filesystem, it is opened (created if it does not exist yet using privileges of the user executing the
        systemd process) for writing at the beginning of the file, but without truncating it.
        If standard input and output are directed to the same file path, it is opened only once — for reading as well
        as writing — and duplicated. This is particularly useful when the specified path refers to an
        <constant>AF_UNIX</constant> socket in the file system, as in that case only a
        single stream connection is created for both input and output.</para>
 
        <para><option>append:<replaceable>path</replaceable></option> is similar to
        <option>file:<replaceable>path</replaceable></option> above, but it opens the file in append mode.
        </para>
 
        <para><option>truncate:<replaceable>path</replaceable></option> is similar to
        <option>file:<replaceable>path</replaceable></option> above, but it truncates the file when opening
        it. For units with multiple command lines, e.g. <varname>Type=oneshot</varname> services with
        multiple <varname>ExecStart=</varname>, or services with <varname>ExecCondition=</varname>,
        <varname>ExecStartPre=</varname> or <varname>ExecStartPost=</varname>, the output file is reopened
        and therefore re-truncated for each command line. If the output file is truncated while another
        process still has the file open, e.g. by an <varname>ExecReload=</varname> running concurrently with
        an <varname>ExecStart=</varname>, and the other process continues writing to the file without
        adjusting its offset, then the space between the file pointers of the two processes may be filled
        with <constant>NUL</constant> bytes, producing a sparse file. Thus,
        <option>truncate:<replaceable>path</replaceable></option> is typically only useful for units where
        only one process runs at a time, such as services with a single <varname>ExecStart=</varname> and no
        <varname>ExecStartPost=</varname>, <varname>ExecReload=</varname>, <varname>ExecStop=</varname> or
        similar.</para>
 
        <para>Note that for <option>file:<replaceable>path</replaceable></option>,
        <option>append:<replaceable>path</replaceable></option> and
        <option>truncate:<replaceable>path</replaceable></option> of <varname>StandardOutput=</varname>,
        <varname>StandardError=</varname> or <varname>StandardInput=</varname>, the target path is opened
        by the service manager before the executable is invoked — and hence before
        <varname>SELinuxContext=</varname> or any policy-defined transition takes effect. The resulting
        descriptor is then inherited across that transition into the unit's own domain.</para>
 
        <para><option>socket</option> connects standard output to a socket acquired via socket activation. The
        semantics are similar to the same option of <varname>StandardInput=</varname>, see above.</para>
 
        <para>The <option>fd:<replaceable>name</replaceable></option> option connects standard output to a
        specific, named file descriptor provided by a socket unit. A name may be specified as part of this
        option, following a <literal>:</literal> character
        (e.g. <literal>fd:<replaceable>foobar</replaceable></literal>). If no name is specified, the name
        <literal>stdout</literal> is implied (i.e. <literal>fd</literal> is equivalent to
        <literal>fd:stdout</literal>). At least one socket unit defining the specified name must be provided
        via the <varname>Sockets=</varname> option, and the file descriptor name may differ from the name of
        its containing socket unit. If multiple matches are found, the first one will be used. See
        <varname>FileDescriptorName=</varname> in
        <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        for more details about named descriptors and their ordering.</para>
 
        <para>If the standard output (or error output, see below) of a unit is connected to the journal or
        the kernel log buffer, the unit will implicitly gain a dependency of type <varname>After=</varname>
        on <filename>systemd-journald.socket</filename> (also see the "Implicit Dependencies" section
        above). Also note that, in this case, stdout (or stderr, see below) will be an
        <constant>AF_UNIX</constant> stream socket, and not a pipe or FIFO that can be reopened. This means
        when executing shell scripts the construct <command>echo "hello" &gt; /dev/stderr</command> for
        writing text to stderr will not work. To mitigate this use the construct <command>echo "hello"
        >&amp;2</command> instead, which is mostly equivalent and avoids this pitfall.</para>
 
        <para>If <varname>StandardInput=</varname> is set to one of <option>tty</option>, <option>tty-force</option>,
        <option>tty-fail</option>, <option>socket</option>, or <option>fd:<replaceable>name</replaceable></option>, this
        setting defaults to <option>inherit</option>.</para>
 
        <para>In other cases, this setting defaults to the value set with <varname>DefaultStandardOutput=</varname> in
        <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, which
        defaults to <option>journal</option>. Note that setting this parameter might result in additional dependencies
        to be added to the unit (see above).</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>StandardError=</varname></term>
 
        <listitem><para>Controls where file descriptor 2 (stderr) of the executed processes is connected to. The
        available options are identical to those of <varname>StandardOutput=</varname>, with some exceptions: if set to
        <option>inherit</option> the file descriptor used for standard output is duplicated for standard error, while
        <option>fd:<replaceable>name</replaceable></option> will use a default file descriptor name of
        <literal>stderr</literal>.</para>
 
        <para>This setting defaults to the value set with <varname>DefaultStandardError=</varname> in
        <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, which
        defaults to <option>inherit</option>. Note that setting this parameter might result in additional dependencies
        to be added to the unit (see above).</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>StandardInputText=</varname></term>
        <term><varname>StandardInputData=</varname></term>
 
        <listitem><para>Configures arbitrary textual or binary data to pass via file descriptor 0 (STDIN) to
        the executed processes. These settings have no effect unless <varname>StandardInput=</varname> is set
        to <option>data</option> (which is the default if <varname>StandardInput=</varname> is not set
        otherwise, but <varname>StandardInputText=</varname>/<varname>StandardInputData=</varname> is). Use
        this option to embed process input data directly in the unit file.</para>
 
        <para><varname>StandardInputText=</varname> accepts arbitrary textual data. C-style escapes for special
        characters as well as the usual <literal>%</literal>-specifiers are resolved. Each time this setting is used
        the specified text is appended to the per-unit data buffer, followed by a newline character (thus every use
        appends a new line to the end of the buffer). Note that leading and trailing whitespace of lines configured
        with this option is removed. If an empty line is specified the buffer is cleared (hence, in order to insert an
        empty line, add an additional <literal>\n</literal> to the end or beginning of a line).</para>
 
        <para><varname>StandardInputData=</varname> accepts arbitrary binary data, encoded in <ulink
        url="https://tools.ietf.org/html/rfc2045#section-6.8">Base64</ulink>. No escape sequences or specifiers are
        resolved. Any whitespace in the encoded version is ignored during decoding.</para>
 
        <para>Note that <varname>StandardInputText=</varname> and <varname>StandardInputData=</varname> operate on the
        same data buffer, and may be mixed in order to configure both binary and textual data for the same input
        stream. The textual or binary data is joined strictly in the order the settings appear in the unit
        file. Assigning an empty string to either will reset the data buffer.</para>
 
        <para>Please keep in mind that in order to maintain readability long unit file settings may be split into
        multiple lines, by suffixing each line (except for the last) with a <literal>\</literal> character (see
        <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
        details). This is particularly useful for large data configured with these two options. Example:</para>
 
        <programlisting>…
StandardInput=data
StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZXMgYW5kIHNvIGRv \
                  IEkKQSBmdWxsIGNvbW1pdG1lbnQncyB3aGF0IEnigLJtIHRoaW5raW5nIG9mCllvdSB3b3VsZG4n \
                  dCBnZXQgdGhpcyBmcm9tIGFueSBvdGhlciBndXkKSSBqdXN0IHdhbm5hIHRlbGwgeW91IGhvdyBJ \
                  J20gZmVlbGluZwpHb3R0YSBtYWtlIHlvdSB1bmRlcnN0YW5kCgpOZXZlciBnb25uYSBnaXZlIHlv \
                  dSB1cApOZXZlciBnb25uYSBsZXQgeW91IGRvd24KTmV2ZXIgZ29ubmEgcnVuIGFyb3VuZCBhbmQg \
                  ZGVzZXJ0IHlvdQpOZXZlciBnb25uYSBtYWtlIHlvdSBjcnkKTmV2ZXIgZ29ubmEgc2F5IGdvb2Ri \
                  eWUKTmV2ZXIgZ29ubmEgdGVsbCBhIGxpZSBhbmQgaHVydCB5b3UK
…</programlisting>
 
        <xi:include href="version-info.xml" xpointer="v236"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>LogLevelMax=</varname></term>
 
        <listitem><para>Sets the maximum log level for log messages generated by this unit. Takes a
        <command>syslog</command> log level, one of <option>emerg</option> (lowest log level, only highest
        priority messages), <option>alert</option>, <option>crit</option>, <option>err</option>,
        <option>warning</option>, <option>notice</option>, <option>info</option>, <option>debug</option>
        (highest log level, also lowest priority messages). See <citerefentry
        project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry> for
        details. By default, the maximum log level is not overridden.</para>
 
        <para>This option can be used to configure the logging system to drop log messages of a specific
        service above the specified level. For example, set
        <varname>LogLevelMax=</varname><option>info</option> in order to turn off debug logging of a
        particularly chatty unit. Alternatively, this option can be used to enable extra logging about a
        specific unit by the system or user manager processes without changing the global log level for the
        system or user manager processes by setting <varname>LogLevelMax=</varname><option>debug</option>.
        </para>
 
        <para>Note that the configured level is applied to any log messages written by any of the processes
        belonging to this unit, as well as any log messages written by the system or user manager processes
        in reference to this unit, sent via any supported logging protocol. The override is applied early in
        the logging pipeline, before any kind of further processing is done. Moreover, messages which pass
        through this filter successfully might still be dropped by filters applied at a later stage in the
        logging subsystem. For example, <varname>MaxLevelStore=</varname> configured in
        <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        might prohibit messages of higher log levels to be stored on disk, even though the per-unit
        <varname>LogLevelMax=</varname> permitted it to be processed.</para>
 
        <xi:include href="version-info.xml" xpointer="v236"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>LogExtraFields=</varname></term>
 
        <listitem><para>Configures additional log metadata fields to include in all log records generated by
        processes associated with this unit, including systemd. This setting takes one or more journal field
        assignments in the format <literal>FIELD=VALUE</literal> separated by whitespace. See
        <citerefentry><refentrytitle>systemd.journal-fields</refentrytitle><manvolnum>7</manvolnum></citerefentry>
        for details on the journal field concept. Even though the underlying journal implementation permits
        binary field values, this setting accepts only valid UTF-8 values. To include space characters in a
        journal field value, enclose the assignment in double quotes ("). <!-- " fake closing quote for emacs-->
        The usual specifiers are expanded in all assignments (see below). Note that this setting is not only
        useful for attaching additional metadata to log records of a unit, but given that all fields and
        values are indexed may also be used to implement cross-unit log record matching. Assign an empty
        string to reset the list.</para>
 
        <para>Note that this functionality is currently only available in system services, not in per-user
        services.</para>
 
        <xi:include href="version-info.xml" xpointer="v236"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>LogRateLimitIntervalSec=</varname></term>
        <term><varname>LogRateLimitBurst=</varname></term>
 
        <listitem><para>Configures the rate limiting that is applied to log messages generated by this unit.
        If, in the time interval defined by <varname>LogRateLimitIntervalSec=</varname>, more messages than
        specified in <varname>LogRateLimitBurst=</varname> are logged by a service, all further messages
        within the interval are dropped until the interval is over. A message about the number of dropped
        messages is generated. The time specification for <varname>LogRateLimitIntervalSec=</varname> may be
        specified in the following units: "s", "min", "h", "ms", "us". See
        <citerefentry><refentrytitle>systemd.time</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
        details. The default settings are set by <varname>RateLimitIntervalSec=</varname> and
        <varname>RateLimitBurst=</varname> configured in
        <citerefentry><refentrytitle>journald.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
        Note that this only applies to log messages that are processed by the logging subsystem, i.e. by
        <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
        This means that if you connect a service's stderr directly to a file via
        <varname>StandardOutput=file:…</varname> or a similar setting, the rate limiting will not be applied
        to messages written that way (but it will be enforced for messages generated via
        <citerefentry project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>
        and similar functions).</para>
 
        <xi:include href="version-info.xml" xpointer="v240"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>LogFilterPatterns=</varname></term>
 
        <listitem><para>Define an extended regular expression to filter log messages based on the
        <varname>MESSAGE=</varname> field of the structured message. If the first character of the pattern is
        <literal>~</literal>, log entries matching the pattern should be discarded. This option takes a single
        pattern as an argument but can be used multiple times to create a list of allowed and denied patterns.
        If the empty string is assigned, the filter is reset, and all prior assignments will have no effect.</para>
 
        <para>Because the <literal>~</literal> character is used to define denied patterns, it must be replaced
        with <literal>\x7e</literal> to allow a message starting with <literal>~</literal>. For example,
        <literal>~foobar</literal> would add a pattern matching <literal>foobar</literal> to the deny list, while
        <literal>\x7efoobar</literal> would add a pattern matching <literal>~foobar</literal> to the allow list.</para>
 
        <para>Log messages are tested against denied patterns (if any), then against allowed patterns
        (if any). If a log message matches any of the denied patterns, it is discarded immediately without considering
        allowed patterns. Remaining log messages are tested against allowed patterns. Messages matching
        against none of the allowed pattern are discarded. If no allowed patterns are defined, then all
        messages are processed directly after going through denied filters.</para>
 
        <para>Filtering is based on the unit for which <varname>LogFilterPatterns=</varname> is defined, meaning log
        messages coming from
        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> about the
        unit are not taken into account. Filtered log messages will not be forwarded to traditional syslog daemons,
        the kernel log buffer (kmsg), the systemd console, or sent as wall messages to all logged-in
        users.</para>
 
        <para>Note that this functionality is currently only available in system services, not in per-user
        services.</para>
 
        <xi:include href="version-info.xml" xpointer="v253"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>LogNamespace=</varname></term>
 
        <listitem><para>Run the unit's processes in the specified journal namespace. Expects a short
        user-defined string identifying the namespace. If not used the processes of the service are run in
        the default journal namespace, i.e. their log stream is collected and processed by
        <filename>systemd-journald.service</filename>. If this option is used any log data generated by
        processes of this unit (regardless of whether via the <function>syslog()</function>, journal native logging
        or stdout/stderr logging) is collected and processed by an instance of the
        <filename>systemd-journald@.service</filename> template unit, which manages the specified
        namespace. The log data is stored in a data store independent from the default log namespace's data
        store. See
        <citerefentry><refentrytitle>systemd-journald.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
        for details about journal namespaces.</para>
 
        <para>Internally, journal namespaces are implemented through Linux mount namespacing and
        over-mounting the directory that contains the relevant <constant>AF_UNIX</constant> sockets used for
        logging in the unit's mount namespace. Since mount namespaces are used this setting disconnects
        propagation of mounts from the unit's processes to the host, similarly to how
        <varname>ReadOnlyPaths=</varname> and similar settings describe above work. Journal namespaces may hence
        not be used for services that need to establish mount points on the host.</para>
 
        <para>When this option is used the unit will automatically gain ordering and requirement dependencies
        on the two socket units associated with the <filename>systemd-journald@.service</filename> instance
        so that they are automatically established prior to the unit starting up. Note that when this option
        is used log output of this service does not appear in the regular
        <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>
        output, unless the <option>--namespace=</option> option is used.</para>
 
        <xi:include href="system-only.xml" xpointer="singular"/>
 
        <xi:include href="version-info.xml" xpointer="v245"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SyslogIdentifier=</varname></term>
 
        <listitem><para>Sets the process name ("<command>syslog</command> tag") to prefix log lines sent to
        the logging system or the kernel log buffer with. If not set, defaults to the process name of the
        executed process. This option is only useful when <varname>StandardOutput=</varname> or
        <varname>StandardError=</varname> are set to <option>journal</option> or <option>kmsg</option> (or to
        the same settings in combination with <option>+console</option>) and only applies to log messages
        written to stdout or stderr.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SyslogFacility=</varname></term>
 
        <listitem><para>Sets the <command>syslog</command> facility identifier to use when logging. One of
        <option>kern</option>, <option>user</option>, <option>mail</option>, <option>daemon</option>,
        <option>auth</option>, <option>syslog</option>, <option>lpr</option>, <option>news</option>,
        <option>uucp</option>, <option>cron</option>, <option>authpriv</option>, <option>ftp</option>,
        <option>local0</option>, <option>local1</option>, <option>local2</option>, <option>local3</option>,
        <option>local4</option>, <option>local5</option>, <option>local6</option> or
        <option>local7</option>. See <citerefentry
        project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry> for
        details. This option is only useful when <varname>StandardOutput=</varname> or
        <varname>StandardError=</varname> are set to <option>journal</option> or <option>kmsg</option> (or to
        the same settings in combination with <option>+console</option>), and only applies to log messages
        written to stdout or stderr. Defaults to <option>daemon</option>.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SyslogLevel=</varname></term>
 
        <listitem><para>The default <command>syslog</command> log level to use when logging to the logging system or
        the kernel log buffer. One of <option>emerg</option>, <option>alert</option>, <option>crit</option>,
        <option>err</option>, <option>warning</option>, <option>notice</option>, <option>info</option>,
        <option>debug</option>. See <citerefentry
        project='man-pages'><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry> for
        details. This option is only useful when <varname>StandardOutput=</varname> or
        <varname>StandardError=</varname> are set to <option>journal</option> or
        <option>kmsg</option> (or to the same settings in combination with <option>+console</option>), and only applies
        to log messages written to stdout or stderr. Note that individual lines output by executed processes may be
        prefixed with a different log level which can be used to override the default log level specified here. The
        interpretation of these prefixes may be disabled with <varname>SyslogLevelPrefix=</varname>, see below. For
        details, see <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
        Defaults to <option>info</option>.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>SyslogLevelPrefix=</varname></term>
 
        <listitem><para>Takes a boolean argument. If true and <varname>StandardOutput=</varname> or
        <varname>StandardError=</varname> are set to <option>journal</option> or <option>kmsg</option> (or to
        the same settings in combination with <option>+console</option>), log lines written by the executed
        process that are prefixed with a log level will be processed with this log level set but the prefix
        removed. If set to false, the interpretation of these prefixes is disabled and the logged lines are
        passed on as-is. This only applies to log messages written to stdout or stderr. For details about
        this prefixing see
        <citerefentry><refentrytitle>sd-daemon</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
        Defaults to true.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TTYPath=</varname></term>
 
        <listitem><para>Sets the terminal device node to use if standard input, output, or error are connected to a TTY
        (see above). Defaults to <filename>/dev/console</filename>.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TTYReset=</varname></term>
 
        <listitem><para>Reset the terminal device specified with <varname>TTYPath=</varname> before and after
        execution. This does not erase the screen (see <varname>TTYVTDisallocate=</varname> below for
        that). Defaults to <literal>no</literal>.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TTYVHangup=</varname></term>
 
        <listitem><para>Disconnect all clients which have opened the terminal device specified with
        <varname>TTYPath=</varname> before and after execution. Defaults to <literal>no</literal>.</para></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TTYColumns=</varname></term>
        <term><varname>TTYRows=</varname></term>
 
        <listitem><para>Configure the size of the TTY specified with <varname>TTYPath=</varname>. If unset or
        set to the empty string, it is attempted to retrieve the dimensions of the terminal screen via ANSI
        sequences, and if that fails the kernel defaults (typically 80x24) are used.</para>
 
        <xi:include href="version-info.xml" xpointer="v250"/></listitem>
      </varlistentry>
 
      <varlistentry>
        <term><varname>TTYVTDisallocate=</varname></term>
 
        <listitem><para>If the terminal device specified with <varname>TTYPath=</varname> is a virtual
        console terminal, try to deallocate the TTY before and after execution. This ensures that the screen
        and scrollback buffer is cleared. If the terminal device is of any other type of TTY an attempt is
        made to clear the screen via ANSI sequences. Defaults to <literal>no</literal>.</para></listitem>
      </varlistentry>
    </variablelist>
  </refsect1>
 
  <refsect1>
    <title>Credentials</title>
 
    <variablelist class='unit-directives'>
 
      <varlistentry>
        <term><varname>LoadCredential=</varname><replaceable>ID</replaceable><optional>:<replaceable>PATH</replaceable></optional></term>
        <term><varname>LoadCredentialEncrypted=</varname><replaceable>ID</replaceable><optional>:<replaceable>PATH</replaceable></optional></term>
 
        <listitem><para>Pass a credential to the unit. Credentials are limited-size binary or textual objects
        that may be passed to unit processes. They are primarily intended for passing cryptographic keys
        (both public and private) or certificates, user account information or identity information from host
        to services, but can be freely used to pass any kind of limited-size information to a service. The
        data is accessible from the unit's processes via the file system, at a read-only location that (if
        possible and permitted) is backed by non-swappable memory. The data is only accessible to the user
        associated with the unit, via the <varname>User=</varname>/<varname>DynamicUser=</varname> settings
        (as well as the superuser). When available, the location of credentials is exported as the
        <varname>$CREDENTIALS_DIRECTORY</varname> environment variable to the unit's processes.</para>
 
        <para>The <varname>LoadCredential=</varname> setting takes a textual ID to use as name for a
        credential plus a file system path, separated by a colon. The ID must be a short ASCII string
        suitable as filename in the filesystem, and may be chosen freely by the user. If the specified path
        is absolute it is opened as regular file and the credential data is read from it. If the absolute
        path refers to an <constant>AF_UNIX</constant> stream socket in the file system a connection is made
        to it (once at process invocation) and the credential data read from the connection, providing an
        easy IPC integration point for dynamically transferring credentials from other services.</para>
 
        <para>If the specified path is not absolute and itself qualifies as valid credential identifier it is
        attempted to find a credential that the service manager itself received under the specified name —
        which may be used to propagate credentials from an invoking environment (e.g. a container manager
        that invoked the service manager) into a service. If no matching passed credential is found, the
        system service manager will search the directories <filename>/etc/credstore/</filename>,
        <filename>/run/credstore/</filename> and <filename>/usr/lib/credstore/</filename> for files under the
        credential's name — which hence are recommended locations for credential data on disk. If
        <varname>LoadCredentialEncrypted=</varname> is used <filename>/run/credstore.encrypted/</filename>,
        <filename>/etc/credstore.encrypted/</filename>, and
        <filename>/usr/lib/credstore.encrypted/</filename> are searched as well. The per-user service manager
        will search <filename>$XDG_CONFIG_HOME/credstore/</filename>,
        <filename>$XDG_RUNTIME_DIR/credstore/</filename>, <filename>$HOME/.local/lib/credstore/</filename>
        (and the counterparts ending with <filename>…/credstore.encrypted/</filename>) instead. The
        <citerefentry><refentrytitle>systemd-path</refentrytitle><manvolnum>1</manvolnum></citerefentry> tool
        may be used to query the precise credential store search path.</para>
 
        <para>If the file system path is omitted it is chosen identical to the credential name, i.e. this is
        a terse way to declare credentials to inherit from the service manager or credstore directories into
        a service. This option may be used multiple times, each time defining an additional credential to
        pass to the unit.</para>
 
        <para>Note that if the path is not specified or a valid credential identifier is given, i.e.
        in the above two cases, a missing credential is not considered fatal.</para>
 
        <para>If an absolute path referring to a directory is specified, every file in that directory
        (recursively) will be loaded as a separate credential. The ID for each credential will be the
        provided ID suffixed with <literal>_$FILENAME</literal> (e.g., <literal>Key_file1</literal>). When
        loading from a directory, symlinks will be ignored.</para>
 
        <para>The contents of the file/socket may be arbitrary binary or textual data, including newline
        characters and <constant>NUL</constant> bytes.</para>
 
        <para>The <varname>LoadCredentialEncrypted=</varname> setting is identical to
        <varname>LoadCredential=</varname>, except that the credential data is decrypted and authenticated
        before being passed on to the executed processes. Specifically, the referenced path should refer to a
        file or socket with an encrypted credential, as implemented by
        <citerefentry><refentrytitle>systemd-creds</refentrytitle><manvolnum>1</manvolnum></citerefentry>. This
        credential is loaded, decrypted, authenticated and then passed to the application in plaintext form,
        in the same way a regular credential specified via <varname>LoadCredential=</varname> would be. A
        credential configured this way may be symmetrically encrypted/authenticated with a secret key derived
        from the system's TPM2 security chip, or with a secret key stored in
        <filename>/var/lib/systemd/credential.secret</filename>, or with both. Using encrypted and
        authenticated credentials improves security as credentials are not stored in plaintext and only
        authenticated and decrypted into plaintext the moment a service requiring them is started. Moreover,
        credentials may be bound to the local hardware and installations, so that they cannot easily be
        analyzed offline, or be generated externally. See
        <citerefentry><refentrytitle>systemd.resource-control</refentrytitle><manvolnum>5</manvolnum></citerefentry>
        for the details about <varname>DevicePolicy=</varname> or <varname>DeviceAllow=</varname>.</para>
 
        <para>Note that encrypted credentials targeted for services of the per-user service manager must be
        encrypted with <command>systemd-creds encrypt --user</command>, and those for the system service
        manager without the <option>--user</option> switch. Encrypted credentials are always targeted to a
        specific user or the system as a whole, and it is ensured that per-user service managers cannot
        decrypt secrets intended for the system or for other users.</para>
 
        <para>The credential files/IPC sockets must be accessible to the service manager, but do not have to
        be directly accessible to the unit's processes: the credential data is read and copied into separate,
        read-only copies for the unit that are accessible to appropriately privileged processes. This is
        particularly useful in combination with <varname>DynamicUser=</varname> as this way privileged data
        can be made available to processes running under a dynamic UID (i.e. not a previously known one)
        without having to open up access to all users.</para>
 
        <para>In order to reference the path a credential may be read from within a
        <varname>ExecStart=</varname> command line use <literal>${CREDENTIALS_DIRECTORY}/mycred</literal>,
        e.g. <literal>ExecStart=cat ${CREDENTIALS_DIRECTORY}/mycred</literal>. In order to reference the path
        a credential may be read from within a <varname>Environment=</varname> line use
        <literal>%d/mycred</literal>, e.g. <literal>Environment=MYCREDPATH=%d/mycred</literal>. For system
        services the path may also be referenced as
        <literal>/run/credentials/<replaceable>UNITNAME</replaceable></literal> in cases where no
        interpolation is possible, e.g. configuration files of software that does not yet support credentials
        natively. <varname>$CREDENTIALS_DIRECTORY</varname> is considered the primary interface to look for
        credentials, though, since it also works for user services.</para>
 
        <para>Currently, an accumulated credential size limit of 1 MB per unit is enforced.</para>
 
        <para>The service manager itself may receive system credentials that can be propagated to services
        from a hosting container manager or VM hypervisor. See the <ulink
        url="https://systemd.io/CONTAINER_INTERFACE">Container Interface</ulink> documentation for details
        about the former. For the latter, pass <ulink
        url="https://www.dmtf.org/standards/smbios">DMI/SMBIOS</ulink> OEM string table entries (field type
        11) with a prefix of <literal>io.systemd.credential:</literal> or
        <literal>io.systemd.credential.binary:</literal>. In both cases a key/value pair separated by
        <literal>=</literal> is expected. In the latter case, the right-hand side is Base64 decoded when
        parsed (thus permitting binary data to be passed in). Example <ulink
        url="https://www.qemu.org/docs/master/system/index.html">qemu</ulink> switch: <literal>-smbios
        type=11,value=io.systemd.credential:xx=yy</literal>, or <literal>-smbios
        type=11,value=io.systemd.credential.binary:rick=TmV2ZXIgR29ubmEgR2l2ZSBZb3UgVXA=</literal>. Alternatively,
        use the <command>qemu</command> <literal>fw_cfg</literal> node
        <literal>opt/io.systemd.credentials/</literal>. Example <command>qemu</command> switch:
        <literal>-fw_cfg name=opt/io.systemd.credentials/mycred,string=supersecret</literal>. They may also
        be passed from the UEFI firmware environment via
        <citerefentry><refentrytitle>systemd-stub</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
        from the initrd (see
        <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>), or be
        specified on the kernel command line using the <literal>systemd.set_credential=</literal> and
        <literal>systemd.set_credential_binary=</literal> switches (see