Blame SOURCES/bz1845581-nfsserver-dont-log-error-message-file-doesnt-exist.patch

d42a06
From 314eadcd683551bd79b644de05cbf0e425c84f83 Mon Sep 17 00:00:00 2001
d42a06
From: Kazunori INOUE <kazunori_inoue@newson.co.jp>
d42a06
Date: Tue, 9 Jun 2020 13:30:32 +0000
d42a06
Subject: [PATCH] nfsserver: prevent error messages when /etc/sysconfig/nfs
d42a06
 does not exist
d42a06
d42a06
---
d42a06
 heartbeat/nfsserver-redhat.sh | 10 ++++++----
d42a06
 1 file changed, 6 insertions(+), 4 deletions(-)
d42a06
d42a06
diff --git a/heartbeat/nfsserver-redhat.sh b/heartbeat/nfsserver-redhat.sh
d42a06
index cef0862ee..73a70c186 100644
d42a06
--- a/heartbeat/nfsserver-redhat.sh
d42a06
+++ b/heartbeat/nfsserver-redhat.sh
d42a06
@@ -150,10 +150,12 @@ set_env_args()
d42a06
 
d42a06
 	# override local nfs config. preserve previous local config though.
d42a06
 	if [ -s $tmpconfig ]; then
d42a06
-		cat $NFS_SYSCONFIG | grep -q -e "$NFS_SYSCONFIG_AUTOGEN_TAG" > /dev/null 2>&1 
d42a06
-		if [ $? -ne 0 ]; then
d42a06
-			# backup local nfs config if it doesn't have our HA autogen tag in it.
d42a06
-			mv -f $NFS_SYSCONFIG $NFS_SYSCONFIG_LOCAL_BACKUP
d42a06
+		if [ -f "$NFS_SYSCONFIG" ]; then
d42a06
+			cat $NFS_SYSCONFIG | grep -q -e "$NFS_SYSCONFIG_AUTOGEN_TAG" > /dev/null 2>&1
d42a06
+			if [ $? -ne 0 ]; then
d42a06
+				# backup local nfs config if it doesn't have our HA autogen tag in it.
d42a06
+				mv -f $NFS_SYSCONFIG $NFS_SYSCONFIG_LOCAL_BACKUP
d42a06
+			fi
d42a06
 		fi
d42a06
 
d42a06
 		cat $tmpconfig | grep -q -e "$NFS_SYSCONFIG_AUTOGEN_TAG" > /dev/null 2>&1