1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00

core: reinstate propagation of stop/restart jobs via RequsiteOf dependencies

This reverts the primary effect of be7d9ff730.

After all Requisite= should be close to Requires=, without the one
exception that it doesn't pull in dependencies on start. However,
reverse deps on stop/restart should be treated the same way as for
Restart=, and this is already documented in the man page, hence stick to
it.

http://lists.freedesktop.org/archives/systemd-devel/2015-May/032049.html
This commit is contained in:
Lennart Poettering 2015-05-19 17:40:50 +02:00
parent 55ede093a5
commit ce74e76920

View File

@ -1030,40 +1030,26 @@ int transaction_add_job_and_dependencies(
} }
if (type == JOB_STOP || type == JOB_RESTART) { if (type == JOB_STOP || type == JOB_RESTART) {
static const UnitDependency propagate_deps[] = {
UNIT_REQUIRED_BY,
UNIT_REQUISITE_OF,
UNIT_BOUND_BY,
UNIT_CONSISTS_OF,
};
unsigned j;
for (j = 0; j < ELEMENTSOF(propagate_deps); j++)
SET_FOREACH(dep, ret->unit->dependencies[propagate_deps[j]], i) {
SET_FOREACH(dep, ret->unit->dependencies[UNIT_REQUIRED_BY], i) {
r = transaction_add_job_and_dependencies(tr, type, dep, ret, true, override, false, false, ignore_order, e); r = transaction_add_job_and_dependencies(tr, type, dep, ret, true, override, false, false, ignore_order, e);
if (r < 0) { if (r < 0) {
if (r != -EBADR) if (r != -EBADR)
goto fail; goto fail;
if (e)
sd_bus_error_free(e); sd_bus_error_free(e);
} }
} }
SET_FOREACH(dep, ret->unit->dependencies[UNIT_BOUND_BY], i) {
r = transaction_add_job_and_dependencies(tr, type, dep, ret, true, override, false, false, ignore_order, e);
if (r < 0) {
if (r != -EBADR)
goto fail;
if (e)
sd_bus_error_free(e);
}
}
SET_FOREACH(dep, ret->unit->dependencies[UNIT_CONSISTS_OF], i) {
r = transaction_add_job_and_dependencies(tr, type, dep, ret, true, override, false, false, ignore_order, e);
if (r < 0) {
if (r != -EBADR)
goto fail;
if (e)
sd_bus_error_free(e);
}
}
} }
if (type == JOB_RELOAD) { if (type == JOB_RELOAD) {