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

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