teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0014-unit-When-stopping-due-to-BindsTo-log-which-unit-cau.patch

Zbigniew Jędrzejewski-Szmek e4a83a
From ca0cf2741ef9db81141f4444ab58dd3552c8fb1f Mon Sep 17 00:00:00 2001
Colin Walters b1d608
From: Colin Walters <walters@verbum.org>
Zbigniew Jędrzejewski-Szmek e4a83a
Date: Tue, 17 Feb 2015 13:47:34 -0500
Colin Walters b1d608
Subject: [PATCH] unit: When stopping due to BindsTo=, log which unit caused it
Colin Walters b1d608
Colin Walters b1d608
I'm trying to track down a relatively recent change in systemd
Colin Walters b1d608
which broke OSTree; see https://bugzilla.gnome.org/show_bug.cgi?id=743891
Colin Walters b1d608
Colin Walters b1d608
Systemd started to stop sysroot.mount, and this patch should help
Colin Walters b1d608
me debug why at least.
Colin Walters b1d608
Colin Walters b1d608
While we're here, "break" on the first unit we find that will
Colin Walters b1d608
deactivate, as there's no point in further iteration.
Zbigniew Jędrzejewski-Szmek e4a83a
Zbigniew Jędrzejewski-Szmek e4a83a
(cherry picked from commit 98f738b62047229af4a929d7996e2ab04253b02c)
Colin Walters b1d608
---
Zbigniew Jędrzejewski-Szmek e4a83a
 src/core/unit.c | 4 +++-
Zbigniew Jędrzejewski-Szmek e4a83a
 1 file changed, 3 insertions(+), 1 deletion(-)
Colin Walters b1d608
Colin Walters b1d608
diff --git a/src/core/unit.c b/src/core/unit.c
Zbigniew Jędrzejewski-Szmek e4a83a
index 9f1e55e2f1..563f6fe850 100644
Colin Walters b1d608
--- a/src/core/unit.c
Colin Walters b1d608
+++ b/src/core/unit.c
Zbigniew Jędrzejewski-Szmek e4a83a
@@ -1648,12 +1648,14 @@ static void unit_check_binds_to(Unit *u) {
Colin Walters b1d608
                         continue;
Colin Walters b1d608
 
Colin Walters b1d608
                 stop = true;
Colin Walters b1d608
+                break;
Colin Walters b1d608
         }
Colin Walters b1d608
 
Colin Walters b1d608
         if (!stop)
Colin Walters b1d608
                 return;
Colin Walters b1d608
 
Colin Walters b1d608
-        log_unit_info(u->id, "Unit %s is bound to inactive unit. Stopping, too.", u->id);
Colin Walters b1d608
+        assert(other);
Colin Walters b1d608
+        log_unit_info(u->id, "Unit %s is bound to inactive unit %s. Stopping, too.", u->id, other->id);
Colin Walters b1d608
 
Colin Walters b1d608
         /* A unit we need to run is gone. Sniff. Let's stop this. */
Colin Walters b1d608
         manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL);