Blame SOURCES/bz2145260-mysql-common-return-error-if-kill-fails.patch

f18d3d
From 97a05e0e662ed922c9ecd016b39ab90ee233d5c9 Mon Sep 17 00:00:00 2001
f18d3d
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
f18d3d
Date: Thu, 24 Nov 2022 10:36:56 +0100
f18d3d
Subject: [PATCH] mysql-common: return error in stop-action if kill fails to
f18d3d
 stop the process, so the node can get fenced
f18d3d
f18d3d
---
f18d3d
 heartbeat/mysql-common.sh | 4 ++++
f18d3d
 1 file changed, 4 insertions(+)
f18d3d
f18d3d
diff --git a/heartbeat/mysql-common.sh b/heartbeat/mysql-common.sh
f18d3d
index 34e1c6748..8104019b0 100755
f18d3d
--- a/heartbeat/mysql-common.sh
f18d3d
+++ b/heartbeat/mysql-common.sh
f18d3d
@@ -318,6 +318,10 @@ mysql_common_stop()
f18d3d
     if [ $? != $OCF_NOT_RUNNING ]; then
f18d3d
         ocf_log info "MySQL failed to stop after ${shutdown_timeout}s using SIGTERM. Trying SIGKILL..."
f18d3d
         /bin/kill -KILL $pid > /dev/null
f18d3d
+        mysql_common_status info $pid
f18d3d
+        if [ $? != $OCF_NOT_RUNNING ]; then
f18d3d
+            return $OCF_ERR_GENERIC
f18d3d
+        fi
f18d3d
     fi
f18d3d
 
f18d3d
     ocf_log info "MySQL stopped";