ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
65878a
From b993c1cda2625b91562ada55f21da2310e9b436d Mon Sep 17 00:00:00 2001
65878a
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
65878a
Date: Thu, 9 Jan 2014 22:23:32 -0500
65878a
Subject: [PATCH] man: mention which variables will be expanded in ExecStart
65878a
65878a
Conflicts:
65878a
	man/systemd.service.xml
65878a
---
65878a
 man/systemd.exec.xml    |  6 ++++--
65878a
 man/systemd.service.xml | 35 +++++++++++++++++++++++------------
65878a
 2 files changed, 27 insertions(+), 14 deletions(-)
65878a
65878a
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
65878a
index f50161f..612b4d2 100644
65878a
--- a/man/systemd.exec.xml
65878a
+++ b/man/systemd.exec.xml
65878a
@@ -295,9 +295,11 @@
65878a
                                 for the assignment.</para>
65878a
 
65878a
                                 <para>Example:
65878a
-                                <programlisting>Environment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6"</programlisting>
65878a
+                                <programlisting>Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6"</programlisting>
65878a
                                 gives three variables <literal>VAR1</literal>,
65878a
-                                <literal>VAR2</literal>, <literal>VAR3</literal>.
65878a
+                                <literal>VAR2</literal>, <literal>VAR3</literal>
65878a
+                                with the values <literal>word1 word2</literal>,
65878a
+                                <literal>word3</literal>, <literal>$word 5 6</literal>.
65878a
                                 </para>
65878a
 
65878a
                                 <para>
65878a
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
65878a
index af3e0f2..4fb21ba 100644
65878a
--- a/man/systemd.service.xml
65878a
+++ b/man/systemd.service.xml
65878a
@@ -392,16 +392,32 @@
65878a
                                 replaced by the value of the
65878a
                                 environment variable including all
65878a
                                 whitespace it contains, resulting in a
65878a
-                                single argument.  Use
65878a
+                                single argument. Use
65878a
                                 <literal>$FOO</literal> as a separate
65878a
                                 word on the command line, in which
65878a
                                 case it will be replaced by the value
65878a
-                                of the environment variable split up
65878a
-                                at whitespace, resulting in zero or
65878a
-                                more arguments. To pass literal dollar sign
65878a
-                                use <literal>$$</literal>. Note that the first
65878a
-                                argument (i.e. the program to execute)
65878a
-                                may not be a variable.</para>
65878a
+                                of the environment variable split at
65878a
+                                whitespace, resulting in zero or more
65878a
+                                arguments. To pass a literal dollar
65878a
+                                sign, use <literal>$$</literal>.
65878a
+                                Variables whose value is not known at
65878a
+                                expansion time are treated as empty
65878a
+                                strings. Note that the first argument
65878a
+                                (i.e. the program to execute) may not
65878a
+                                be a variable.</para>
65878a
+
65878a
+                                <para>Variables to be used in this
65878a
+                                fashion may be defined through
65878a
+                                <varname>Environment=</varname> and
65878a
+                                <varname>EnvironmentFile=</varname>.
65878a
+                                In addition, variables listed in
65878a
+                                section "Environment variables in
65878a
+                                spawned processes" in
65878a
+                                <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>
65878a
+                                which are considered "static
65878a
+                                configuration" may used (this includes
65878a
+                                e.g. <varname>$USER</varname>, but not
65878a
+                                <varname>$TERM</varname>).</para>
65878a
 
65878a
                                 <para>Optionally, if the absolute file
65878a
                                 name is prefixed with
65878a
@@ -429,11 +445,6 @@
65878a
                                 <programlisting>ExecStart=/bin/sh -c 'dmesg | tac'
65878a
                                 </programlisting>
65878a
 
65878a
-                                <para>Only select environment variables that
65878a
-                                are set for executed commands. See
65878a
-                                <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
65878a
-                                </para>
65878a
-
65878a
                                 <para>Example:</para>
65878a
                                 <programlisting>ExecStart=/bin/echo one ; /bin/echo "two two"
65878a
                                 </programlisting>