]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: add Conditions for systemd-oomd.service
authorAnita Zhang <the.anitazha@gmail.com>
Tue, 23 Feb 2021 08:09:10 +0000 (00:09 -0800)
committerAnita Zhang <the.anitazha@gmail.com>
Tue, 23 Feb 2021 10:09:21 +0000 (02:09 -0800)
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

index fd7c8d213db70535a57273b310f33e565fb3200c..f264a1bef02402c937a426b79eed73ea1e391502 100644 (file)
@@ -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