diff options
author | Filipe Brandenburger <filbranden@google.com> | 2015-09-06 23:06:53 -0700 |
---|---|---|
committer | Filipe Brandenburger <filbranden@google.com> | 2015-11-11 07:55:23 -0800 |
commit | b4c14404b3e8753c41bac0b1d49369230a15c544 (patch) | |
tree | 88670a957a28cb72ab7eedb70c178b2a2aab7041 /man | |
parent | 3116c225d2e3c0d8e6b3f4d4a9b48443cc7baf2d (diff) | |
download | systemd-b4c14404b3e8753c41bac0b1d49369230a15c544.tar.gz |
execute: Add new PassEnvironment= directive
This directive allows passing environment variables from the system
manager to spawned services. Variables in the system manager can be set
inside a container by passing `--set-env=...` options to systemd-spawn.
Tested with an on-disk test.service unit. Tested using multiple variable
names on a single line, with an empty setting to clear the current list
of variables, with non-existing variables.
Tested using `systemd-run -p PassEnvironment=VARNAME` to confirm it
works with transient units.
Confirmed that `systemctl show` will display the PassEnvironment
settings.
Checked that man pages are generated correctly.
No regressions in `make check`.
Diffstat (limited to 'man')
-rw-r--r-- | man/systemd.exec.xml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index 2b090871ff..5bb97bd98e 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -303,6 +303,33 @@ </varlistentry> <varlistentry> + <term><varname>PassEnvironment=</varname></term> + + <listitem><para>Pass environment variables from the systemd system + manager to executed processes. Takes a space-separated list of variable + names. This option may be specified more than once, in which case all + listed variables will be set. If the empty string is assigned to this + option, the list of environment variables is reset, all prior + assignments have no effect. Variables that are not set in the system + manager will not be passed and will be silently ignored.</para> + + <para>Variables passed from this setting are overridden by those passed + from <varname>Environment=</varname> or + <varname>EnvironmentFile=</varname>.</para> + + <para>Example: + <programlisting>PassEnvironment=VAR1 VAR2 VAR3</programlisting> + passes three variables <literal>VAR1</literal>, + <literal>VAR2</literal>, <literal>VAR3</literal> + with the values set for those variables in PID1.</para> + + <para> + See + <citerefentry project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> + for details about environment variables.</para></listitem> + </varlistentry> + + <varlistentry> <term><varname>StandardInput=</varname></term> <listitem><para>Controls where file descriptor 0 (STDIN) of the executed processes is connected to. Takes one of |