linux nfs and lockd

Jon P. deOng (jdeong@cnmnetwork.com)
Tue, 17 Nov 1998 09:14:07 -0800


Hello all,
I'm trying to get lockd to work over nfs with a couple of linux machines
and a sparc nfs server.
What I want to do is load balance 2 apache web servers where the web data
is stored on the nfs mount to the sparc. The problem I have is with lockd.
It doesn't seem to be forwarding the locks to the nfs server. Am I just
confused on how lockd works? I thought it was supposed to send a lock
request to the nfs server which would in turn lock the file from the other
nfs clients. Both my linux boxes are running 1.1.128 kernel with mount
version 2.8a, lockd and nfs. The sparc is running solaris 2.6. I have both
statd and lockd running on all 3 machines. To test this i used the
following cgi.
#!/usr/bin/perl
use Fcntl;
use File::Flock;
print "Content-type: text/html\n\n";
$pid = $$;
$mfile = 'craplog';
#$lockm = lock($mfile);
open(LOG, ">> $mfile");
fcntl(LOG, &F_SETLKW, 0);
while ($x <50000) {

$x++;
print "$pid : $x \n";
print LOG "$pid : $x \n";
#sleep 5;
}
#unlock($mfile);
fcntl(LOG, &F_UNLCK, 0);

close(LOG);
exit 0;
Ive tried both fcntl() and lock() with perl and they dont seem to be
locking the file. Is there anyplace i should look in order to RTFM? I've
searched all over the net and I haven't found anything
recent that has been of much help. Thanks in advance
jpd

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/