]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man/systemd-run: beef up info regarding interaction between --pty, --pipe, and -... 32954/head
authorMike Yuan <me@yhndnzj.com>
Tue, 21 May 2024 13:39:02 +0000 (21:39 +0800)
committerMike Yuan <me@yhndnzj.com>
Tue, 21 May 2024 13:40:01 +0000 (21:40 +0800)
man/systemd-run.xml

index 60af5760998362db7a6864ee62c1f203f866ba19..e1986c1f52fdc51fe4d1b483f75e37ab7a650139 100644 (file)
@@ -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
         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
 
         <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