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

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