X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmanager.c;h=32cd642213793e9cd136203c530c5ff36b1d7685;hp=932441c2de86af4fcd8164a70e853a8538b7d708;hb=6210e7fc31e14159627144f7409eadd3ce0d72b9;hpb=9381a72403f622f66294ab10315240a4c4fd71cd diff --git a/src/manager.c b/src/manager.c index 932441c2d..32cd64221 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)