Blame SOURCES/audit-3.0-cond-restart.patch

947d92
From 6f699797f43329e16fc89db97e1b95b0cc851860 Mon Sep 17 00:00:00 2001
947d92
From: Steve Grubb <sgrubb@redhat.com>
947d92
Date: Tue, 9 Apr 2019 19:45:27 +0200
947d92
Subject: [PATCH] Make conditional restart conditional again
947d92
947d92
---
947d92
 init.d/auditd.condrestart | 10 +++++++---
947d92
 1 file changed, 7 insertions(+), 3 deletions(-)
947d92
947d92
diff --git a/init.d/auditd.condrestart b/init.d/auditd.condrestart
947d92
index efbaaa8..d86e5e4 100644
947d92
--- a/init.d/auditd.condrestart
947d92
+++ b/init.d/auditd.condrestart
947d92
@@ -2,6 +2,10 @@
947d92
 # Helper script to provide legacy auditd service options not
947d92
 # directly supported by systemd.
947d92
 
947d92
-/usr/libexec/initscripts/legacy-actions/auditd/restart
947d92
-RETVAL="$?"
947d92
-exit $RETVAL
947d92
+state=`service auditd status | awk '/^   Active/ { print $2 }'`
947d92
+if [ $state = "active" ] ; then
947d92
+	/usr/libexec/initscripts/legacy-actions/auditd/restart
947d92
+	RETVAL="$?"
947d92
+	exit $RETVAL
947d92
+fi
947d92
+exit 0