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.
MemoryAccounting=true
IOAccounting=true
TasksAccounting=true
-ManagedOOMMemoryPressure=kill
-ManagedOOMMemoryPressureLimit=20%
--- /dev/null
+# 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%
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