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

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