Blame SOURCES/bz1637823-2-nfsserver-var-lib-nfs-fix.patch

d9e727
diff -uNr a/heartbeat/nfsserver b/heartbeat/nfsserver
d9e727
--- a/heartbeat/nfsserver	2018-10-10 17:02:47.873199077 +0200
d9e727
+++ b/heartbeat/nfsserver	2018-10-11 15:24:41.782048475 +0200
d9e727
@@ -402,7 +402,6 @@
d9e727
 		return
d9e727
 	fi
d9e727
 
d9e727
-	[ -d "$fp" ] || mkdir -p $fp
d9e727
 	[ -d "$OCF_RESKEY_rpcpipefs_dir" ] || mkdir -p $OCF_RESKEY_rpcpipefs_dir
d9e727
 	[ -d "$fp/v4recovery" ] || mkdir -p $fp/v4recovery
d9e727
 
d9e727
@@ -437,10 +436,21 @@
d9e727
 		return
d9e727
 	fi
d9e727
 
d9e727
+	[ -d "$fp" ] || mkdir -p $fp
d9e727
+
d9e727
 	if is_bound /var/lib/nfs; then
d9e727
 		ocf_log debug "$fp is already bound to /var/lib/nfs"
d9e727
 		return 0
d9e727
 	fi
d9e727
+
d9e727
+	case $EXEC_MODE in
d9e727
+	  [23]) if nfs_exec status var-lib-nfs-rpc_pipefs.mount > /dev/null 2>&1; then
d9e727
+			ocf_log debug "/var/lib/nfs/rpc_pipefs already mounted. Unmounting in preparation to bind mount nfs dir"
d9e727
+			systemctl stop var-lib-nfs-rpc_pipefs.mount
d9e727
+		fi
d9e727
+		;;
d9e727
+	esac
d9e727
+
d9e727
 	mount --bind $fp /var/lib/nfs
d9e727
 	[ $SELINUX_ENABLED -eq 0 ] && restorecon /var/lib/nfs
d9e727
 }
d9e727
@@ -612,8 +622,8 @@
d9e727
 	fi
d9e727
 
d9e727
 	is_redhat_based && set_env_args
d9e727
-	prepare_directory
d9e727
 	bind_tree
d9e727
+	prepare_directory
d9e727
 
d9e727
 	if ! `mount | grep -q " on $OCF_RESKEY_rpcpipefs_dir "`; then
d9e727
 		mount -t rpc_pipefs sunrpc $OCF_RESKEY_rpcpipefs_dir