Blame SOURCES/nfs-utils-1.2.9-exportfs-badentries.patch

64c563
diff --git a/support/export/client.c b/support/export/client.c
64c563
index dbf47b9..0f7b4fe 100644
64c563
--- a/support/export/client.c
64c563
+++ b/support/export/client.c
64c563
@@ -277,7 +277,7 @@ client_lookup(char *hname, int canonical)
64c563
 	if (htype == MCL_FQDN && !canonical) {
64c563
 		ai = host_addrinfo(hname);
64c563
 		if (!ai) {
64c563
-			xlog(L_ERROR, "Failed to resolve %s", hname);
64c563
+			xlog(L_WARNING, "Failed to resolve %s", hname);
64c563
 			goto out;
64c563
 		}
64c563
 		hname = ai->ai_canonname;
64c563
diff --git a/support/export/export.c b/support/export/export.c
64c563
index 6b1d045..ce714d4 100644
64c563
--- a/support/export/export.c
64c563
+++ b/support/export/export.c
64c563
@@ -76,15 +76,22 @@ export_read(char *fname)
64c563
 	struct exportent	*eep;
64c563
 	nfs_export		*exp;
64c563
 
64c563
+	int volumes = 0;
64c563
+
64c563
 	setexportent(fname, "r");
64c563
 	while ((eep = getexportent(0,1)) != NULL) {
64c563
 		exp = export_lookup(eep->e_hostname, eep->e_path, 0);
64c563
-		if (!exp)
64c563
-			export_create(eep, 0);
64c563
+		if (!exp) {
64c563
+			exp = export_create(eep, 0);
64c563
+			if (exp)
64c563
+				volumes++;
64c563
+		}
64c563
 		else
64c563
 			warn_duplicated_exports(exp, eep);
64c563
 	}
64c563
 	endexportent();
64c563
+	if (volumes == 0)
64c563
+		xlog(L_ERROR, "No file systems exported!");
64c563
 }
64c563
 
64c563
 /**
64c563
diff --git a/support/export/hostname.c b/support/export/hostname.c
64c563
index 5f31aee..cdf9e76 100644
64c563
--- a/support/export/hostname.c
64c563
+++ b/support/export/hostname.c
64c563
@@ -137,11 +137,11 @@ host_pton(const char *paddr)
64c563
 	case EAI_NONAME:
64c563
 		break;
64c563
 	case EAI_SYSTEM:
64c563
-		xlog(D_GENERAL, "%s: failed to convert %s: (%d) %m",
64c563
+		xlog(L_WARNING, "%s: failed to convert %s: (%d) %m",
64c563
 				__func__, paddr, errno);
64c563
 		break;
64c563
 	default:
64c563
-		xlog(D_GENERAL, "%s: failed to convert %s: %s",
64c563
+		xlog(L_WARNING, "%s: failed to convert %s: %s",
64c563
 				__func__, paddr, gai_strerror(error));
64c563
 		break;
64c563
 	}
64c563
@@ -179,11 +179,11 @@ host_addrinfo(const char *hostname)
64c563
 	case 0:
64c563
 		return ai;
64c563
 	case EAI_SYSTEM:
64c563
-		xlog(D_GENERAL, "%s: failed to resolve %s: (%d) %m",
64c563
+		xlog(D_PARSE, "%s: failed to resolve %s: (%d) %m",
64c563
 				__func__, hostname, errno);
64c563
 		break;
64c563
 	default:
64c563
-		xlog(D_GENERAL, "%s: failed to resolve %s: %s",
64c563
+		xlog(D_PARSE, "%s: failed to resolve %s: %s",
64c563
 				__func__, hostname, gai_strerror(error));
64c563
 		break;
64c563
 	}
64c563
diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service
64c563
index f0e456a..7f60f39 100644
64c563
--- a/systemd/nfs-server.service
64c563
+++ b/systemd/nfs-server.service
64c563
@@ -23,13 +23,13 @@ EnvironmentFile=-/run/sysconfig/nfs-utils
64c563
 
64c563
 Type=oneshot
64c563
 RemainAfterExit=yes
64c563
-ExecStartPre=/usr/sbin/exportfs -r
64c563
+ExecStartPre=-/usr/sbin/exportfs -r
64c563
 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS
64c563
 ExecStop=/usr/sbin/rpc.nfsd 0
64c563
 ExecStopPost=/usr/sbin/exportfs -au
64c563
 ExecStopPost=/usr/sbin/exportfs -f
64c563
 
64c563
-ExecReload=/usr/sbin/exportfs -r
64c563
+ExecReload=-/usr/sbin/exportfs -r
64c563
 
64c563
 [Install]
64c563
 WantedBy=multi-user.target