man: mention which variables will be expanded in ExecStart

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-01-09 22:23:32 -05:00
parent a2cc4a6c96
commit c5b37953b7
2 changed files with 27 additions and 14 deletions

View file

@ -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>

View file

@ -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>