Blame SOURCES/bz1818997-nfsserver-2-stop-nfsdcld-if-present.patch

8d2604
From 290741f43ff414630f558ee3432e830e39d1599d Mon Sep 17 00:00:00 2001
8d2604
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
8d2604
Date: Wed, 22 Jul 2020 11:56:32 +0200
8d2604
Subject: [PATCH] nfsserver: stop nfsdcld if present during stop-action
8d2604
8d2604
---
8d2604
 heartbeat/nfsserver | 14 ++++++++++++++
8d2604
 1 file changed, 14 insertions(+)
8d2604
8d2604
diff --git a/heartbeat/nfsserver b/heartbeat/nfsserver
8d2604
index 9e6e1fcb1..0dbc173f3 100755
8d2604
--- a/heartbeat/nfsserver
8d2604
+++ b/heartbeat/nfsserver
8d2604
@@ -806,6 +806,20 @@ nfsserver_stop ()
8d2604
 			ocf_exit_reason "Failed to stop nfs-mountd"
8d2604
 			return $OCF_ERR_GENERIC
8d2604
 		  fi
8d2604
+
8d2604
+		  if systemctl --no-legend list-unit-files "nfsdcld*" | grep -q nfsdcld; then
8d2604
+		  	nfs_exec stop nfsdcld > /dev/null 2>&1
8d2604
+		  	ocf_log info "Stop: nfsdcld"
8d2604
+		  	fn=`mktemp`
8d2604
+		  	nfs_exec status nfsdcld > $fn 2>&1
8d2604
+		  	rc=$?
8d2604
+		  	ocf_log debug "$(cat $fn)"
8d2604
+		  	rm -f $fn
8d2604
+		  	if [ "$rc" -eq "0" ]; then
8d2604
+		  		ocf_exit_reason "Failed to stop nfsdcld"
8d2604
+		  		return $OCF_ERR_GENERIC
8d2604
+		  	fi
8d2604
+		  fi
8d2604
 	esac
8d2604
 
8d2604