From c556f804264283bd2ae0fd2ef9b49dbe604f25b3 Mon Sep 17 00:00:00 2001 From: yixiangzhike Date: Sat, 12 Feb 2022 09:21:50 +0800 Subject: [PATCH] Fix failure of stopping auditd before uninstalling (cherry picked from commit 61a0ec16c18f9f4a5e6af1ffcb5fd05a97fc31d9) --- audit.spec | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/audit.spec b/audit.spec index 5d263f6..d986cfa 100644 --- a/audit.spec +++ b/audit.spec @@ -2,7 +2,7 @@ Summary: User space tools for kernel auditing Name: audit Epoch: 1 Version: 3.0.1 -Release: 2 +Release: 3 License: GPLv2+ and LGPLv2+ URL: https://people.redhat.com/sgrubb/audit/ Source0: https://people.redhat.com/sgrubb/audit/%{name}-%{version}.tar.gz @@ -269,7 +269,14 @@ if [ -d "/etc/audisp/" ];then fi %preun -%systemd_preun auditd.service +if [ $1 -eq 0 ] && [ -x /usr/bin/systemctl ]; then + # Package removal, not upgrade + /usr/bin/systemctl --no-reload disable auditd.service || : +fi +if [ $1 -eq 0 ]; then + # Package removal, not upgrade + /sbin/service auditd stop > /dev/null 2>&1 +fi %postun /sbin/ldconfig @@ -362,6 +369,9 @@ fi %attr(644,root,root) %{_mandir}/man8/*.8.gz %changelog +* Sat Feb 12 2022 yixiangzhike - 3.0.1-3 +- Fix failure of stopping auditd before uninstalling + * Thu Dec 30 2021 yixiangzhike - 3.0.1-2 - drop unused patch file -- Gitee