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

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