diff options
author | Mike Yuan <me@yhndnzj.com> | 2024-05-21 15:39:02 +0200 |
---|---|---|
committer | Mike Yuan <me@yhndnzj.com> | 2024-05-21 15:40:01 +0200 |
commit | d73a47d259be795958c8aa5b65b002f3d7338b6e (patch) | |
tree | c40232a39527d7579a245f9199bf0719cd37e5bc | |
parent | run: when disconnected from PTY forwarder, exit event loop if not --wait (diff) | |
download | systemd-d73a47d259be795958c8aa5b65b002f3d7338b6e.tar.xz systemd-d73a47d259be795958c8aa5b65b002f3d7338b6e.zip |
man/systemd-run: beef up info regarding interaction between --pty, --pipe, and --wait
-rw-r--r-- | man/systemd-run.xml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/man/systemd-run.xml b/man/systemd-run.xml index 60af576099..e1986c1f52 100644 --- a/man/systemd-run.xml +++ b/man/systemd-run.xml @@ -64,8 +64,8 @@ other service, and thus shows up in the output of <command>systemctl list-units</command> 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, <command>systemd-run</command> will start the service asynchronously in the background and return after the - command has begun execution (unless <option>--no-block</option> or <option>--wait</option> are specified, see - below).</para> + command has begun execution (unless <option>--no-block</option>, <option>--wait</option>, <option>--pipe</option>, + or <option>--pty</option> are specified, see below).</para> <para>If a command is run as transient scope unit, it will be executed by <command>systemd-run</command> itself as parent process and will thus inherit the execution environment of the caller. However, the @@ -325,6 +325,11 @@ to the terminal <command>systemd-run</command> 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.</para> + <para>This option will result in <command>systemd-run</command> synchronously waiting for + the transient service to terminate, similar to specifying <option>--wait</option>. If specified + along with <option>--wait</option>, <command>systemd-run</command> won't exit when manually disconnecting + from the pseudo TTY device.</para> + <para>Note that <citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s <command>shell</command> command is usually a better alternative for requesting a new, interactive login @@ -341,15 +346,19 @@ <listitem><para>If specified, standard input, output, and error of the transient service are inherited from the <command>systemd-run</command> command itself. This allows <command>systemd-run</command> - 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 <option>--pty</option> instead - in that case.</para> + to be used within shell pipelines.</para> + + <para>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 <option>--pty</option> + instead in that case.</para> <para>When both <option>--pipe</option> and <option>--pty</option> 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 <option>--pty</option> is used, and otherwise <option>--pipe</option>.</para> + <para>This option will result in <command>systemd-run</command> synchronously waiting for + the transient service to terminate, similar to specifying <option>--wait</option>.</para> + <para>When this option is used the original file descriptors <command>systemd-run</command> receives are passed to the service processes as-is. If the service runs with different privileges than <command>systemd-run</command>, this means the service might not be able to reopen the passed file |