Bug 1395062

Summary: NFS server fails to start if any hostnames in /etc/exports are not resolvable
Product: Red Hat Enterprise Linux 7 Reporter: David Shaw <dshaw>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED DUPLICATE QA Contact: ChunYu Wang <chunwang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: chunwang, yoyang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-15 06:31:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description David Shaw 2016-11-15 03:45:06 UTC
Description of problem:

If any of the hostnames in /etc/exports are not resolvable, the NFS server will not start.

Version-Release number of selected component (if applicable):

nfs-utils-1.3.0-0.21.el7_2.x86_64

How reproducible:

Every time.

Steps to Reproduce:
1. Put several entries with valid hostnames and a single entry with an invalid (not found) hostname in /etc/exports.
2. Try and start nfs-server.

Actual results:

nfs-server won't start for any entries.

Expected results:

nfs-server will start, at least for those entries that have valid hostnames.

Additional info:

Obviously, exporting the entry with the not-found hostname isn't going to work.  The unexpected behavior here is that the presence of a single bad entry prevents any number of good entries from getting service.

This seems to be the same thing as bug 1115179, which was fixed in Fedora 20.

Comment 1 ChunYu Wang 2016-11-15 05:52:20 UTC
Hi, Shaw,

I have tracked no reproduction on RHEL-7.3 with nfs-utils-1.3.0-0.31.el7.x86_64

[root@hp-dl360g9-14 ~]# exportfs -arv
exportfs: Failed to resolve notExisted.test.redhat.com
exportfs: Failed to resolve notExisted.test.redhat.com
exporting *:/
[root@hp-dl360g9-14 ~]# echo $?
0
[root@hp-dl360g9-14 ~]# echo $?
0
[root@hp-dl360g9-14 ~]# exportfs -arv
exportfs: Failed to resolve notExisted.test.redhat.com
exportfs: Failed to resolve notExisted.test.redhat.com
exporting *:/
[root@hp-dl360g9-14 ~]# echo $?
0
[root@hp-dl360g9-14 ~]# cat /etc/exports
/ notExisted.test.redhat.com(rw,no_root_squash)
/ *(rw,no_root_squash)

[root@hp-dl360g9-14 ~]# systemctl restart nfs
[root@hp-dl360g9-14 ~]# systemctl status nfs
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: active (exited) since Tue 2016-11-15 00:46:53 EST; 2s ago
  Process: 1237 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 1235 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
 Main PID: 1237 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/nfs-server.service
[root@hp-dl360g9-14 ~]# rpm -qa |grep nfs-utils
nfs-utils-1.3.0-0.31.el7.x86_64

Comment 3 Yongcheng Yang 2016-11-15 06:37:21 UTC
(In reply to David Shaw from comment #0)
> 
> Version-Release number of selected component (if applicable):
> 
> nfs-utils-1.3.0-0.21.el7_2.x86_64
> 

(In reply to ChunYu Wang from comment #1)
> Hi, Shaw,
> 
> I have tracked no reproduction on RHEL-7.3 with
> nfs-utils-1.3.0-0.31.el7.x86_64
> 

This issue has been fixed in Version nfs-utils-1.3.0-0.24.el7 and delivered by RHEL-7.3.

And maybe we can request zstream fix if need it in RHEL-7.2.

Comment 4 David Shaw 2016-11-15 16:14:20 UTC
Ah, very nice.  I haven't upgraded to 7.3 yet, but I'll check this out.  Thanks.