diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-28 18:37:01 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-03-01 13:40:52 +0100 |
commit | e531091ba0b0f3c69006cad48a2081f235a5bb1f (patch) | |
tree | 6eddab96a0f966b87fff3ecc99d9abaff753ee16 | |
parent | 4d729e3796e2c48e6840b86a1474d8009d8d940d (diff) | |
download | systemd-e531091ba0b0f3c69006cad48a2081f235a5bb1f.tar.gz |
man: describe quoting and specifiers in Environment=
Fixes #10604.
-rw-r--r-- | man/systemd.exec.xml | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index bac8f9cdff..30e64224c3 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -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 |