summaryrefslogtreecommitdiff
path: root/src/run
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-04-22 20:08:34 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-23 09:47:20 +0200
commita7c71d214c37797d82de2f66cfe0a0a79c3a5c92 (patch)
treeb66d8f88bc4158bf5950f14d83a8f9df99cc9774 /src/run
parent73781de41fe92fc210bc4c74b9a94dbf3f2d98c4 (diff)
downloadsystemd-a7c71d214c37797d82de2f66cfe0a0a79c3a5c92.tar.gz
run: don't wait for start job to complete when running interactively anyway
Otherwise we'd not read the services input while waiting for the job to wait, and there's no point in waiting for the job anyway if we wait for the unit to stop ultimately. Fixes: #15395
Diffstat (limited to 'src/run')
-rw-r--r--src/run/run.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/run/run.c b/src/run/run.c
index 6076eabe92..ea49d5dab5 100644
--- a/src/run/run.c
+++ b/src/run/run.c
@@ -1144,7 +1144,11 @@ static int start_transient_service(
assert_not_reached("Can't allocate tty via ssh");
}
- if (!arg_no_block) {
+ /* Optionally, wait for the start job to complete. If we are supposed to read the service's stdin
+ * lets skip this however, because we should start that already when the start job is running, and
+ * there's little point in waiting for the start job to complete in that case anyway, as we'll wait
+ * for EOF anyway, which is going to be much later. */
+ if (!arg_no_block && arg_stdio == ARG_STDIO_NONE) {
r = bus_wait_for_jobs_new(bus, &w);
if (r < 0)
return log_error_errno(r, "Could not watch jobs: %m");