Messages in this thread | | | Date | Tue, 17 Nov 1998 20:10:32 -0500 (EST) | From | "Steven N. Hirsch" <> | Subject | Re: Upon rebooting knfsd server: nfs_revalidate_inode fails. |
| |
On Tue, 17 Nov 1998, David Woodhouse wrote:
> I'm still having problems with knfsd when the server is rebooted. > > We use NFS because it's supposed to be stateless - previously (with unfsd) you > could reboot the server and it would just keep working. > > By adding explicit entries for each host on our local net to /etc/exports, > I've made sure that clients don't get 'permission denied' because of the dodgy > wildcard handling. Not ideal, but it works. > > Unfortunately, we still need to restart most of the NFS clients, as they > complain of invalid nfs filehandles.
David,
I used to see this all the time, but HJ's patches and utilities have banished the ill behavior. One thing to try, though. I found it necessary to export the mount points _after_ all the other knfsd components are started. When I ran with the rc script as HJ provides it, the export operation would occur without incident, only to "disappear" several minutes into system operation! I'm attaching the (slightly modified) version of rc.nfs which works for me.
Sometimes, the /var/lib/nfs/* files get so out-of-sync that you're better off blowing them all away and restarting the subsystem. But, again, it's been quite some time since I've wrestled with such problems.
Steve
#!/bin/sh # # nfsd This is a sample rc file for knfsd when using sysvinit # as found in Red Hat/Caldera. # Adapt as required when using a different init program. # This was plagiarized from MvS's init script for unfsd. # # chkconfig: 345 60 20 # description: NFS is a popular protocol for file sharing across TCP/IP \ # networks. This service provides NFS server functionality, \ # which is configured via the /etc/exports file. # probe: true
# Source function library. . /etc/rc.d/init.d/functions
# Source networking configuration. if [ ! -f /etc/sysconfig/network ]; then exit 0 fi
. /etc/sysconfig/network
# Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0
[ -f /etc/exports ] || exit 0
case `uname -r` in 0.*|1.*|2.0.*) KNFSD=no ;; *) if [ -f /usr/sbin/rpc.knfsd \ -a -f /usr/sbin/rpc.kmountd \ -a -f /usr/sbin/rpc.kstatd \ -a -f /usr/sbin/kexportfs ]; then KNFSD=yes else KNFSD=no fi ;; esac
if [ $KNFSD = yes ]; then RPCNFSD=rpc.knfsd NFSD=nfsd LOCKD=lockd RPCNFSDCOUNT=4 # No NFS V3. RPCMOUNTD_OPTS="--no-nfs-version 3" RPCMOUNTD=rpc.kmountd RPCSTATD=rpc.kstatd KSTOPSIGNAL=-9 else [ -f /usr/sbin/rpc.nfsd ] || exit 0 [ -f /usr/sbin/rpc.mountd ] || exit 0 [ -f /usr/sbin/exportfs ] || exit 0 RPCNFSD=rpc.nfsd RPCMOUNTD=rpc.mountd fi
# See how we were called. case "$1" in start) # Start daemons. echo -n "Starting NFS services: " if [ $KNFSD = yes ]; then daemon $RPCSTATD fi daemon $RPCMOUNTD $RPCMOUNTD_OPTS daemon $RPCNFSD $RPCNFSDCOUNT if [ $KNFSD = yes ]; then /usr/sbin/kexportfs -rv fi echo touch /var/lock/subsys/nfs ;; stop) # Stop daemons. echo -n "Shutting down NFS services: " if [ $KNFSD = yes ]; then /usr/sbin/kexportfs -ua killproc $NFSD $KSTOPSIGNAL # killproc $LOCKD $KSTOPSIGNAL # killproc $RPCSTATD -15 else killproc $RPCNFSD fi killproc $RPCMOUNTD -15 echo rm -f /var/lock/subsys/nfs ;; status) status $RPCMOUNTD if [ $KNFSD = yes ]; then status $NFSD status $LOCKD else status $RPCNFSD fi ;; restart) echo -n "Restarting NFS services: " echo -n "$RPCMOUNTD " killall -HUP $RPCMOUNTD if [ $KNFSD = yes ]; then daemon $RPCMOUNTD $RPCMOUNTD_OPTS echo -n "$RPCSTATD" killall -HUP $RPCSTATD daemon $RPCSTATD /usr/sbin/kexportfs -r else echo -n "$RPCNFSD " killall -HUP $RPCNFSD fi touch /var/lock/subsys/nfs echo "done." ;; reload) if [ $KNFSD = yes ]; then /usr/sbin/kexportfs -r else /usr/sbin/exportfs fi touch /var/lock/subsys/nfs ;; probe) if [ ! -f /var/lock/subsys/nfs ] ; then echo start; exit 0 fi /sbin/pidof $RPCMOUNTD >/dev/null 2>&1; MOUNTDs="$?" /sbin/pidof $NFSD >/dev/null 2>&1; NFSDs="$?" if [ $MOUNTDs = 1 -o $NFSDs = 1 ] ; then echo restart; exit 0 fi if [ /etc/exports -nt /var/lock/subsys/nfs ] ; then echo reload; exit 0 fi ;; *) echo "Usage: nfs {start|stop|status|restart|reload}" exit 1 esac
exit 0
| |