summaryrefslogtreecommitdiffstats
path: root/man/systemd-run.xml
diff options
context:
space:
mode:
authorLuca Boccassi <bluca@debian.org>2023-07-19 23:56:02 +0200
committerLuca Boccassi <bluca@debian.org>2023-07-20 18:37:27 +0200
commit8167c56bfa97525a7b12e7c5685576657364e3cf (patch)
tree36010a03f0aa18e4b41a8d2b3687c8abbdddd6a6 /man/systemd-run.xml
parentman: clarify DNSSEC= again (diff)
downloadsystemd-8167c56bfa97525a7b12e7c5685576657364e3cf.tar.xz
systemd-8167c56bfa97525a7b12e7c5685576657364e3cf.zip
run: disable --expand-environment by default for --scope
The intention was to have this option enabled by default everywhere, but unfortunately at least one case was found where it breaks compatibility of a program using systemd-run --scopes and expecting variables not to be expanded: https://sources.debian.org/src/pbuilder/0.231/pbuilder-checkparams/#L400 Example run: systemd-run --quiet --scope --description=pbuilder_build_xfce4-notes-plugin_1.10.0-1.dsc '--slice=system-pbuilder-build-xfce4\x2dnotes\x2dplugin_1.10.0\x2d1-449932.slice' chroot /var/cache/pbuilder/build/449932 dpkg-query -W '--showformat=${Version}' apt Restore backward compatibility and make the option disabled by default when --scope is used, and enabled by default for other types. In case --expand-environment is not specified and a '$' character is detected, print a warning to nudge users toward specifying the parameter as needed. In the future we can then flip the default. Follow-up for 2ed7a221fafb25eea937c4e86fb88ee501dba51e
Diffstat (limited to 'man/systemd-run.xml')
-rw-r--r--man/systemd-run.xml10
1 files changed, 7 insertions, 3 deletions
diff --git a/man/systemd-run.xml b/man/systemd-run.xml
index 73adbfb927..fecedda25c 100644
--- a/man/systemd-run.xml
+++ b/man/systemd-run.xml
@@ -177,15 +177,19 @@
<varlistentry>
<term><option>--expand-environment=<replaceable>BOOL</replaceable></option></term>
- <listitem><para>Expand environment variables in command arguments. If enabled (the default),
- environment variables specified as <literal>${<replaceable>VARIABLE</replaceable>}</literal> will be
- expanded in the same way as in commands specified via <varname>ExecStart=</varname> in units. With
+ <listitem><para>Expand environment variables in command arguments. If enabled, environment variables
+ specified as <literal>${<replaceable>VARIABLE</replaceable>}</literal> will be expanded in the same
+ way as in commands specified via <varname>ExecStart=</varname> in units. With
<varname>--scope</varname>, this expansion is performed by <command>systemd-run</command> itself, and
in other cases by the service manager that spawns the command. Note that this is similar to, but not
the same as variable expansion in
<citerefentry project='man-pages'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>
and other shells.</para>
+ <para>The default is to enable this option in all cases, except for <varname>--scope</varname> where
+ it is disabled by default, for backward compatibility reasons. Note that this will be changed in a
+ future release, where it will be switched to enabled by default as well.</para>
+
<para>See
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for a description of variable expansion. Disabling variable expansion is useful if the specified