diff options
Diffstat (limited to 'man')
-rw-r--r-- | man/systemd-run.xml | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/man/systemd-run.xml b/man/systemd-run.xml index cd9e50d5b8..2ad68d8884 100644 --- a/man/systemd-run.xml +++ b/man/systemd-run.xml @@ -92,6 +92,11 @@ Consider using the <option>exec</option> service type (i.e. <option>--property=Type=exec</option>) to ensure that <command>systemd-run</command> returns successfully only if the specified command line has been successfully started.</para> + + <para>After <command>systemd-run</command> passes the command to the service manager, the manager + performs variable expansion. This means that dollar characters (<literal>$</literal>) which should not be + expanded need to be escaped as <literal>$$</literal>. Expansion can also be disabled using + <varname>--expand-environment=no</varname>.</para> </refsect1> <refsect1> @@ -170,6 +175,24 @@ </varlistentry> <varlistentry> + <term><option>--expand-environment=<replaceable>BOOL</replaceable></option></term> + + <listitem><para>Expand environment variables in command arguments. If enabled (the default), the + service manager that spawns the actual command will expand variables specified as + <literal>${<replaceable>VARIABLE</replaceable>}</literal> in the same way as in commands specied via + <varname>ExecStart=</varname> in units. 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>See + <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry> + for a description of variable expansion. Disabling variable expansion is useful if the specified + command includes or may include a <literal>$</literal> sign.</para> + </listitem> + </varlistentry> + + <varlistentry> <term><option>-r</option></term> <term><option>--remain-after-exit</option></term> @@ -533,7 +556,8 @@ There is a screen on: <programlisting>$ systemd-run --user --wait true $ systemd-run --user --wait -p SuccessExitStatus=11 bash -c 'exit 11' -$ systemd-run --user --wait -p SuccessExitStatus=SIGUSR1 bash -c 'kill -SIGUSR1 $$$$'</programlisting> +$ systemd-run --user --wait -p SuccessExitStatus=SIGUSR1 --expand-environment=no \ + bash -c 'kill -SIGUSR1 $$'</programlisting> <para>Those three invocations will succeed, i.e. terminate with an exit code of 0.</para> </example> |