Blame SOURCES/bz1840750-nfsserver-fix-nfsv4-only-support.patch

5c52dd
From 47dd1d16f08de06d512f9e04c3966c35f0ac4d3f Mon Sep 17 00:00:00 2001
5c52dd
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
5c52dd
Date: Wed, 27 May 2020 13:05:57 +0200
5c52dd
Subject: [PATCH] nfsserver: fix NFSv4-only support
5c52dd
5c52dd
When disabling NFSv2 and NFSv3 mountd doesnt register with rpcbind, but
5c52dd
it's still running. This patch checks that mountd is running instead of
5c52dd
basing its status on it being registered w/rpcbind.
5c52dd
---
5c52dd
 heartbeat/nfsserver | 6 +++---
5c52dd
 1 file changed, 3 insertions(+), 3 deletions(-)
5c52dd
5c52dd
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
5c52dd
index acef0147a..9e6e1fcb1 100755
5c52dd
--- a/heartbeat/nfsserver
5c52dd
+++ b/heartbeat/nfsserver
5c52dd
@@ -316,7 +316,7 @@ nfsserver_systemd_monitor()
5c52dd
 	fi
5c52dd
 
5c52dd
 	ocf_log debug "Status: nfs-mountd"
5c52dd
-	rpcinfo -t localhost 100005 > /dev/null 2>&1
5c52dd
+	ps axww | grep -q "[r]pc.mountd"
5c52dd
 	rc=$?
5c52dd
 	if [ "$rc" -ne "0" ]; then
5c52dd
 		ocf_exit_reason "nfs-mountd is not running"
5c52dd
@@ -683,7 +683,7 @@ nfsserver_start ()
5c52dd
 		  local i=1
5c52dd
 		  while : ; do
5c52dd
 			ocf_log info "Start: nfs-mountd i: $i"
5c52dd
-			rpcinfo -t localhost 100005 > /dev/null 2>&1
5c52dd
+			ps axww | grep -q "[r]pc.mountd"
5c52dd
 			rc=$?
5c52dd
 			if [ "$rc" -eq "0" ]; then
5c52dd
 				break;
5c52dd
@@ -800,7 +800,7 @@ nfsserver_stop ()
5c52dd
 
5c52dd
 		  nfs_exec stop nfs-mountd > /dev/null 2>&1
5c52dd
 		  ocf_log info "Stop: nfs-mountd"
5c52dd
-		  rpcinfo -t localhost 100005 > /dev/null 2>&1
5c52dd
+		  ps axww | grep -q "[r]pc.mountd"
5c52dd
 		  rc=$?
5c52dd
 		  if [ "$rc" -eq "0" ]; then
5c52dd
 			ocf_exit_reason "Failed to stop nfs-mountd"