RPM's for systemd based RHEL/clone distros include unnecessary deps on legacy sysv initscript packages

Description

I recently spun up an SP under Rocky Linux 9 for the first time, and
noticed it pulled in the legacy chkconfig and initscripts packages. Red
Hat 9 and its derivatives are purely systemd out-of-the-box, those
packages aren't needed for the base OS and exist just to provide
compatibility with legacy applications.

However, the shibboleth SP is not one of those, it is controlled by
systemd using the unit file installed at:

/usr/lib/systemd/system/shibd.service


Looking at the rpm spec file, which appears to be the same across all of
the various versions of Red Hat, the decision whether to install the
systemd unit file or the legacy initscript is based on the version, but
the inclusion of the legacy initscript dependencies is not, and they are
pulled in across the board whether needed or not.

I see the decision whether or not to use systemd is based on the
following conditional:

%if 0%{?suse_version} >= 1210 || 0%{?rhel} >= 7


Ideally, the same condition could be placed around the requirements at
the top:

%if "%{_vendor}" == "redhat" || "%{_vendor}" == "amazon"
[...]
+%if 0%{?rhel} >= 7 || || "%{_vendor}" == "amazon"
Requires(post): chkconfig
Requires(preun): chkconfig, initscripts
+#endif
[...]
%endif

So these packages would only be pulled in on those operating systems
that need it, rather than polluting operating systems that don't with
legacy artifacts. It looks like the Amazon rebuild never uses systemd?
Dunno, AL 2 is based of RHEL 7...

Environment

None

Activity

John W. O'Brien 
December 28, 2024 at 5:37 PM

Implemented in

commit e020e70d3f240e54dc537ec773460e3374161661 Author: John W. O'Brien <john@saltant.com> Date: Fri Dec 27 20:49:56 2024 +0000 SSPCPP-991 Finish conversion from SysV to SystemD - Convert Amazon Linux 2 from SysV to SystemD - Drop dangling SysV dependencies from RHEL 7 (and equivalent) and later

I scrubbed all nine distro/version combinations cpp-linbuild aims to support to ensure that all are using SystemD and none are pulling in the initscripts package.

Fixed

Details

Assignee

Reporter

Affects versions

Created August 19, 2024 at 9:28 PM
Updated January 17, 2025 at 2:58 PM
Resolved December 28, 2024 at 5:37 PM