summaryrefslogtreecommitdiff
path: root/src/unit.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-07 18:47:35 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-07 18:47:35 +0200
commitf68319bbb8e95e6afa5793834668b5c094616249 (patch)
treebd1f5c7dfbfa92358f0f839db8772694720d2ad6 /src/unit.c
parentffd73e3599ea2a97c03c1765cd4bc94ebc152f89 (diff)
unit: disallow configuration of more than one on_failure dependencies if OnFailureIsolate= is on
Diffstat (limited to 'src/unit.c')
-rw-r--r--src/unit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/unit.c b/src/unit.c
index e5a9623528..32071f2170 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -814,6 +814,16 @@ int unit_load(Unit *u) {
if ((r = unit_add_default_dependencies(u)) < 0)
goto fail;
+ if (u->meta.on_failure_isolate &&
+ set_size(u->meta.dependencies[UNIT_ON_FAILURE]) > 1) {
+
+ log_error("More than one OnFailure= dependencies specified for %s but OnFailureIsolate= enabled. Refusing.",
+ u->meta.id);
+
+ r = -EINVAL;
+ goto fail;
+ }
+
assert((u->meta.load_state != UNIT_MERGED) == !u->meta.merged_into);
unit_add_to_dbus_queue(unit_follow_merge(u));