diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-06 11:57:35 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-02-12 11:34:00 +0100 |
commit | 1d9cc8768f173b25757c01aa0d4c7be7cd7116bc (patch) | |
tree | 1a7d700eea0e9835e782f48823468902e351d0d2 /src/core/unit.h | |
parent | Merge pull request #8143 from yuwata/drop-unused-func (diff) | |
download | systemd-1d9cc8768f173b25757c01aa0d4c7be7cd7116bc.tar.xz systemd-1d9cc8768f173b25757c01aa0d4c7be7cd7116bc.zip |
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.
Diffstat (limited to 'src/core/unit.h')
-rw-r--r-- | src/core/unit.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/unit.h b/src/core/unit.h index 3210583050..6d49c7d5f2 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -568,6 +568,9 @@ struct UnitVTable { /* True if transient units of this type are OK */ bool can_transient:1; + /* True if cgroup delegation is permissible */ + bool can_delegate:1; + /* True if queued jobs of this type should be GC'ed if no other job needs them anymore */ bool gc_jobs:1; }; |