]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/unit: mark running reload job as canceled if the unit deactivated
authorMike Yuan <me@yhndnzj.com>
Sat, 15 Nov 2025 20:06:39 +0000 (21:06 +0100)
committerMike Yuan <me@yhndnzj.com>
Mon, 17 Nov 2025 18:26:11 +0000 (19:26 +0100)
The semantics of reload is that the service updates its extrinsic state
and continues execution. If it actually deactivated we shouldn't
spuriously notify the caller that reload succeeded.

src/core/unit.c

index b6dc962f86611b1b352c0f4c6aca4688a273ba1b..7675082e229cb52ae10d4b56dcc9621275853bf5 100644 (file)
@@ -2651,7 +2651,7 @@ static bool unit_process_job(Job *j, UnitActiveState ns, bool reload_success) {
                                 unexpected = true;
 
                                 if (UNIT_IS_INACTIVE_OR_FAILED(ns))
-                                        job_finish_and_invalidate(j, ns == UNIT_FAILED ? JOB_FAILED : JOB_DONE, true, false);
+                                        job_finish_and_invalidate(j, ns == UNIT_FAILED ? JOB_FAILED : JOB_CANCELED, true, false);
                         }
                 }