]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: make sure we send out READY=1 when --wait
authorMike Yuan <me@yhndnzj.com>
Sun, 9 Nov 2025 19:14:01 +0000 (20:14 +0100)
committerMike Yuan <me@yhndnzj.com>
Sun, 9 Nov 2025 21:39:42 +0000 (22:39 +0100)
Let's skip bus_wait_for_jobs_one() when --wait as well,
as it surpasses the start job and allows for
run_context_check_started() to fire.

src/run/run.c

index 47757d19d0d2ced493dd9dc2ed4d624539d3b204..96fa46bd3a5ba2d906cdb24a4937e40f1c990d02 100644 (file)
@@ -2504,8 +2504,9 @@ static int start_transient_service(sd_bus *bus) {
         /* 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) {
+         * for EOF anyway, which is going to be much later. Similar applies to --wait where we're going
+         * to wait for the service to terminate. */
+        if (!arg_no_block && !arg_wait && 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");