mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 04:03:36 +08:00
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.
This commit is contained in:
parent
8202c01701
commit
4d7ae2557b
@ -1249,7 +1249,7 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>@</literal></entry>
|
<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>
|
||||||
|
|
||||||
<row>
|
<row>
|
||||||
@ -1364,6 +1364,17 @@ ExecStart=/bin/echo $ONE $TWO $THREE</programlisting>
|
|||||||
|
|
||||||
<para>Example:</para>
|
<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 & \; \
|
<programlisting>ExecStart=echo / >/dev/null & \; \
|
||||||
ls</programlisting>
|
ls</programlisting>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user