diff --git a/SOURCES/bz2049319-Filesystem-add-support-for-Amazon-EFS.patch b/SOURCES/bz2049319-Filesystem-add-support-for-Amazon-EFS.patch index afdf902..05e7bf1 100644 --- a/SOURCES/bz2049319-Filesystem-add-support-for-Amazon-EFS.patch +++ b/SOURCES/bz2049319-Filesystem-add-support-for-Amazon-EFS.patch @@ -1,7 +1,98 @@ +From cab190c737fdf58268aa5c009f6089b754862b22 Mon Sep 17 00:00:00 2001 +From: Reid Wahl +Date: Tue, 1 Feb 2022 16:32:50 -0800 +Subject: [PATCH 1/3] Filesystem: Fix OpenBSD check in fstype_supported() + +fstype_supported() is supposed to skip the /proc/filesystems check if +the OS is OpenBSD. Instead, it skips the check if the OS is **not** +OpenBSD. That means the function has been a no-op for all other distros. + +Signed-off-by: Reid Wahl +--- + heartbeat/Filesystem | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem +index 010c1dcfc..8b4792152 100755 +--- a/heartbeat/Filesystem ++++ b/heartbeat/Filesystem +@@ -440,7 +440,7 @@ fstype_supported() + local support="$FSTYPE" + local rc + +- if [ "X${HOSTOS}" != "XOpenBSD" ];then ++ if [ "X${HOSTOS}" = "XOpenBSD" ];then + # skip checking /proc/filesystems for obsd + return $OCF_SUCCESS + fi + +From 5d38b87daa9cfffa89a193df131d6ebd87cd05aa Mon Sep 17 00:00:00 2001 +From: Reid Wahl +Date: Tue, 1 Feb 2022 18:26:32 -0800 +Subject: [PATCH 2/3] Filesystem: Improve fstype_supported logs for fuse + +Make it more clear when we have to use a different name to check for +support of a particular filesystem. Currently only used for fuse-type +filesystems. + +Signed-off-by: Reid Wahl +--- + heartbeat/Filesystem | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem +index 8b4792152..4d84846c1 100755 +--- a/heartbeat/Filesystem ++++ b/heartbeat/Filesystem +@@ -455,6 +455,10 @@ fstype_supported() + fuse.*|glusterfs|rozofs) support="fuse";; + esac + ++ if [ "$support" != "$FSTYPE" ]; then ++ ocf_log info "Checking support for $FSTYPE as \"$support\"" ++ fi ++ + grep -w "$support"'$' /proc/filesystems >/dev/null + if [ $? -eq 0 ]; then + # found the fs type +@@ -465,7 +469,7 @@ fstype_supported() + # check the if the filesystem support exists again. + $MODPROBE $support >/dev/null + if [ $? -ne 0 ]; then +- ocf_exit_reason "Couldn't find filesystem $FSTYPE in /proc/filesystems and failed to load kernel module" ++ ocf_exit_reason "Couldn't find filesystem $support in /proc/filesystems and failed to load kernel module" + return $OCF_ERR_INSTALLED + fi + +@@ -478,11 +482,11 @@ fstype_supported() + # yes. found the filesystem after doing the modprobe + return $OCF_SUCCESS + fi +- ocf_log debug "Unable to find support for $FSTYPE in /proc/filesystems after modprobe, trying again" ++ ocf_log debug "Unable to find support for $support in /proc/filesystems after modprobe, trying again" + sleep 1 + done + +- ocf_exit_reason "Couldn't find filesystem $FSTYPE in /proc/filesystems" ++ ocf_exit_reason "Couldn't find filesystem $support in /proc/filesystems" + return $OCF_ERR_INSTALLED + } + +@@ -837,6 +841,9 @@ Filesystem_monitor() + # VALIDATE_ALL: Are the instance parameters valid? + # FIXME!! The only part that's useful is the return code. + # This code always returns $OCF_SUCCESS (!) ++# FIXME!! Needs some tuning to match fstype_supported() (e.g., for ++# fuse). Can we just call fstype_supported() with a flag like ++# "no_modprobe" instead? + # + Filesystem_validate_all() + { + From e2174244067b02d798e0f12437f0f499c80f91fe Mon Sep 17 00:00:00 2001 From: Reid Wahl Date: Tue, 1 Feb 2022 18:55:47 -0800 -Subject: [PATCH] Filesystem: Add support for Amazon EFS mount helper +Subject: [PATCH 3/3] Filesystem: Add support for Amazon EFS mount helper mount.efs, the mount helper for Amazon Elastic File System (EFS) provided by amazon-efs-utils [1], is a wrapper for mount.nfs4. It offers diff --git a/SOURCES/bz2127117-nfsserver-nfsv4_only-parameter.patch b/SOURCES/bz2127117-nfsserver-nfsv4_only-parameter.patch new file mode 100644 index 0000000..9bcbb41 --- /dev/null +++ b/SOURCES/bz2127117-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/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index af90ed8..8ab6c48 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -69,7 +69,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.9.0 -Release: 32%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 34%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} @@ -129,6 +129,7 @@ Patch37: bz1977012-azure-events-az-new-ra.patch Patch38: bz2133682-IPsrcaddr-proto-metric-scope-default-route-fixes.patch Patch39: bz2141836-vdo-vol-dont-fail-probe-action.patch Patch40: bz2049319-Filesystem-add-support-for-Amazon-EFS.patch +Patch41: bz2127117-nfsserver-nfsv4_only-parameter.patch # bundle patches Patch1000: 7-gcp-bundled.patch @@ -348,7 +349,8 @@ exit 1 %patch37 -p1 %patch38 -p1 %patch39 -p1 -%patch40 -p1 -F1 +%patch40 -p1 +%patch41 -p1 chmod 755 heartbeat/nova-compute-wait chmod 755 heartbeat/NovaEvacuate @@ -924,7 +926,13 @@ ccs_update_schema > /dev/null 2>&1 ||: %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog -* Mon Nov 14 2022 Oyvind Albrigtsen - 4.9.0-32 +* Tue Nov 22 2022 Oyvind Albrigtsen - 4.9.0-34 +- nfsserver: add nfsv4_only parameter to make it run without + rpc-statd/rpcbind services + + Resolves: rhbz#2127117 + +* Mon Nov 14 2022 Oyvind Albrigtsen - 4.9.0-33 - Filesystem: add support for Amazon EFS (Elastic File System) - vdo-vol: dont fail probe action when the underlying device doesnt exist