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

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