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

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