]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
TEST-55-OOMD: set ManagedOOMMemoryPressure= and friends in a drop-in config
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Oct 2024 07:09:11 +0000 (16:09 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 16 Oct 2024 05:49:56 +0000 (14:49 +0900)
Fedora and friends has a drop-in config for the settings in
/usr/lib/systemd/user/slice.d/ . Hence, settings in the main .slice may be
overridden. Let's set below in a drop-in with higher decimal prefix.

Also, rename override.conf -> 99-managed-oom-preference.conf for the same reason.

test/units/TEST-55-OOMD-workload.slice
test/units/TEST-55-OOMD-workload.slice.d/99-oom.conf [new file with mode: 0644]
test/units/TEST-55-OOMD.sh

index d117b754baa6ad7bb454c55028b0e4485f9d4a17..155807360445c7f8398c98adfd51aab6498ae0a3 100644 (file)
@@ -7,5 +7,3 @@ CPUAccounting=true
 MemoryAccounting=true
 IOAccounting=true
 TasksAccounting=true
-ManagedOOMMemoryPressure=kill
-ManagedOOMMemoryPressureLimit=20%
diff --git a/test/units/TEST-55-OOMD-workload.slice.d/99-oom.conf b/test/units/TEST-55-OOMD-workload.slice.d/99-oom.conf
new file mode 100644 (file)
index 0000000..1bed89c
--- /dev/null
@@ -0,0 +1,7 @@
+# SPDX-License-Identifier: LGPL-2.1-or-later
+[Slice]
+# Fedora and friends has a drop-in config for the settings in
+# /usr/lib/systemd/user/slice.d/ . Hence, settings in the main .slice may be
+# overridden. Let's set below in a drop-in with higher decimal prefix.
+ManagedOOMMemoryPressure=kill
+ManagedOOMMemoryPressureLimit=20%
index 944067c5413043e3821267005b9cc7ae92d0c98d..4a7c7f78aecc9d5d9c5542c223d3c183b9b5fbd2 100755 (executable)
@@ -153,7 +153,7 @@ if cgroupfs_supports_user_xattrs; then
     sleep 120 # wait for systemd-oomd kill cool down and elevated memory pressure to come down
 
     mkdir -p /run/systemd/system/TEST-55-OOMD-testbloat.service.d/
-    cat >/run/systemd/system/TEST-55-OOMD-testbloat.service.d/override.conf <<EOF
+    cat >/run/systemd/system/TEST-55-OOMD-testbloat.service.d/99-managed-oom-preference.conf <<EOF
 [Service]
 ManagedOOMPreference=avoid
 EOF