diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-09-08 15:38:40 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-09-12 16:28:12 +0200 |
commit | 5dca7739e862eae50a162b0cc7f8613f7fd33c81 (patch) | |
tree | 90ae1e806fd0281e05aeec8439cda5ef751e5b21 /man | |
parent | c13ee7cc8be47b7d7a87b69b2ce9d3f35d530cee (diff) | |
download | systemd-5dca7739e862eae50a162b0cc7f8613f7fd33c81.tar.gz |
run: add new --pipe option for including "systemd-run" commands in shell pipelines
In this mode, we'll directly connect stdin/stdout/stderr of the invoked
service with whatever systemd-run itself is invoked on. This allows
inclusion of "systemd-run" commands in shell pipelines, as unlike
"--pty" this means EOF of stdin/stdout/stderr are propagated
independently.
If --pty and --pipe are combined systemd-run will automatically pick the
right choice for the context it is invoked in, i.e. --pty when invoked
on a TTY, and --pipe otherwise.
Diffstat (limited to 'man')
-rw-r--r-- | man/systemd-run.xml | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/man/systemd-run.xml b/man/systemd-run.xml index 5e44b1523d..822be3511c 100644 --- a/man/systemd-run.xml +++ b/man/systemd-run.xml @@ -219,14 +219,31 @@ <term><option>--pty</option></term> <term><option>-t</option></term> - <listitem><para>When invoking the command, the transient service connects its standard input and output to the - terminal <command>systemd-run</command> is invoked on, via a pseudo TTY device. This allows running binaries - that expect interactive user input as services, such as interactive command shells.</para> + <listitem><para>When invoking the command, the transient service connects its standard input, output and error + to the terminal <command>systemd-run</command> is invoked on, via a pseudo TTY device. This allows running + binaries that expect interactive user input/output as services, such as interactive command shells.</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 - session on the local host or a local container.</para></listitem> + session on the local host or a local container.</para> + + <para>See below for details on how this switch combines with <option>--pipe</option>.</para></listitem> + </varlistentry> + + <varlistentry> + <term><option>--pipe</option></term> + <term><option>-P</option></term> + + <listitem><para>If specified, standard input, output, and error of the transient service are inherited from the + <command>systemd-run</command> command itself. Use this option in order to use <command>systemd-run</command> + within shell pipelines. Note that this mode is not suitable for interactive command shells and similar, as the + service process will not be made 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></listitem> </varlistentry> <varlistentry> |