summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-11-14 23:47:53 +0100
committerLennart Poettering <lennart@poettering.net>2010-11-14 23:48:21 +0100
commit6210e7fc31e14159627144f7409eadd3ce0d72b9 (patch)
treeb4510ab2477bdb0fa1df3dbefa91f1b01846c451 /src/manager.c
parent9381a72403f622f66294ab10315240a4c4fd71cd (diff)
manager: always pull 'following' units into transaction
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/manager.c b/src/manager.c
index 932441c2de..32cd642213 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -1445,6 +1445,22 @@ static int transaction_add_job_and_dependencies(
return -ENOMEM;
if (is_new) {
+ Set *following;
+
+ /* If we are following some other unit, make sure we
+ * add all dependencies of everybody following. */
+ if (unit_following_set(ret->unit, &following) > 0) {
+ SET_FOREACH(dep, following, i)
+ if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, false, override, false, e, NULL)) < 0) {
+ log_warning("Cannot add dependency job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+
+ if (e)
+ dbus_error_free(e);
+ }
+
+ set_free(following);
+ }
+
/* Finally, recursively add in all dependencies. */
if (type == JOB_START || type == JOB_RELOAD_OR_START) {
SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUIRES], i)