Bug 46432

Summary: Empty /etc/exports silences output of nfs init.d script
Product: [Retired] Red Hat Linux Reporter: Joshua Jensen <joshua>
Component: nfs-utilsAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-06-29 20:19:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joshua Jensen 2001-06-28 14:36:09 UTC
/etc/exports as shipped is of zero length.  This causes "service nfs
start|stop|restart|status" to silently exit.  This fix I found for this was:

echo '#' > /etc/exports


A minor bug, but very easily solved.  Next time around, can we add maybe a
commented line or two describing the fuctionality of this file?  Thanks.

Joshua Jensen
joshua

Comment 1 Bill Nottingham 2001-06-28 15:05:59 UTC
Actually, the NFS server script should give a more meaningful error when the
service isn't configured.

Comment 2 Bob Matthews 2001-06-29 20:19:22 UTC
Well, exportfs really will barf if /etc/exports doesn't exist, but I don't see
anything wrong creating a 2-byte dummy file on nfs startup.

How's this look:

--- nfs	Fri Jun 29 16:17:21 2001
+++ nfs.new	Fri Jun 29 16:21:42 2001
@@ -25,7 +25,9 @@
 [ -x /usr/sbin/rpc.nfsd ] || exit 0
 [ -x /usr/sbin/rpc.mountd ] || exit 0
 [ -x /usr/sbin/exportfs ] || exit 0
-[ -s /etc/exports ] || exit 0
+[ -s /etc/exports ] || \
+    { echo "#" >> /etc/exports && chmod u+rw /etc/exports ; } || \
+    { echo "/etc/exports does not exist" ; exit 0 ; }
 
 # Number of servers to be started by default
 RPCNFSDCOUNT=8


> Next time around, can we add maybe a
> commented line or two describing the fuctionality of this file?

man exports(5)

Comment 3 Bob Matthews 2001-08-07 18:57:29 UTC
Changes will appear in next release.