From 4d7ae2557ba681db13087f18f3c1c60c3d8352aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 2 Apr 2023 20:16:01 +0200 Subject: [PATCH] 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. --- man/systemd.service.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 @@ @ - 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