Blame SOURCES/bz1642027-nfsserver-var-lib-nfs-fix.patch

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