From 13d0b19d4e5abb352eb3401f4a97ed9594fec757 Mon Sep 17 00:00:00 2001 From: Anita Zhang Date: Tue, 23 Feb 2021 00:09:10 -0800 Subject: [PATCH 1/2] units: add Conditions for systemd-oomd.service Prompted by https://bugzilla.redhat.com/show_bug.cgi?id=1927148 and https://bugzilla.redhat.com/show_bug.cgi?id=1931181. Adds condition check for cgroups v2 and PSI, which systemd-oomd cannot start without. --- units/systemd-oomd.service.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/units/systemd-oomd.service.in b/units/systemd-oomd.service.in index fd7c8d213d..f264a1bef0 100644 --- a/units/systemd-oomd.service.in +++ b/units/systemd-oomd.service.in @@ -13,6 +13,10 @@ Documentation=man:systemd-oomd.service(8) DefaultDependencies=no Before=multi-user.target shutdown.target Conflicts=shutdown.target +ConditionControlGroupController=v2 +ConditionPathExists=/proc/pressure/cpu +ConditionPathExists=/proc/pressure/io +ConditionPathExists=/proc/pressure/memory [Service] AmbientCapabilities=CAP_KILL CAP_DAC_OVERRIDE From e7b3f1a6c358dd3eaf0b50547bd52130ad4126ae Mon Sep 17 00:00:00 2001 From: Anita Zhang Date: Tue, 23 Feb 2021 02:06:58 -0800 Subject: [PATCH 2/2] README: add config_psi as requirement for systemd-oomd --- README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README b/README index bb0f126873..e0b7fbf8bf 100644 --- a/README +++ b/README @@ -126,6 +126,9 @@ REQUIREMENTS: Required for systemd-nspawn: CONFIG_DEVPTS_MULTIPLE_INSTANCES or Linux kernel >= 4.7 + Required for systemd-oomd: + CONFIG_PSI + Note that kernel auditing is broken when used with systemd's container code. When using systemd in conjunction with containers, please make sure to either turn off auditing at