Blame SOURCES/bz2094828-lvmlockd-fail-when-use_lvmlockd-not-set.patch

38c30a
From b3885f7d95fe390371f806c7f3debb3ec8ad012d Mon Sep 17 00:00:00 2001
38c30a
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
38c30a
Date: Tue, 7 Jun 2022 15:20:11 +0200
38c30a
Subject: [PATCH] lvmlockd: fail when use_lvmlockd has not been set
38c30a
38c30a
---
38c30a
 heartbeat/lvmlockd | 5 +++++
38c30a
 1 file changed, 5 insertions(+)
38c30a
38c30a
diff --git a/heartbeat/lvmlockd b/heartbeat/lvmlockd
38c30a
index 05bb0a2e5..dc7bd2d7e 100755
38c30a
--- a/heartbeat/lvmlockd
38c30a
+++ b/heartbeat/lvmlockd
38c30a
@@ -179,6 +179,11 @@ setup_lvm_config()
38c30a
 	out=$(lvmconfig 'global/locking_type' 2> /dev/null)
38c30a
 	lock_type=$(echo "$out" | cut -d'=' -f2)
38c30a
 
38c30a
+	if [ -z "$use_lvmlockd" ]; then
38c30a
+		ocf_exit_reason "\"use_lvmlockd\" not set in /etc/lvm/lvm.conf ..."
38c30a
+		exit $OCF_ERR_CONFIGURED
38c30a
+	fi
38c30a
+
38c30a
 	if [ -n "$use_lvmlockd" ] && [ "$use_lvmlockd" != 1 ] ; then
38c30a
 		ocf_log info "setting \"use_lvmlockd=1\" in /etc/lvm/lvm.conf ..."
38c30a
 		sed -i 's,^[[:blank:]]*use_lvmlockd[[:blank:]]*=.*,\ \ \ \ use_lvmlockd = 1,g' /etc/lvm/lvm.conf