diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-11-16 20:25:54 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-11-26 18:43:23 +0100 |
commit | e2391ce0bcb0e909b2df49ba8b53f34736d90feb (patch) | |
tree | cf2216a71a851ed8dd4ec038e6992df5bda46d31 /docs/CGROUP_DELEGATION.md | |
parent | 78f93209fc7f61f15b12d7a5f74d712bd020b249 (diff) | |
download | systemd-e2391ce0bcb0e909b2df49ba8b53f34736d90feb.tar.gz |
docs: document the .control/ subcgroup contract in the docs
Diffstat (limited to 'docs/CGROUP_DELEGATION.md')
-rw-r--r-- | docs/CGROUP_DELEGATION.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/CGROUP_DELEGATION.md b/docs/CGROUP_DELEGATION.md index 26c7466b87..ed23a0a142 100644 --- a/docs/CGROUP_DELEGATION.md +++ b/docs/CGROUP_DELEGATION.md @@ -244,6 +244,19 @@ So, if you want to do your own raw cgroups kernel level access, then allocate a scope unit, or a service unit (or just use the service unit you already have for your service code), and turn on delegation for it. +(OK, here's one caveat: if you turn on delegation for a service, and that +service has `ExecStartPost=`, `ExecReload=`, `ExecStop=` or `ExecStopPost=` +set, then these commands will be executed within the `.control/` sub-cgroup of +your service's cgroup. This is necessary because by turning on delegation we +have to assume that the cgroup delegated to your service is now an *inner* +cgroup, which means that it may not directly contain any processes. Hence, if +your service has any of these four settings set, you must be prepared that a +`.control/` subcgroup might appear, managed by the service manager. This also +means that your service code should have moved itself further down the cgroup +tree by the time it notifies the service manager about start-up readiness, so +that the service's main cgroup is definitely an inner node by the time the +service manager might start `ExecStartPost=`.) + ## Three Scenarios Let's say you write a container manager, and you wonder what to do regarding |