Bug 46432 - Empty /etc/exports silences output of nfs init.d script
Empty /etc/exports silences output of nfs init.d script
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: nfs-utils (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Pete Zaitcev
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-06-28 10:36 EDT by Joshua Jensen
Modified: 2007-04-18 12:34 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-06-29 16:19:26 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua Jensen 2001-06-28 10:36:09 EDT
/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@redhat.com
Comment 1 Bill Nottingham 2001-06-28 11:05:59 EDT
Actually, the NFS server script should give a more meaningful error when the
service isn't configured.
Comment 2 Bob Matthews 2001-06-29 16:19:22 EDT
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 14:57:29 EDT
Changes will appear in next release.

Note You need to log in before you can comment on or make changes to this bug.