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

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