+2004-08-31 NeilBrown <neilb@cse.unsw.edu.au>
+
+ * debian/nfs-kernel-server.init(start,stop) mount the nfsd
+ filesystem, if available, before starting nfs services, and
+ unmount it afterwards.
+ * etc/nodist/nfs-server: ditto
+ * etc/redhat/nfs.init: likewise
+ * etc/redhat/nfs: add "MOUNT_NFSD" flag to control above.
+
2004-06-08 NeilBrown <neilb@cse.unsw.edu.au>
* utils/exportfs/exportfs.c: Don't rmtab_read if new_cache, it
cd / # daemons should have root dir as cwd
if grep -q '^/' /etc/exports
then
+ # Having the 'nfsd' filesystem mounted (if available)
+ # make client authentication more reliable.
+ if [ -d /proc/fs/nfsd -a ! -f /proc/fs/nfsd/exports ]
+ then mount -t nfsd nfsd /proc/fs/nfsd
+ fi
printf "Exporting directories for $DESC..."
$PREFIX/sbin/exportfs -r
echo "done."
printf "Unexporting directories for $DESC..."
$PREFIX/sbin/exportfs -au
+ if [ -f /proc/fs/nfsd/exports ] ; then umount /proc/fs/nfsd; fi
echo "done."
;;
# Handle how we were called.
case "$1" in
start)
+ if [ -d /proc/fs/nfsd -a ! -f /proc/fs/nfsd/exports ] ;
+ then
+ /bin/mount -t nfsd nfsd /proc/fs/nfsd
+ fi
echo -n "Exporting directories for $DESC..."
$EXPORTFS -r
echo "done."
echo "Unexporting directories for $DESC..."
$EXPORTFS -au
+ if [ -f /proc/fs/nfsd/exports ] ; then /bin/umount -t nfsd nfsd /proc/fs/nfsd ; fi
rm -f /var/lock/subsys/$SCRIPT_NAME
echo "done."
;;
restart)
$0 stop
+ sleep 1
$0 start
;;
# TUNE_QUEUE to yes will set the values to 256kb.
# TUNE_QUEUE="yes"
# NFS_QS=262144
+
+# Mount /proc/fs/nfsd (2.6 kernel only)
+MOUNT_NFSD="yes"
[ -z "$NFS_QS" ] && NFS_QS=262144
fi
+
# See how we were called.
case "$1" in
start)
+ if [ -d /proc/fs/nfsd -a "$MOUNT_NFSD" = "yes" ] ; then
+ /bin/mount -t nfsd nfsd /proc/fs/nfsd
+ fi
# Start daemons.
# Apply input queue increase for nfs server
if [ "$TUNE_QUEUE" = "yes" ]; then
# Do it the last so that clients can still access the server
# when the server is running.
action "Shutting down NFS services: " /usr/sbin/exportfs -au
+ if [ -d /proc/fs/nfsd -a "$MOUNT_NFSD" = "yes" ] ; then
+ /bin/umount /proc/fs/nfsd
+ fi
rm -f /var/lock/subsys/nfs
;;
status)