diff options
-rw-r--r-- | man/systemd.exec.xml | 6 | ||||
-rw-r--r-- | man/systemd.service.xml | 35 |
2 files changed, 27 insertions, 14 deletions
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index 17748d4066..610c821dc0 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -295,9 +295,11 @@ for the assignment.</para> <para>Example: - <programlisting>Environment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"</programlisting> + <programlisting>Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"</programlisting> gives three variables <literal>VAR1</literal>, - <literal>VAR2</literal>, <literal>VAR3</literal>. + <literal>VAR2</literal>, <literal>VAR3</literal> + with the values <literal>word1 word2</literal>, + <literal>word3</literal>, <literal>$word 5 6</literal>. </para> <para> diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 98507f405f..d316ab5d2e 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -392,16 +392,32 @@ replaced by the value of the environment variable including all whitespace it contains, resulting in a - single argument. Use + single argument. Use <literal>$FOO</literal> as a separate word on the command line, in which case it will be replaced by the value - of the environment variable split up - at whitespace, resulting in zero or - more arguments. To pass a literal dollar sign, - use <literal>$$</literal>. Note that the first - argument (i.e. the program to execute) - may not be a variable.</para> + of the environment variable split at + whitespace, resulting in zero or more + arguments. To pass a literal dollar + sign, use <literal>$$</literal>. + Variables whose value is not known at + expansion time are treated as empty + strings. Note that the first argument + (i.e. the program to execute) may not + be a variable.</para> + + <para>Variables to be used in this + fashion may be defined through + <varname>Environment=</varname> and + <varname>EnvironmentFile=</varname>. + In addition, variables listed in + section "Environment variables in + spawned processes" in + <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry> + which are considered "static + configuration" may used (this includes + e.g. <varname>$USER</varname>, but not + <varname>$TERM</varname>).</para> <para>Optionally, if the absolute file name is prefixed with @@ -429,11 +445,6 @@ <programlisting>ExecStart=/bin/sh -c 'dmesg | tac' </programlisting> - <para>Only select environment variables that - are set for executed commands. See - <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>. - </para> - <para>Example:</para> <programlisting>ExecStart=/bin/echo one ; /bin/echo "two two" </programlisting> |