* Lock recovery doesn't work in debian statd/lockd ordering
@ 2002-09-12 2:19 Neil Brown
2002-09-12 4:00 ` Adrian Phillips
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Neil Brown @ 2002-09-12 2:19 UTC (permalink / raw)
To: Chip Salzenberg; +Cc: nfs
Hi Chip and NFSers.
I just noticed that lock recovery doesn't work with a Debian NFS
server.
i.e. server shuts down, restarts, and the client *Doesn't* reclaim
the locks.
The problem is that statd starts before lockd.
What happens is that:
statd starts
it moves everything from /var/lib/nfs/sm to /var/lib/nfs/sm.bak
it notifies each host listed in /var/lib/nfs/sm.bak that the
server has restarted
statd on the client gets the notification and tells it's local
lockd to reclaim locks.
lockd on client asked portmap on server for port number for lockd,
but lockd hasn't started on the server so there isn't one. So
lockd on the client gives up (maybe it should persist, I'm not
sure).
Finally lockd on the server starts, but it is too late.
I fixed this for myself by moving /etc/rc2.d/S19nfs-common to S21 so
that it starts after nfsd and lockd which are started in
S20nfs-kernel-server.
There should be no problem with statd starting after lockd and lockd
doesn't try to talk to statd until it gets the first lock request.
NeilBrown
-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lock recovery doesn't work in debian statd/lockd ordering
2002-09-12 2:19 Lock recovery doesn't work in debian statd/lockd ordering Neil Brown
@ 2002-09-12 4:00 ` Adrian Phillips
2002-09-12 4:49 ` Neil Brown
2002-09-13 19:22 ` Philippe Troin
2002-09-15 21:44 ` Chip Salzenberg
2 siblings, 1 reply; 7+ messages in thread
From: Adrian Phillips @ 2002-09-12 4:00 UTC (permalink / raw)
To: nfs
>>>>> "Neil" == Neil Brown <neilb@cse.unsw.edu.au> writes:
Neil> I just noticed that lock recovery doesn't work with a
Neil> Debian NFS server. i.e. server shuts down, restarts, and
Neil> the client *Doesn't* reclaim the locks.
Um, which version ? On my woody box lockd is started in nfs-common
after statd still though :-
#!/bin/sh
#
# nfs-common This shell script takes care of starting and stopping
# common daemons required for NFS clients and servers.
#
# chkconfig: 345 20 80
# description: NFS is a popular protocol for file sharing across \
# TCP/IP networks. This service provides NFS file \
# locking functionality.
#
PREFIX=
NEED_LOCKD=yes
if test -f /proc/ksyms
then
# We need to be conservative and run lockd,
# unless we can prove that it isn't required.
grep -q lockdctl /proc/ksyms || NEED_LOCKD=no
fi
[ -x $PREFIX/sbin/rpc.statd ] || exit 0
[ -x $PREFIX/sbin/rpc.lockd ] || [ "$NEED_LOCKD" = no ] || exit 0
# What is this?
DESC="NFS common utilities"
# See how we were called.
case "$1" in
start)
cd / # daemons should have root dir as cwd
printf "Starting $DESC:"
printf " statd"
start-stop-daemon --start --quiet \
--exec $PREFIX/sbin/rpc.statd
if [ "$NEED_LOCKD" = yes ]
then
printf " lockd"
start-stop-daemon --start --quiet \
--exec $PREFIX/sbin/rpc.lockd
fi
echo "."
;;
stop)
printf "Stopping $DESC:"
if [ "$NEED_LOCKD" = yes ]
then
printf " lockd"
start-stop-daemon --stop --oknodo --quiet \
--exec $PREFIX/sbin/rpc.lockd
fi
printf " statd"
start-stop-daemon --stop --oknodo --quiet \
--exec $PREFIX/sbin/rpc.statd
echo "."
;;
restart | force-reload)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: nfs-common {start|stop|restart}"
exit 1
;;
esac
exit 0
Sincerely,
Adrian Phillips
--
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now? [OK]
-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lock recovery doesn't work in debian statd/lockd ordering
2002-09-12 4:00 ` Adrian Phillips
@ 2002-09-12 4:49 ` Neil Brown
2002-09-13 16:37 ` H. J. Lu
0 siblings, 1 reply; 7+ messages in thread
From: Neil Brown @ 2002-09-12 4:49 UTC (permalink / raw)
To: Adrian Phillips; +Cc: nfs
On September 12, a.phillips@met.no wrote:
> >>>>> "Neil" == Neil Brown <neilb@cse.unsw.edu.au> writes:
>
> Neil> I just noticed that lock recovery doesn't work with a
> Neil> Debian NFS server. i.e. server shuts down, restarts, and
> Neil> the client *Doesn't* reclaim the locks.
>
> Um, which version ? On my woody box lockd is started in nfs-common
> after statd still though :-
/sbin/rpc.lockd is an aberation that only applies to a small range of
kernels, about 2.2.14 to 2.2.17 I think.
In all other kernels, lockd is started on demand, either when nfsd
starts or when an nfs filesystem is mounted (without -o nolocks).
NeilBrown
-------------------------------------------------------
In remembrance
www.osdn.com/911/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lock recovery doesn't work in debian statd/lockd ordering
2002-09-12 4:49 ` Neil Brown
@ 2002-09-13 16:37 ` H. J. Lu
0 siblings, 0 replies; 7+ messages in thread
From: H. J. Lu @ 2002-09-13 16:37 UTC (permalink / raw)
To: Neil Brown; +Cc: Adrian Phillips, nfs
On Thu, Sep 12, 2002 at 02:49:27PM +1000, Neil Brown wrote:
> On September 12, a.phillips@met.no wrote:
> > >>>>> "Neil" == Neil Brown <neilb@cse.unsw.edu.au> writes:
> >
> > Neil> I just noticed that lock recovery doesn't work with a
> > Neil> Debian NFS server. i.e. server shuts down, restarts, and
> > Neil> the client *Doesn't* reclaim the locks.
> >
> > Um, which version ? On my woody box lockd is started in nfs-common
> > after statd still though :-
>
> /sbin/rpc.lockd is an aberation that only applies to a small range of
> kernels, about 2.2.14 to 2.2.17 I think.
>
Just for the record, I have a need to run the nlockmgr service at a
fixed port. I have
nlockmgr 3003/tcp
nlockmgr 3003/udp
in my /etc/services. But I have to hard code it in my kernel. No, I
don't use kernel modules. It will be nice to for rpc.lockd to passes
the port number to kernel. It doesn't have to start lockd.
H.J.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lock recovery doesn't work in debian statd/lockd ordering
2002-09-12 2:19 Lock recovery doesn't work in debian statd/lockd ordering Neil Brown
2002-09-12 4:00 ` Adrian Phillips
@ 2002-09-13 19:22 ` Philippe Troin
2002-09-15 21:44 ` Chip Salzenberg
2 siblings, 0 replies; 7+ messages in thread
From: Philippe Troin @ 2002-09-13 19:22 UTC (permalink / raw)
To: Neil Brown; +Cc: Chip Salzenberg, nfs
Neil Brown <neilb@cse.unsw.edu.au> writes:
> Hi Chip and NFSers.
>
> I just noticed that lock recovery doesn't work with a Debian NFS
> server.
> i.e. server shuts down, restarts, and the client *Doesn't* reclaim
> the locks.
>
> The problem is that statd starts before lockd.
>
> What happens is that:
> statd starts
> it moves everything from /var/lib/nfs/sm to /var/lib/nfs/sm.bak
> it notifies each host listed in /var/lib/nfs/sm.bak that the
> server has restarted
> statd on the client gets the notification and tells it's local
> lockd to reclaim locks.
> lockd on client asked portmap on server for port number for lockd,
> but lockd hasn't started on the server so there isn't one. So
> lockd on the client gives up (maybe it should persist, I'm not
> sure).
> Finally lockd on the server starts, but it is too late.
>
>
> I fixed this for myself by moving /etc/rc2.d/S19nfs-common to S21 so
> that it starts after nfsd and lockd which are started in
> S20nfs-kernel-server.
>
> There should be no problem with statd starting after lockd and lockd
> doesn't try to talk to statd until it gets the first lock request.
I've opened a debian bug (# 160800) about this.
-> http://bugs.debian.org/160800
Phil.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Lock recovery doesn't work in debian statd/lockd ordering
2002-09-12 2:19 Lock recovery doesn't work in debian statd/lockd ordering Neil Brown
2002-09-12 4:00 ` Adrian Phillips
2002-09-13 19:22 ` Philippe Troin
@ 2002-09-15 21:44 ` Chip Salzenberg
2002-09-16 1:31 ` unsubcribe Will Stowe
2 siblings, 1 reply; 7+ messages in thread
From: Chip Salzenberg @ 2002-09-15 21:44 UTC (permalink / raw)
To: Neil Brown; +Cc: nfs
Since Neil is the bug reporter and no one has disagreed with his
analysis, I'm making the change he recommends for Debian unstable.
If it proves OK, I'll issue a fix for Debian stable.
--
Chip Salzenberg - a.k.a. - <chip@pobox.com>
"It furthers one to have somewhere to go."
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 7+ messages in thread
* unsubcribe
2002-09-15 21:44 ` Chip Salzenberg
@ 2002-09-16 1:31 ` Will Stowe
0 siblings, 0 replies; 7+ messages in thread
From: Will Stowe @ 2002-09-16 1:31 UTC (permalink / raw)
To: nfs
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-09-16 1:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-12 2:19 Lock recovery doesn't work in debian statd/lockd ordering Neil Brown
2002-09-12 4:00 ` Adrian Phillips
2002-09-12 4:49 ` Neil Brown
2002-09-13 16:37 ` H. J. Lu
2002-09-13 19:22 ` Philippe Troin
2002-09-15 21:44 ` Chip Salzenberg
2002-09-16 1:31 ` unsubcribe Will Stowe
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.