diff --git a/LVM_OCF_CHECK_LEVEL.patch b/LVM_OCF_CHECK_LEVEL.patch new file mode 100644 index 0000000000000000000000000000000000000000..5a0f9996a6c9f83c76a5ad0c72d15e2921632fc6 --- /dev/null +++ b/LVM_OCF_CHECK_LEVEL.patch @@ -0,0 +1,33 @@ +diff --git a/heartbeat/LVM b/heartbeat/LVM +index d3cd1a1..0678b15 100755 +--- a/heartbeat/LVM ++++ b/heartbeat/LVM +@@ -187,6 +187,28 @@ LVM_status() { + fi + fi + ++ case "$OCF_CHECK_LEVEL" in ++ 0) ++ ;; ++ 10) ++ # if there are many lv in vg dir, pick the first name ++ dm_name="/dev/$1/$(ls -1 /dev/$1 | head -n 1)" ++ ++ # read 1 byte to check the dev is alive ++ dd if=${dm_name} of=/dev/null bs=1 count=1 >/dev/null \ ++ 2>&1 ++ if [ $? -ne 0 ]; then ++ return $OCF_NOT_RUNNING ++ else ++ return $OCF_SUCCESS ++ fi ++ ;; ++ *) ++ ocf_exit_reason "unsupported monitor level $OCF_CHECK_LEVEL" ++ return $OCF_ERR_CONFIGURED ++ ;; ++ esac ++ + if [ $rc -ne 0 ]; then + ocf_log $loglevel "LVM Volume $1 is not available (stopped)" + rc=$OCF_NOT_RUNNING diff --git a/resource-agents.spec b/resource-agents.spec index 9cafd437c55cbb0977fe4eb32402899dc1022c1c..e7d8f6bf722b4c32fae453bd16043a1ac9f5bd21 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,10 +1,11 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.2.0 -Release: 3 +Release: 4 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: https://github.com/ClusterLabs/resource-agents/archive/v4.2.0.tar.gz +Patch0: LVM_OCF_CHECK_LEVEL.patch Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel @@ -100,6 +101,9 @@ export CFLAGS="$(echo '%{optflags}')" %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %changelog +* Wed Jul 20 2022 Bixiaoyan - 4.2.0-4 +- Add LVM_OCF_CHECK_LEVEL.patch + * Tue Oct 27 2020 Anan Fu - 4.2.0-3 - disable python2