]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: describe quoting and specifiers in Environment=
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 28 Feb 2021 17:37:01 +0000 (18:37 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 1 Mar 2021 12:40:52 +0000 (13:40 +0100)
Fixes #10604.

man/systemd.exec.xml

index bac8f9cdff942a7efe28c278cff6a141a1c8fa8b..30e64224c3e74ac6d0d8ebe257219aa5e684efbd 100644 (file)
@@ -2263,18 +2263,24 @@ SystemCallErrorNumber=EPERM</programlisting>
       <varlistentry>
         <term><varname>Environment=</varname></term>
 
-        <listitem><para>Sets environment variables for executed processes. Takes a space-separated list of
-        variable assignments. This option may be specified more than once, in which case all listed variables
-        will be set. If the same variable is set 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. Variable expansion is not performed inside the strings,
-        however, specifier expansion is possible. The <literal>$</literal> character has no special
-        meaning. If you need to assign a value containing spaces or the equals sign to a variable, use double
-        quotes (") for the assignment.</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>
+        <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>5</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>
@@ -2284,10 +2290,9 @@ SystemCallErrorNumber=EPERM</programlisting>
         <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>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