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-config
Required 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-macros
Affected files:
build-images/build-centos9/Dockerfile
build-images/build-centos10/Dockerfile
build-images/build-almalinux8/Dockerfile
build-images/build-almalinux9/Dockerfile
build-images/build-almalinux10/Dockerfile
build-images/build-fedora41/Dockerfile
build-images/build-fedora42/Dockerfile
build-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-config
Required 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-macros
Affected files:
build-images/build-opensuse15/Dockerfile
build-images/build-opensuse16/Dockerfile
Impact
Without these changes:
- RPM builds will fail when
BuildRequires: systemd-rpm-macros is 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.
Issue Description
The RPM spec files for ProxySQL have been updated to uncomment
BuildRequires: systemd-rpm-macrosto 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 thesystemd-rpm-macrospackage installed, or the builds will fail.Problem Details
When building RPM packages for RHEL-based distributions (CentOS, AlmaLinux, Fedora, OpenSUSE), the
%systemd_preunmacro requires thesystemd-rpm-macrospackage to be available in the build environment. Without this package, the macro expands to invalid shell code, causing uninstallation to fail with errors like: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-macrospackage:For RHEL-based distributions (CentOS, AlmaLinux, Fedora):
Add
systemd-rpm-macrosto the package installation command.Current code in RHEL-based Dockerfiles:
Required change:
Affected 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/DockerfileFor OpenSUSE-based distributions:
Add
systemd-rpm-macrosto the package installation command.Current code in OpenSUSE Dockerfiles:
Required change:
Affected files:
build-images/build-opensuse15/Dockerfilebuild-images/build-opensuse16/DockerfileImpact
Without these changes:
BuildRequires: systemd-rpm-macrosis uncommented in the spec filesSolution
Update all affected Dockerfiles to install the appropriate
systemd-rpm-macrospackage 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:
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.