diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-04-02 20:16:01 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2023-04-04 15:18:00 +0200 |
commit | 4d7ae2557ba681db13087f18f3c1c60c3d8352aa (patch) | |
tree | 75eff727392adc5adb3a11f57cfe11232ecc8b85 /man | |
parent | 8202c017010090abf0c0777d10093ffba3c42811 (diff) | |
download | systemd-4d7ae2557ba681db13087f18f3c1c60c3d8352aa.tar.gz |
man/systemd.service: add example for char prefixes
The prefixes can be specified for any part of the command. The docs imply this,
but it's not entirely obvious. Let's add an example.
Diffstat (limited to 'man')
-rw-r--r-- | man/systemd.service.xml | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 036ac66b2d..f64a8e538f 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -1249,7 +1249,7 @@ <tbody> <row> <entry><literal>@</literal></entry> - <entry>If the executable path is prefixed with <literal>@</literal>, the second specified token will be passed as <literal>argv[0]</literal> to the executed process (instead of the actual filename), followed by the further arguments specified.</entry> + <entry>If the executable path is prefixed with <literal>@</literal>, the second specified token will be passed as <constant>argv[0]</constant> to the executed process (instead of the actual filename), followed by the further arguments specified.</entry> </row> <row> @@ -1364,6 +1364,17 @@ ExecStart=/bin/echo $ONE $TWO $THREE</programlisting> <para>Example:</para> + <programlisting>Type=oneshot +ExecStart=:echo $USER ; -false ; +:@true $TEST</programlisting> + + <para>This will execute <command>/usr/bin/echo</command> with the literal argument + <literal>$USER</literal> (<literal>:</literal> suppresses variable expansion), and then + <command>/usr/bin/false</command> (the return value will be ignored because <literal>-</literal> + suppresses checking of the return value), and <command>/usr/bin/true</command> (with elevated privileges, + with <literal>$TEST</literal> as <constant>argv[0]</constant>).</para> + + <para>Example:</para> + <programlisting>ExecStart=echo / >/dev/null & \; \ ls</programlisting> |