summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2015-02-17 13:47:34 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-02-26 09:18:01 -0500
commit98f738b62047229af4a929d7996e2ab04253b02c (patch)
treea249f385aa0d3f1bb3f3ed1fd018ce947c30409e
parent2479df30946dd327b0745ec5f9b7d3542b9538e3 (diff)
unit: When stopping due to BindsTo=, log which unit caused it
I'm trying to track down a relatively recent change in systemd which broke OSTree; see https://bugzilla.gnome.org/show_bug.cgi?id=743891 Systemd started to stop sysroot.mount, and this patch should help me debug why at least. While we're here, "break" on the first unit we find that will deactivate, as there's no point in further iteration.
-rw-r--r--src/core/unit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/unit.c b/src/core/unit.c
index 875befa0a2..590ca3555a 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -1642,12 +1642,14 @@ static void unit_check_binds_to(Unit *u) {
continue;
stop = true;
+ break;
}
if (!stop)
return;
- log_unit_info(u->id, "Unit %s is bound to inactive unit. Stopping, too.", u->id);
+ assert(other);
+ log_unit_info(u->id, "Unit %s is bound to inactive unit %s. Stopping, too.", u->id, other->id);
/* A unit we need to run is gone. Sniff. Let's stop this. */
manager_add_job(u->manager, JOB_STOP, u, JOB_FAIL, true, NULL, NULL);