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

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(+)

Index: pacemaker-1.1.18+20180430.b12c320f5/extra/resources/controld
===================================================================
--- pacemaker-1.1.18+20180430.b12c320f5.orig/extra/resources/controld
+++ pacemaker-1.1.18+20180430.b12c320f5/extra/resources/controld
@@ -165,6 +165,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
openSUSE Build Service is sponsored by