File bsc#1129707-0001-OCF-controld-Give-warning-when-no-quorum-policy-not-.patch of Package pacemaker.27558

From 87fc0971befd1ccb7e551f57de918a16219fd0d5 Mon Sep 17 00:00:00 2001
From: liangxin1300 <XLiang@suse.com>
Date: Mon, 29 Nov 2021 10:48:05 +0800
Subject: [PATCH] OCF: controld: Give warning when no-quorum-policy not set as
 freeze while using DLM

---
 extra/resources/controld | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/extra/resources/controld b/extra/resources/controld
index ed43326df..260ba43e5 100755
--- a/extra/resources/controld
+++ b/extra/resources/controld
@@ -173,6 +173,12 @@ controld_start() {
         return $OCF_ERR_CONFIGURED
     fi
 
+    # If no-quorum-policy not set, or not set as freeze, give a warning
+    crm_attribute --type=crm_config --name=no-quorum-policy --query|grep value=freeze >/dev/null 2>/dev/null
+    if [ $? -ne 0 ]; then
+        ocf_log warn "The DLM cluster best practice suggests to set the cluster property \"no-quorum-policy=freeze\""
+    fi
+
     "${OCF_RESKEY_daemon}" $OCF_RESKEY_args
 
     while true
-- 
2.34.1

openSUSE Build Service is sponsored by