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

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