From 2418fd58d6880c1d7c271e695bc49610f3f1b1fb Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Tue, 22 Nov 2022 13:19:49 +0100 Subject: [PATCH] - nfsserver: add nfsv4_only parameter to make it run without rpc-statd/rpcbind services - vdo-vol: revert probe-action fix until we have a fix for using new vdo utils Resolves: rhbz#2127121 Reverts: rhbz#2142050 --- ...27121-nfsserver-nfsv4_only-parameter.patch | 298 ++++++++++++++++++ ...42050-vdo-vol-dont-fail-probe-action.patch | 27 -- resource-agents.spec | 15 +- 3 files changed, 307 insertions(+), 33 deletions(-) create mode 100644 bz2127121-nfsserver-nfsv4_only-parameter.patch delete mode 100644 bz2142050-vdo-vol-dont-fail-probe-action.patch diff --git a/bz2127121-nfsserver-nfsv4_only-parameter.patch b/bz2127121-nfsserver-nfsv4_only-parameter.patch new file mode 100644 index 0000000..9bcbb41 --- /dev/null +++ b/bz2127121-nfsserver-nfsv4_only-parameter.patch @@ -0,0 +1,298 @@ +From 764757380af19d3a21d40f3c9624e4135ff074e1 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Wed, 2 Nov 2022 10:26:31 +0100 +Subject: [PATCH] nfsserver: add nfsv4_only parameter to make it run without + rpc-statd/rpcbind services + +--- + heartbeat/nfsserver | 200 +++++++++++++++++++++++++------------------- + 1 file changed, 114 insertions(+), 86 deletions(-) + +diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver +index 9bbd603e5..cb2d43ab1 100755 +--- a/heartbeat/nfsserver ++++ b/heartbeat/nfsserver +@@ -79,6 +79,16 @@ Init script for nfsserver + + + ++ ++ ++Run in NFSv4 only mode (rpc-statd and rpcbind services masked). ++ ++ ++NFSv4 only mode. ++ ++ ++ ++ + + + Do not send reboot notifications to NFSv3 clients during server startup. +@@ -332,7 +342,7 @@ v3locking_exec() + if [ $EXEC_MODE -eq 2 ]; then + nfs_exec $cmd nfs-lock.service + elif [ $EXEC_MODE -eq 3 ]; then +- nfs_exec $cmd rpc-statd.service ++ nfs_exec $cmd rpc-statd.service + else + case $cmd in + start) locking_start;; +@@ -348,20 +358,22 @@ nfsserver_systemd_monitor() + local rc + local fn + +- ocf_log debug "Status: rpcbind" +- rpcinfo > /dev/null 2>&1 +- rc=$? +- if [ "$rc" -ne "0" ]; then +- ocf_exit_reason "rpcbind is not running" +- return $OCF_NOT_RUNNING +- fi ++ if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ ocf_log debug "Status: rpcbind" ++ rpcinfo > /dev/null 2>&1 ++ rc=$? ++ if [ "$rc" -ne "0" ]; then ++ ocf_exit_reason "rpcbind is not running" ++ return $OCF_NOT_RUNNING ++ fi + +- ocf_log debug "Status: nfs-mountd" +- ps axww | grep -q "[r]pc.mountd" +- rc=$? +- if [ "$rc" -ne "0" ]; then +- ocf_exit_reason "nfs-mountd is not running" +- return $OCF_NOT_RUNNING ++ ocf_log debug "Status: nfs-mountd" ++ ps axww | grep -q "[r]pc.mountd" ++ rc=$? ++ if [ "$rc" -ne "0" ]; then ++ ocf_exit_reason "nfs-mountd is not running" ++ return $OCF_NOT_RUNNING ++ fi + fi + + ocf_log debug "Status: nfs-idmapd" +@@ -375,12 +387,14 @@ nfsserver_systemd_monitor() + return $OCF_NOT_RUNNING + fi + +- ocf_log debug "Status: rpc-statd" +- rpcinfo -t localhost 100024 > /dev/null 2>&1 +- rc=$? +- if [ "$rc" -ne "0" ]; then +- ocf_exit_reason "rpc-statd is not running" +- return $OCF_NOT_RUNNING ++ if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ ocf_log debug "Status: rpc-statd" ++ rpcinfo -t localhost 100024 > /dev/null 2>&1 ++ rc=$? ++ if [ "$rc" -ne "0" ]; then ++ ocf_exit_reason "rpc-statd is not running" ++ return $OCF_NOT_RUNNING ++ fi + fi + + nfs_exec is-active nfs-server +@@ -424,7 +438,7 @@ nfsserver_monitor () + if [ $rc -eq 0 ]; then + # don't report success if nfs servers are up + # without locking daemons. +- v3locking_exec "status" ++ ocf_is_true "$OCF_RESKEY_nfsv4_only" || v3locking_exec "status" + rc=$? + if [ $rc -ne 0 ]; then + ocf_exit_reason "NFS server is up, but the locking daemons are down" +@@ -786,48 +800,54 @@ nfsserver_start () + + # systemd + case $EXEC_MODE in +- [23]) nfs_exec start rpcbind +- local i=1 +- while : ; do +- ocf_log info "Start: rpcbind i: $i" +- rpcinfo > /dev/null 2>&1 +- rc=$? +- if [ "$rc" -eq "0" ]; then +- break; +- fi +- sleep 1 +- i=$((i + 1)) +- done ++ [23]) if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ nfs_exec start rpcbind ++ local i=1 ++ while : ; do ++ ocf_log info "Start: rpcbind i: $i" ++ rpcinfo > /dev/null 2>&1 ++ rc=$? ++ if [ "$rc" -eq "0" ]; then ++ break ++ fi ++ sleep 1 ++ i=$((i + 1)) ++ done ++ fi + ;; + esac + +- # check to see if we need to start rpc.statd +- v3locking_exec "status" +- if [ $? -ne $OCF_SUCCESS ]; then +- v3locking_exec "start" +- rc=$? +- if [ $rc -ne 0 ]; then +- ocf_exit_reason "Failed to start NFS server locking daemons" +- return $rc ++ if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ # check to see if we need to start rpc.statd ++ v3locking_exec "status" ++ if [ $? -ne $OCF_SUCCESS ]; then ++ v3locking_exec "start" ++ rc=$? ++ if [ $rc -ne 0 ]; then ++ ocf_exit_reason "Failed to start NFS server locking daemons" ++ return $rc ++ fi ++ else ++ ocf_log info "rpc.statd already up" + fi +- else +- ocf_log info "rpc.statd already up" + fi + + # systemd + case $EXEC_MODE in +- [23]) nfs_exec start nfs-mountd +- local i=1 +- while : ; do +- ocf_log info "Start: nfs-mountd i: $i" +- ps axww | grep -q "[r]pc.mountd" +- rc=$? +- if [ "$rc" -eq "0" ]; then +- break; +- fi +- sleep 1 +- i=$((i + 1)) +- done ++ [23]) if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ nfs_exec start nfs-mountd ++ local i=1 ++ while : ; do ++ ocf_log info "Start: nfs-mountd i: $i" ++ ps axww | grep -q "[r]pc.mountd" ++ rc=$? ++ if [ "$rc" -eq "0" ]; then ++ break ++ fi ++ sleep 1 ++ i=$((i + 1)) ++ done ++ fi + + nfs_exec start nfs-idmapd + local i=1 +@@ -839,24 +859,26 @@ nfsserver_start () + ocf_log debug "$(cat $fn)" + rm -f $fn + if [ "$rc" -eq "0" ]; then +- break; ++ break + fi + sleep 1 + i=$((i + 1)) + done + +- nfs_exec start rpc-statd +- local i=1 +- while : ; do +- ocf_log info "Start: rpc-statd i: $i" +- rpcinfo -t localhost 100024 > /dev/null 2>&1 +- rc=$? +- if [ "$rc" -eq "0" ]; then +- break; +- fi +- sleep 1 +- i=$((i + 1)) +- done ++ if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ nfs_exec start rpc-statd ++ local i=1 ++ while : ; do ++ ocf_log info "Start: rpc-statd i: $i" ++ rpcinfo -t localhost 100024 > /dev/null 2>&1 ++ rc=$? ++ if [ "$rc" -eq "0" ]; then ++ break ++ fi ++ sleep 1 ++ i=$((i + 1)) ++ done ++ fi + esac + + +@@ -914,13 +936,15 @@ nfsserver_stop () + sleep 1 + done + +- nfs_exec stop rpc-statd > /dev/null 2>&1 +- ocf_log info "Stop: rpc-statd" +- rpcinfo -t localhost 100024 > /dev/null 2>&1 +- rc=$? +- if [ "$rc" -eq "0" ]; then +- ocf_exit_reason "Failed to stop rpc-statd" +- return $OCF_ERR_GENERIC ++ if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ nfs_exec stop rpc-statd > /dev/null 2>&1 ++ ocf_log info "Stop: rpc-statd" ++ rpcinfo -t localhost 100024 > /dev/null 2>&1 ++ rc=$? ++ if [ "$rc" -eq "0" ]; then ++ ocf_exit_reason "Failed to stop rpc-statd" ++ return $OCF_ERR_GENERIC ++ fi + fi + + nfs_exec stop nfs-idmapd > /dev/null 2>&1 +@@ -935,13 +959,15 @@ nfsserver_stop () + return $OCF_ERR_GENERIC + fi + +- nfs_exec stop nfs-mountd > /dev/null 2>&1 +- ocf_log info "Stop: nfs-mountd" +- ps axww | grep -q "[r]pc.mountd" +- rc=$? +- if [ "$rc" -eq "0" ]; then +- ocf_exit_reason "Failed to stop nfs-mountd" +- return $OCF_ERR_GENERIC ++ if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ nfs_exec stop nfs-mountd > /dev/null 2>&1 ++ ocf_log info "Stop: nfs-mountd" ++ ps axww | grep -q "[r]pc.mountd" ++ rc=$? ++ if [ "$rc" -eq "0" ]; then ++ ocf_exit_reason "Failed to stop nfs-mountd" ++ return $OCF_ERR_GENERIC ++ fi + fi + + if systemctl --no-legend list-unit-files "nfsdcld*" | grep -q nfsdcld; then +@@ -960,10 +986,12 @@ nfsserver_stop () + esac + + +- v3locking_exec "stop" +- if [ $? -ne 0 ]; then +- ocf_exit_reason "Failed to stop NFS locking daemons" +- rc=$OCF_ERR_GENERIC ++ if ! ocf_is_true "$OCF_RESKEY_nfsv4_only"; then ++ v3locking_exec "stop" ++ if [ $? -ne 0 ]; then ++ ocf_exit_reason "Failed to stop NFS locking daemons" ++ rc=$OCF_ERR_GENERIC ++ fi + fi + + # systemd diff --git a/bz2142050-vdo-vol-dont-fail-probe-action.patch b/bz2142050-vdo-vol-dont-fail-probe-action.patch deleted file mode 100644 index 28c28ce..0000000 --- a/bz2142050-vdo-vol-dont-fail-probe-action.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 739e6ce9096facd6d37dffd524c79c961e3fae38 Mon Sep 17 00:00:00 2001 -From: Oyvind Albrigtsen -Date: Fri, 11 Nov 2022 14:17:39 +0100 -Subject: [PATCH] vdo-vol: dont fail probe action when the underlying device - doesnt exist - ---- - heartbeat/vdo-vol | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/heartbeat/vdo-vol b/heartbeat/vdo-vol -index 94822cb82..29bd7b8fd 100755 ---- a/heartbeat/vdo-vol -+++ b/heartbeat/vdo-vol -@@ -148,6 +148,12 @@ vdo_monitor(){ - MODE=$(vdostats --verbose ${OCF_RESKEY_volume} | grep "operating mode" | awk '{print $NF}') - - case "$status" in -+ *"ERROR - vdodumpconfig: Failed to make FileLayer from"*) -+ if ocf_is_probe; then -+ return $OCF_NOT_RUNNING -+ fi -+ return $OCF_ERR_GENERIC -+ ;; - *"Device mapper status: not available"*) - return $OCF_NOT_RUNNING - ;; diff --git a/resource-agents.spec b/resource-agents.spec index 8414733..c5e2dac 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -45,7 +45,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.10.0 -Release: 26%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 27%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -85,8 +85,8 @@ Patch32: bz2109161-storage_mon-4-fix-possible-false-negatives.patch Patch33: bz2102126-LVM-activate-fix-return-codes.patch Patch34: bz2111147-azure-events-az-new-ra.patch Patch35: bz2134411-IPsrcaddr-proto-metric-scope-default-route-fixes.patch -Patch36: bz2142050-vdo-vol-dont-fail-probe-action.patch -Patch37: bz2142002-Filesystem-add-support-for-Amazon-EFS.patch +Patch36: bz2142002-Filesystem-add-support-for-Amazon-EFS.patch +Patch37: bz2127121-nfsserver-nfsv4_only-parameter.patch # bundled ha-cloud-support libs Patch500: ha-cloud-support-aws.patch @@ -569,13 +569,16 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog +* Tue Nov 22 2022 Oyvind Albrigtsen - 4.10.0-27 +- nfsserver: add nfsv4_only parameter to make it run without + rpc-statd/rpcbind services + + Resolves: rhbz#2127121 + * Mon Nov 14 2022 Oyvind Albrigtsen - 4.10.0-26 - Filesystem: add support for Amazon EFS (Elastic File System) -- vdo-vol: dont fail probe action when the underlying device doesnt - exist Resolves: rhbz#2142002 - Resolves: rhbz#2142050 * Fri Oct 14 2022 Oyvind Albrigtsen - 4.10.0-25 - IPsrcaddr: proto, metric, scope and default route fixes