(#1962255) Split off systemd-oomd into a subpackage

Resolves: rhbz#1962255

Signed-off-by: Davide Cavalca <dcavalca@centosproject.org>
This commit is contained in:
Davide Cavalca 2021-05-20 09:45:33 -07:00 committed by Michal Sekletár
parent 2c73bac024
commit e111e38c12
2 changed files with 15 additions and 33 deletions

View File

@ -23,7 +23,7 @@ o_devel = open('.file-list-devel', 'w')
o_container = open('.file-list-container', 'w') o_container = open('.file-list-container', 'w')
o_networkd = open('.file-list-networkd', 'w') o_networkd = open('.file-list-networkd', 'w')
o_resolved = open('.file-list-resolved', 'w') o_resolved = open('.file-list-resolved', 'w')
o_oomd_defaults = open('.file-list-oomd-defaults', 'w') o_oomd = open('.file-list-oomd', 'w')
o_remote = open('.file-list-remote', 'w') o_remote = open('.file-list-remote', 'w')
o_tests = open('.file-list-tests', 'w') o_tests = open('.file-list-tests', 'w')
o_standalone_tmpfiles = open('.file-list-standalone-tmpfiles', 'w') o_standalone_tmpfiles = open('.file-list-standalone-tmpfiles', 'w')
@ -126,8 +126,13 @@ for file in files(buildroot):
/modprobe.d /modprobe.d
''', n, re.X): ''', n, re.X):
o = o_udev o = o_udev
elif re.search(r'10-oomd-.*defaults.conf|lib/systemd/oomd.conf.d', n, re.X): elif re.search(r'''10-oomd-.*defaults\.conf|
o = o_oomd_defaults oomd\.conf|
oomctl|
org.freedesktop.oom1|
systemd-oomd
''', n, re.X):
o = o_oomd
elif n.endswith('.standalone'): elif n.endswith('.standalone'):
if 'tmpfiles' in n: if 'tmpfiles' in n:
o = o_standalone_tmpfiles o = o_standalone_tmpfiles

View File

@ -335,14 +335,15 @@ resolution to local applications. It implements a caching and
validating DNS/DNSSEC stub resolver, as well as an LLMNR and validating DNS/DNSSEC stub resolver, as well as an LLMNR and
MulticastDNS resolver and responder. MulticastDNS resolver and responder.
%package oomd-defaults %package oomd
Summary: Configuration files for systemd-oomd Summary: A userspace out-of-memory (OOM) killer
Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
License: LGPLv2+ License: LGPLv2+
%description oomd-defaults %description oomd
A set of drop-in files for systemd units to enable action from systemd-oomd, systemd-oomd is a system service that uses cgroups-v2 and pressure stall
a userspace out-of-memory (OOM) killer. information (PSI) to monitor and take action on processes before an OOM
occurs in kernel space.
%package standalone-tmpfiles %package standalone-tmpfiles
Summary: Standalone tmpfiles binary for use in non-systemd systems Summary: Standalone tmpfiles binary for use in non-systemd systems
@ -631,20 +632,6 @@ getent passwd systemd-oom &>/dev/null || useradd -r -l -g systemd-oom -d / -s /s
%post %post
systemd-machine-id-setup &>/dev/null || : systemd-machine-id-setup &>/dev/null || :
# FIXME: move to %postun. We want to restart systemd *after* removing
# files from the old rpm. Right now we may still have bits the old
# setup if the files are not present in the new version. But before
# implement restarting of *other* services after the transaction, moving
# this would make things worse, increasing the number of warnings we get
# about needed daemon-reload.
oomd_state=$(systemctl is-active systemd-oomd 2>/dev/null || :)
# Work-around for #1931034. Remove after F34 is released.
if [ "$oomd_state" == "active" ]; then
systemctl stop -q systemd-oomd 2>/dev/null || :
fi
systemctl daemon-reexec &>/dev/null || { systemctl daemon-reexec &>/dev/null || {
# systemd v239 had bug #9553 in D-Bus authentication of the private socket, # systemd v239 had bug #9553 in D-Bus authentication of the private socket,
# which was later fixed in v240 by #9625. # which was later fixed in v240 by #9625.
@ -665,10 +652,6 @@ systemctl daemon-reexec &>/dev/null || {
fi fi
} }
if [ "$oomd_state" == "active" ]; then
systemctl start -q systemd-oomd 2>/dev/null || :
fi
if [ $1 -eq 1 ]; then if [ $1 -eq 1 ]; then
# create /var/log/journal only on initial installation, # create /var/log/journal only on initial installation,
# and only if it's writable (it won't be in rpm-ostree). # and only if it's writable (it won't be in rpm-ostree).
@ -706,12 +689,6 @@ fi
%systemd_postun_with_restart systemd-timedated.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-oomd.service %systemd_postun_with_restart systemd-timedated.service systemd-hostnamed.service systemd-journald.service systemd-localed.service systemd-oomd.service
%triggerpostun -- systemd < 247.3-2
# This is for upgrades from previous versions before oomd-defaults is available.
# We use %%triggerpostun here because rpm doesn't allow a second %%triggerun with
# a different package version.
systemctl --no-reload preset systemd-oomd.service &>/dev/null || :
%post libs %post libs
%{?ldconfig} %{?ldconfig}
@ -857,7 +834,7 @@ getent passwd systemd-resolve &>/dev/null || useradd -r -u 193 -l -g systemd-res
%files resolved -f .file-list-resolved %files resolved -f .file-list-resolved
%files oomd-defaults -f .file-list-oomd-defaults %files oomd -f .file-list-oomd
%files standalone-tmpfiles -f .file-list-standalone-tmpfiles %files standalone-tmpfiles -f .file-list-standalone-tmpfiles