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

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