From e16647c39d195804711a006667d5bce49c0ef73d Mon Sep 17 00:00:00 2001 From: Chris Down Date: Mon, 18 Dec 2017 07:53:29 +0000 Subject: [PATCH] condition: Create AssertControlGroupController (#7630) Up until now, the behaviour in systemd has (mostly) been to silently ignore failures to action unit directives that refer to an unavailble controller. The addition of AssertControlGroupController and its conditional counterpart allow explicit specification of the desired behaviour when such a situation occurs. As for how this can happen, it is possible that a particular controller is not available in the cgroup hierarchy. One possible reason for this is that, in the running kernel, the controller simply doesn't exist -- for example, the CPU controller in cgroup v2 has only recently been merged and was out of tree until then. Another possibility is that the controller exists, but has been forcibly disabled by `cgroup_disable=` on the kernel command line. In future this will also support whatever comes out of issue #7624, `DefaultXAccounting=never`, or similar. --- man/systemd.unit.xml | 14 +++++++ src/core/load-fragment-gperf.gperf.m4 | 2 + src/shared/condition.c | 28 +++++++++++++ src/shared/condition.h | 2 + src/test/test-condition.c | 74 +++++++++++++++++++++++++++++++++++ 5 files changed, 120 insertions(+) diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 445c26f..005fdea 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -939,6 +939,7 @@ ConditionFileIsExecutable= ConditionUser= ConditionGroup= + ConditionControlGroupController=