From: Zbigniew Jędrzejewski-Szmek Date: Sun, 2 Apr 2023 18:16:01 +0000 (+0200) Subject: man/systemd.service: add example for char prefixes X-Git-Tag: v254-rc1~813^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4d7ae2557ba681db13087f18f3c1c60c3d8352aa;p=thirdparty%2Fsystemd.git 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. --- diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 036ac66b2de..f64a8e538ff 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -1249,7 +1249,7 @@ @ - If the executable path is prefixed with @, the second specified token will be passed as argv[0] to the executed process (instead of the actual filename), followed by the further arguments specified. + If the executable path is prefixed with @, the second specified token will be passed as argv[0] to the executed process (instead of the actual filename), followed by the further arguments specified. @@ -1364,6 +1364,17 @@ ExecStart=/bin/echo $ONE $TWO $THREE Example: + Type=oneshot +ExecStart=:echo $USER ; -false ; +:@true $TEST + + This will execute /usr/bin/echo with the literal argument + $USER (: suppresses variable expansion), and then + /usr/bin/false (the return value will be ignored because - + suppresses checking of the return value), and /usr/bin/true (with elevated privileges, + with $TEST as argv[0]). + + Example: + ExecStart=echo / >/dev/null & \; \ ls