Skip to content

Commit 566e276

Browse files
YHNdnzjbluca
authored andcommitted
man/systemd-run: beef up info regarding interaction between --pty, --pipe, and --wait
(cherry picked from commit d73a47d) (cherry picked from commit ce25cf6) (cherry picked from commit d1e36e6) (cherry picked from commit 94081ff)
1 parent 3e8fcb1 commit 566e276

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

man/systemd-run.xml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
other service, and thus shows up in the output of <command>systemctl list-units</command> like any other unit. It
6565
will run in a clean and detached execution environment, with the service manager as its parent process. In this
6666
mode, <command>systemd-run</command> will start the service asynchronously in the background and return after the
67-
command has begun execution (unless <option>--no-block</option> or <option>--wait</option> are specified, see
68-
below).</para>
67+
command has begun execution (unless <option>--no-block</option>, <option>--wait</option>, <option>--pipe</option>,
68+
or <option>--pty</option> are specified, see below).</para>
6969

7070
<para>If a command is run as transient scope unit, it will be executed by <command>systemd-run</command>
7171
itself as parent process and will thus inherit the execution environment of the caller. However, the
@@ -262,6 +262,11 @@
262262
to the terminal <command>systemd-run</command> is invoked on, via a pseudo TTY device. This allows running
263263
programs that expect interactive user input/output as services, such as interactive command shells.</para>
264264

265+
<para>This option will result in <command>systemd-run</command> synchronously waiting for
266+
the transient service to terminate, similar to specifying <option>--wait</option>. If specified
267+
along with <option>--wait</option>, <command>systemd-run</command> won't exit when manually disconnecting
268+
from the pseudo TTY device.</para>
269+
265270
<para>Note that
266271
<citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
267272
<command>shell</command> command is usually a better alternative for requesting a new, interactive login
@@ -276,15 +281,19 @@
276281

277282
<listitem><para>If specified, standard input, output, and error of the transient service are inherited from the
278283
<command>systemd-run</command> command itself. This allows <command>systemd-run</command>
279-
to be used within shell pipelines.
280-
Note that this mode is not suitable for interactive command shells and similar, as the
281-
service process will not become a TTY controller when invoked on a terminal. Use <option>--pty</option> instead
282-
in that case.</para>
284+
to be used within shell pipelines.</para>
285+
286+
<para>Note that this mode is not suitable for interactive command shells and similar, as the
287+
service process will not become a TTY controller when invoked on a terminal. Use <option>--pty</option>
288+
instead in that case.</para>
283289

284290
<para>When both <option>--pipe</option> and <option>--pty</option> are used in combination the more appropriate
285291
option is automatically determined and used. Specifically, when invoked with standard input, output and error
286292
connected to a TTY <option>--pty</option> is used, and otherwise <option>--pipe</option>.</para>
287293

294+
<para>This option will result in <command>systemd-run</command> synchronously waiting for
295+
the transient service to terminate, similar to specifying <option>--wait</option>.</para>
296+
288297
<para>When this option is used the original file descriptors <command>systemd-run</command> receives are passed
289298
to the service processes as-is. If the service runs with different privileges than
290299
<command>systemd-run</command>, this means the service might not be able to re-open the passed file

0 commit comments

Comments
 (0)