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

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