From 04a488f0db459404c7b374c8da4a2d8a8ca31ed1 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: May 17 2021 23:03:03 +0000 Subject: Add systemd-oomd-defaults subpackage from Fedora --- diff --git a/SOURCES/10-oomd-defaults.conf b/SOURCES/10-oomd-defaults.conf new file mode 100644 index 0000000..0254657 --- /dev/null +++ b/SOURCES/10-oomd-defaults.conf @@ -0,0 +1,2 @@ +[OOM] +DefaultMemoryPressureDurationSec=20s diff --git a/SOURCES/10-oomd-root-slice-defaults.conf b/SOURCES/10-oomd-root-slice-defaults.conf new file mode 100644 index 0000000..49958e8 --- /dev/null +++ b/SOURCES/10-oomd-root-slice-defaults.conf @@ -0,0 +1,2 @@ +[Slice] +ManagedOOMSwap=kill diff --git a/SOURCES/10-oomd-user-service-defaults.conf b/SOURCES/10-oomd-user-service-defaults.conf new file mode 100644 index 0000000..94d5c87 --- /dev/null +++ b/SOURCES/10-oomd-user-service-defaults.conf @@ -0,0 +1,3 @@ +[Service] +ManagedOOMMemoryPressure=kill +ManagedOOMMemoryPressureLimit=50% diff --git a/SPECS/systemd.spec b/SPECS/systemd.spec index 86da224..6e4780b 100644 --- a/SPECS/systemd.spec +++ b/SPECS/systemd.spec @@ -26,7 +26,7 @@ Name: systemd Url: https://www.freedesktop.org/wiki/Software/systemd Version: 248.2 -Release: 1.1%{?dist} +Release: 1.2%{?dist} # For a breakdown of the licensing, see README License: LGPLv2+ and MIT and GPLv2+ Summary: System and Service Manager @@ -57,6 +57,10 @@ Source10: systemd-udev-trigger-no-reload.conf Source11: 20-grubby.install Source12: systemd-user +Source14: 10-oomd-defaults.conf +Source15: 10-oomd-root-slice-defaults.conf +Source16: 10-oomd-user-service-defaults.conf + Source21: macros.sysusers Source22: sysusers.attr Source23: sysusers.prov @@ -360,6 +364,15 @@ and to write journal files from serialized journal contents. This package contains systemd-journal-gatewayd, systemd-journal-remote, and systemd-journal-upload. +%package oomd-defaults +Summary: Configuration files for systemd-oomd +Requires: %{name}%{?_isa} = %{version}-%{release} +License: LGPLv2+ + +%description oomd-defaults +A set of drop-in files for systemd units to enable action from systemd-oomd, +a userspace out-of-memory (OOM) killer. + %package tests Summary: Internal unit tests for systemd Requires: %{name}%{?_isa} = %{version}-%{release} @@ -612,6 +625,11 @@ install -Dm0755 -t %{buildroot}%{_prefix}/lib/kernel/install.d/ %{SOURCE11} install -D -t %{buildroot}/usr/lib/systemd/ %{SOURCE3} +# systemd-oomd default configuration +install -Dm0644 -t %{buildroot}%{_prefix}/lib/systemd/oomd.conf.d/ %{SOURCE14} +install -Dm0644 -t %{buildroot}%{system_unit_dir}/-.slice.d/ %{SOURCE15} +install -Dm0644 -t %{buildroot}%{system_unit_dir}/user@.service.d/ %{SOURCE16} + sed -i 's|#!/usr/bin/env python3|#!%{__python3}|' %{buildroot}/usr/lib/systemd/tests/run-unit-tests.py install -m 0644 -D -t %{buildroot}%{_rpmconfigdir}/macros.d/ %{SOURCE21} @@ -929,6 +947,8 @@ fi %files journal-remote -f .file-list-remote +%files oomd-defaults -f .file-list-oomd-defaults + %files tests -f .file-list-tests %if %{with selinux} @@ -938,6 +958,9 @@ fi %endif %changelog +* Mon May 17 2021 Davide Cavalca - 248.2-1.2 +- Add systemd-oomd-defaults subpackage from Fedora + * Mon May 10 2021 Anita Zhang - 248.2-1.1 - New release for 248 - Drop patches merged in 248.2