summaryrefslogtreecommitdiff
path: root/src/manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-01-11 02:47:14 +0100
committerLennart Poettering <lennart@poettering.net>2012-01-11 02:52:34 +0100
commit4dcc1cb4155c4a72155e36a5461ab0847d4f1bf1 (patch)
treef063a012742604c46b30083672d2c0dd5069e095 /src/manager.c
parentbd1a69818042e85e24ec3adaf5eb3ac30ab1d9fd (diff)
unit: implement new PropagateReloadTo=/PropagateReloadFrom= operations
Diffstat (limited to 'src/manager.c')
-rw-r--r--src/manager.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/manager.c b/src/manager.c
index 7fd860ed06..dbcd630b05 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -1610,7 +1610,9 @@ static int transaction_add_job_and_dependencies(
dbus_error_free(e);
}
- } else if (type == JOB_STOP || type == JOB_RESTART || type == JOB_TRY_RESTART) {
+ }
+
+ if (type == JOB_STOP || type == JOB_RESTART || type == JOB_TRY_RESTART) {
SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_REQUIRED_BY], i)
if ((r = transaction_add_job_and_dependencies(m, type, dep, ret, true, override, false, false, ignore_order, e, NULL)) < 0) {
@@ -1633,6 +1635,20 @@ static int transaction_add_job_and_dependencies(
}
}
+ if (type == JOB_RELOAD || type == JOB_RELOAD_OR_START) {
+
+ SET_FOREACH(dep, ret->unit->meta.dependencies[UNIT_PROPAGATE_RELOAD_TO], i) {
+ r = transaction_add_job_and_dependencies(m, JOB_RELOAD, dep, ret, false, override, false, false, ignore_order, e, NULL);
+
+ if (r < 0) {
+ log_warning("Cannot add dependency reload job for unit %s, ignoring: %s", dep->meta.id, bus_error(e, r));
+
+ if (e)
+ dbus_error_free(e);
+ }
+ }
+ }
+
/* JOB_VERIFY_STARTED, JOB_RELOAD require no dependency handling */
}