Bug 46432 - Empty /etc/exports silences output of nfs init.d script
Summary: Empty /etc/exports silences output of nfs init.d script
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: nfs-utils   
(Show other bugs)
Version: 7.1
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Pete Zaitcev
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-06-28 14:36 UTC by Joshua Jensen
Modified: 2007-04-18 16:34 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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@redhat.com

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.


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