-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Issue Description
The RPM spec files for ProxySQL have been updated to uncomment BuildRequires: systemd-rpm-macros to fix uninstallation failures on Amazon Linux 2023 and other RHEL-based distributions. However, the build images used to create these RPM packages also need to have the systemd-rpm-macros package installed, or the builds will fail.
Problem Details
When building RPM packages for RHEL-based distributions (CentOS, AlmaLinux, Fedora, OpenSUSE), the %systemd_preun macro requires the systemd-rpm-macros package to be available in the build environment. Without this package, the macro expands to invalid shell code, causing uninstallation to fail with errors like:
/var/tmp/rpm-tmp.YmLxQl: line 2: fg: no job control
This is related to PR #5336 in the main ProxySQL repository: sysown/proxysql#5336
And the corresponding issue: sysown/proxysql#5335
Required Changes
The following Docker build images need to be updated to install the systemd-rpm-macros package:
For RHEL-based distributions (CentOS, AlmaLinux, Fedora):
Add systemd-rpm-macros to the package installation command.
Current code in RHEL-based Dockerfiles:
# gcc & build tools
RUN yum install -y \
make cmake automake bison flex \
git patch \
bzip2 tar wget \
gcc gcc-c++ \
libtool \
rpm-build \
python3 \
pkg-configRequired change:
# gcc & build tools
RUN yum install -y \
make cmake automake bison flex \
git patch \
bzip2 tar wget \
gcc gcc-c++ \
libtool \
rpm-build \
python3 \
pkg-config \
systemd-rpm-macrosAffected files:
build-images/build-centos9/Dockerfilebuild-images/build-centos10/Dockerfilebuild-images/build-almalinux8/Dockerfilebuild-images/build-almalinux9/Dockerfilebuild-images/build-almalinux10/Dockerfilebuild-images/build-fedora41/Dockerfilebuild-images/build-fedora42/Dockerfilebuild-images/build-fedora43/Dockerfile
For OpenSUSE-based distributions:
Add systemd-rpm-macros to the package installation command.
Current code in OpenSUSE Dockerfiles:
# gcc & build tools
RUN zypper install -y \
make cmake automake bison flex \
git patch \
bzip2 gzip tar wget \
gcc gcc-c++ \
rpm-build \
python3 \
libtool \
pkg-configRequired change:
# gcc & build tools
RUN zypper install -y \
make cmake automake bison flex \
git patch \
bzip2 gzip tar wget \
gcc gcc-c++ \
rpm-build \
python3 \
libtool \
pkg-config \
systemd-rpm-macrosAffected files:
build-images/build-opensuse15/Dockerfilebuild-images/build-opensuse16/Dockerfile
Impact
Without these changes:
- RPM builds will fail when
BuildRequires: systemd-rpm-macrosis uncommented in the spec files - Users will continue to experience uninstallation failures on Amazon Linux 2023 and other RHEL-based distributions
- The fix in PR #5336 in the main ProxySQL repository will be incomplete
Solution
Update all affected Dockerfiles to install the appropriate systemd-rpm-macros package for their respective distributions. After updating the build images, rebuild and publish the Docker images, then rebuild the ProxySQL RPM packages using the updated images.
Verification
After implementing these changes, verify that:
- The Docker images build successfully
- ProxySQL RPM packages can be built using these images
- The built packages can be installed and uninstalled without errors on Amazon Linux 2023 and other RHEL-based distributions
- The %preun scriptlet executes correctly during uninstallation
Additional Notes
This is a critical fix for users on Amazon Linux 2023 and other systemd-based RHEL distributions who are experiencing uninstallation failures. The change is minimal and only adds a required dependency for proper RPM package functionality.