From c5b37953b7835562348d71ad5514faefa4cfb10b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 9 Jan 2014 22:23:32 -0500 Subject: [PATCH 1/1] man: mention which variables will be expanded in ExecStart --- man/systemd.exec.xml | 6 ++++-- 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 17748d406..610c821dc 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -295,9 +295,11 @@ for the assignment. Example: - Environment="VAR1=word1 word2" VAR2=word3 "VAR3=word 5 6" + Environment="VAR1=word1 word2" VAR2=word3 "VAR3=$word 5 6" gives three variables VAR1, - VAR2, VAR3. + VAR2, VAR3 + with the values word1 word2, + word3, $word 5 6. diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 98507f405..d316ab5d2 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 $FOO 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 $$. Note that the first - argument (i.e. the program to execute) - may not be a variable. + of the environment variable split at + whitespace, resulting in zero or more + arguments. To pass a literal dollar + sign, use $$. + 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. + + Variables to be used in this + fashion may be defined through + Environment= and + EnvironmentFile=. + In addition, variables listed in + section "Environment variables in + spawned processes" in + systemd.exec5 + which are considered "static + configuration" may used (this includes + e.g. $USER, but not + $TERM). Optionally, if the absolute file name is prefixed with @@ -429,11 +445,6 @@ ExecStart=/bin/sh -c 'dmesg | tac' - Only select environment variables that - are set for executed commands. See - systemd.exec5. - - Example: ExecStart=/bin/echo one ; /bin/echo "two two" -- 2.30.2