There must be some NFS wizards in the group...
I still can't get NFS locking to work between my 2 linux boxen.
I took the drastic steps of completely disabling my iptables firewalls on both boxes and setting the policies to ACCEPT. Didn't help.
I also set my NFS server config back to 100% stock (mv /etc/sysconfig/nfs /tmp/; service nfs restart; service nfslock restart; service rpcidmapd restart; service portmap restart), remount. Doesn't help.
The test code at the bottom never gets past the flock call. oocalc also will never get past the splash screen.
I tried exporting and mounting from machine A to machine A (I guess a loopback-ish mount). For both machine A and B, this works fine. The perl code runs and oocalc loads up a NFS'd file instantly.
If I mount with nolock in client's fstab, then oocalc starts fine (probably just ignoring the locks).
I recently upgrade the client box to Fedora 8 (2.6.23). The server is not easily upgradable and is running 2.6.17. I did a lot of net research and it seems like NFS flock should work on all kernels after 2.6.12.
I'm stumped! Please help!
Here's my server /etc/sysconfig/nfs (to work with my firewalls) STATD_PORT=32765 STATD_OUTGOING_PORT=32766 MOUNTD_PORT=32767 RQUOTAD_PORT=32764 LOCKD_TCPPORT=32763 LOCKD_UDPPORT=32763 SECURE_NFS=no
exports: /data 192.168.100.1(rw,insecure,insecure_locks,async,no_subtree_check,no_root_squash)
client: 192.168.100.2:/data /data nfs rw,hard,intr,timeo=10,nosuid,bg,udp,rsize=8192,wsize=8192 0 0
server processes: root 15986 1 0 18:50 ? 00:00:00 rpc.rquotad -p 32764 root 15989 7 0 18:50 ? 00:00:00 [nfsd4] root 15990 1 0 18:50 ? 00:00:00 [nfsd] root 15991 1 0 18:50 ? 00:00:00 [nfsd] root 15992 1 0 18:50 ? 00:00:00 [nfsd] root 15993 1 0 18:50 ? 00:00:00 [lockd] root 15994 7 0 18:50 ? 00:00:00 [rpciod/0] root 15995 1 0 18:50 ? 00:00:00 [nfsd] root 15996 1 0 18:50 ? 00:00:00 [nfsd] root 15997 1 0 18:50 ? 00:00:00 [nfsd] root 15998 1 0 18:50 ? 00:00:00 [nfsd] root 15999 1 0 18:50 ? 00:00:00 [nfsd] root 16002 1 0 18:50 ? 00:00:00 rpc.mountd -p 32767 rpcuser 16039 1 0 18:50 ? 00:00:00 rpc.statd -p 32765 -o 32766 root 16069 1 0 18:50 ? 00:00:00 rpc.idmapd rpc 16087 1 0 18:50 ? 00:00:00 portmap
test script:
#!/usr/bin/perl use Fcntl ':flock'; # import LOCK_* constants print("Just before opening file.\n"); open(LOCKFILE,">testlockfile") or die "Error: Could not write to lock file: testlockfile: $!\n"; print("Just before locking file.\n"); flock(LOCKFILE,LOCK_EX); print("Just before unlocking file.\n"); flock(LOCKFILE,LOCK_UN); print("All done. File locked and unlocked.\n"); unlink("testlockfile"); exit(0);