When dependency unit is configured with StopWhenUnneeded=yes and
activation of main unit fails, e.g.  start timeout occurs, then
dependencies are never stopped. This happens because start job for
the main unit is still around.
---
 src/core/unit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/unit.c b/src/core/unit.c
index 0e9329f..d5c89a4 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1461,7 +1461,7 @@ void unit_notify(Unit *u, UnitActiveState os, 
UnitActiveState ns, bool reload_su
                         else if (u->job->state == JOB_RUNNING && ns != 
UNIT_ACTIVATING) {
                                 unexpected = true;
 
-                                if (UNIT_IS_INACTIVE_OR_FAILED(ns))
+                                if (UNIT_IS_INACTIVE_OR_FAILED(ns) || 
UNIT_IS_INACTIVE_OR_DEACTIVATING(ns))
                                         job_finish_and_invalidate(u->job, ns 
== UNIT_FAILED ? JOB_FAILED : JOB_DONE, true);
                         }
 
-- 
1.8.3.1

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to