diff options
author | Henrique Martins <linux@martins.cc> | 2014-11-04 15:12:16 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-11-04 15:13:37 -0500 |
commit | 076dd803330d93819c6e7862f515a8fa3997a83b (patch) | |
tree | 5dbe24b9537958c8b8d09ae906050691d02a109d | |
parent | 7afda720e48d774ccc02c7e6b97f05882bba3d06 (diff) | |
download | nfs-utils-076dd803330d93819c6e7862f515a8fa3997a83b.tar.gz nfs-utils-076dd803330d93819c6e7862f515a8fa3997a83b.tar.xz nfs-utils-076dd803330d93819c6e7862f515a8fa3997a83b.zip |
exportfs: changes handling of unresolvable entries
The patch to nfs/exportfs to allow nfsd to start when
there are some, but not all, unresolvable entries in
/etc/exports.
Signed-off-by: Henrique Martins <linux@martins.cc>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | support/export/client.c | 2 | ||||
-rw-r--r-- | support/export/export.c | 11 | ||||
-rw-r--r-- | support/export/hostname.c | 4 |
3 files changed, 12 insertions, 5 deletions
diff --git a/support/export/client.c b/support/export/client.c index f85e11c..95156f0 100644 --- a/support/export/client.c +++ b/support/export/client.c @@ -277,7 +277,7 @@ client_lookup(char *hname, int canonical) if (htype == MCL_FQDN && !canonical) { ai = host_addrinfo(hname); if (!ai) { - xlog(L_ERROR, "Failed to resolve %s", hname); + xlog(L_WARNING, "Failed to resolve %s", hname); goto out; } hname = ai->ai_canonname; diff --git a/support/export/export.c b/support/export/export.c index 6b1d045..ce714d4 100644 --- a/support/export/export.c +++ b/support/export/export.c @@ -76,15 +76,22 @@ export_read(char *fname) struct exportent *eep; nfs_export *exp; + int volumes = 0; + setexportent(fname, "r"); while ((eep = getexportent(0,1)) != NULL) { exp = export_lookup(eep->e_hostname, eep->e_path, 0); - if (!exp) - export_create(eep, 0); + if (!exp) { + exp = export_create(eep, 0); + if (exp) + volumes++; + } else warn_duplicated_exports(exp, eep); } endexportent(); + if (volumes == 0) + xlog(L_ERROR, "No file systems exported!"); } /** diff --git a/support/export/hostname.c b/support/export/hostname.c index d9153e1..169baa5 100644 --- a/support/export/hostname.c +++ b/support/export/hostname.c @@ -177,11 +177,11 @@ host_addrinfo(const char *hostname) case 0: return ai; case EAI_SYSTEM: - xlog(D_GENERAL, "%s: failed to resolve %s: (%d) %m", + xlog(D_PARSE, "%s: failed to resolve %s: (%d) %m", __func__, hostname, errno); break; default: - xlog(D_GENERAL, "%s: failed to resolve %s: %s", + xlog(D_PARSE, "%s: failed to resolve %s: %s", __func__, hostname, gai_strerror(error)); break; } |