From 78e9bb837c258ac0ec7712b3d612cc2f407e731e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:42 +0200 Subject: Merging upstream version 256. Signed-off-by: Daniel Baumann --- man/systemd-run.xml | 93 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 66 insertions(+), 27 deletions(-) (limited to 'man/systemd-run.xml') diff --git a/man/systemd-run.xml b/man/systemd-run.xml index 5be9823..e1986c1 100644 --- a/man/systemd-run.xml +++ b/man/systemd-run.xml @@ -1,6 +1,6 @@ + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"> systemctl list-units like any other unit. It will run in a clean and detached execution environment, with the service manager as its parent process. In this mode, systemd-run will start the service asynchronously in the background and return after the - command has begun execution (unless or are specified, see - below). + command has begun execution (unless , , , + or are specified, see below). If a command is run as transient scope unit, it will be executed by systemd-run itself as parent process and will thus inherit the execution environment of the caller. However, the @@ -176,11 +176,14 @@ Make the new .service or .scope unit part - of the inherited slice. This option can be combined with . - - An inherited slice is located within systemd-run slice. Example: if - systemd-run slice is foo.slice, and the - argument is bar, the unit will be placed under the + of the slice the systemd-run itself has been invoked in. This option may be + combined with , in which case the slice specified via + is placed within the slice the systemd-run command is + invoked in. + + Example: consider systemd-run being invoked in the slice + foo.slice, and the argument is + bar. The unit will then be placed under foo-bar.slice. @@ -322,6 +325,11 @@ to the terminal systemd-run is invoked on, via a pseudo TTY device. This allows running programs that expect interactive user input/output as services, such as interactive command shells. + This option will result in systemd-run synchronously waiting for + the transient service to terminate, similar to specifying . If specified + along with , systemd-run won't exit when manually disconnecting + from the pseudo TTY device. + Note that machinectl1's shell command is usually a better alternative for requesting a new, interactive login @@ -338,21 +346,25 @@ If specified, standard input, output, and error of the transient service are inherited from the systemd-run command itself. This allows systemd-run - to be used within shell pipelines. - Note that this mode is not suitable for interactive command shells and similar, as the - service process will not become a TTY controller when invoked on a terminal. Use instead - in that case. + to be used within shell pipelines. + + Note that this mode is not suitable for interactive command shells and similar, as the + service process will not become a TTY controller when invoked on a terminal. Use + instead in that case. When both and are used in combination the more appropriate option is automatically determined and used. Specifically, when invoked with standard input, output and error connected to a TTY is used, and otherwise . + This option will result in systemd-run synchronously waiting for + the transient service to terminate, similar to specifying . + When this option is used the original file descriptors systemd-run receives are passed to the service processes as-is. If the service runs with different privileges than - systemd-run, this means the service might not be able to re-open the passed file + systemd-run, this means the service might not be able to reopen the passed file descriptors, due to normal file descriptor access restrictions. If the invoked process is a shell script that uses the echo "hello" >/dev/stderr construct for writing messages to stderr, this might - cause problems, as this only works if stderr can be re-opened. To mitigate this use the construct echo + cause problems, as this only works if stderr can be reopened. To mitigate this use the construct echo "hello" >&2 instead, which is mostly equivalent and avoids this pitfall. @@ -485,10 +497,36 @@ + + + + By default, if the specified command fails the invoked unit will be marked failed + (though possibly still unloaded, see , above), and this is reported in the + logs. If this switch is specified this is suppressed and any non-success exit status/code of the + command is treated as success. + + + + + + + + Change the terminal background color to the specified ANSI color as long as the + session lasts. The color specified should be an ANSI X3.64 SGR background color, i.e. strings such as + 40, 41, …, 47, 48;2;…, + 48;5;…. See ANSI + Escape Code (Wikipedia) for details. + + + + + + @@ -666,19 +704,20 @@ $ systemd-run --user --wait -p SuccessExitStatus=SIGUSR1 --expand-environment=no See Also - - systemd1, - systemctl1, - systemd.unit5, - systemd.service5, - systemd.scope5, - systemd.slice5, - systemd.exec5, - systemd.resource-control5, - systemd.timer5, - systemd-mount1, - machinectl1 - + + systemd1 + systemctl1 + systemd.unit5 + systemd.service5 + systemd.scope5 + systemd.slice5 + systemd.exec5 + systemd.resource-control5 + systemd.timer5 + systemd-mount1 + machinectl1 + run01 + -- cgit v1.2.3