cgroup: add a new "can_delegate" flag to the unit vtable, and set it for scope and service units only
Currently we allowed delegation for alluntis with cgroup backing except for slices. Let's make this a bit more strict for now, and only allow this in service and scope units. Let's also add a generic accessor unit_cgroup_delegate() for checking whether a unit has delegation turned on that checks the new bool first. Also, when doing transient units, let's explcitly refuse turning on delegation for unit types that don#t support it. This is mostly cosmetical as we wouldn't act on the delegation request anyway, but certainly helpful for debugging.
This commit is contained in:
@@ -599,6 +599,7 @@ const UnitVTable scope_vtable = {
|
||||
.private_section = "Scope",
|
||||
|
||||
.can_transient = true,
|
||||
.can_delegate = true,
|
||||
|
||||
.init = scope_init,
|
||||
.load = scope_load,
|
||||
|
||||
Reference in New Issue
Block a user