mirror of
https://github.com/systemd/systemd.git
synced 2025-01-28 21:47:38 +03:00
unit: disallow configuration of more than one on_failure dependencies if OnFailureIsolate= is on
This commit is contained in:
parent
ffd73e3599
commit
f68319bbb8
10
src/unit.c
10
src/unit.c
@ -814,6 +814,16 @@ int unit_load(Unit *u) {
|
|||||||
if ((r = unit_add_default_dependencies(u)) < 0)
|
if ((r = unit_add_default_dependencies(u)) < 0)
|
||||||
goto fail;
|
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);
|
assert((u->meta.load_state != UNIT_MERGED) == !u->meta.merged_into);
|
||||||
|
|
||||||
unit_add_to_dbus_queue(unit_follow_merge(u));
|
unit_add_to_dbus_queue(unit_follow_merge(u));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user