]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/service.c
cgroup: add a new "can_delegate" flag to the unit vtable, and set it for scope and...
authorLennart Poettering <lennart@poettering.net>
Tue, 6 Feb 2018 10:57:35 +0000 (11:57 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 12 Feb 2018 10:34:00 +0000 (11:34 +0100)
commit1d9cc8768f173b25757c01aa0d4c7be7cd7116bc
tree1a7d700eea0e9835e782f48823468902e351d0d2
parentb8e2400586452499131ff5ab1edb60c1dfbcf92b
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.
src/core/bpf-firewall.c
src/core/cgroup.c
src/core/cgroup.h
src/core/dbus-cgroup.c
src/core/scope.c
src/core/service.c
src/core/unit.c
src/core/unit.h