]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mount nfsd filesystem at startup, and unmount afterwards
authorneilbrown <neilbrown>
Tue, 31 Aug 2004 06:21:31 +0000 (06:21 +0000)
committerneilbrown <neilbrown>
Tue, 31 Aug 2004 06:21:31 +0000 (06:21 +0000)
ChangeLog
debian/nfs-kernel-server.init
etc/nodist/nfs-server
etc/redhat/nfs
etc/redhat/nfs.init

index f7ec2da1e5aff83b5e07ad070bab3d4490dafe5e..0ebb3d8e008f3145a51dc519bc8685d828cd96b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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
index 0894f2038be86bcd0b17939b8f9503eb36621600..e80026777b279646d84654fd3bfa06f3bb3caf62 100755 (executable)
@@ -35,6 +35,11 @@ case "$1" in
        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."
@@ -80,6 +85,7 @@ case "$1" in
 
        printf "Unexporting directories for $DESC..."
        $PREFIX/sbin/exportfs -au
+       if [ -f /proc/fs/nfsd/exports ] ; then umount /proc/fs/nfsd; fi
        echo "done."
        ;;
 
index 8f1d34b63aad3a6a94db86bbb674a665ef7cb3b8..f1648842da6b6986dcc9517a1926cd9286ae6f67 100755 (executable)
@@ -46,6 +46,10 @@ DESC="NFS kernel daemon"
 # 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."
@@ -97,12 +101,14 @@ stop)
 
     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
     ;;
 
index 5e21f1f7ccbb8a3999d1d278f1ab18f9185f2159..2ace4cdbfaf68ef4c41fbe8ec27c458043ffdeb1 100644 (file)
@@ -29,3 +29,6 @@
 # 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"
index ac459379802faa22e38fbe3a7ee50a8fd5fadc2e..1ac42136092028f43a6fe3adc9e8ca70ff639452 100755 (executable)
@@ -50,9 +50,13 @@ if [ "$TUNE_QUEUE" = "yes" ]; then
     [ -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
@@ -144,6 +148,9 @@ case "$1" in
        # 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)