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

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