1833707 Members
2097 Online
110063 Solutions
New Discussion

lockf not working

 
Shahul
Esteemed Contributor

lockf not working

Hi,

I have mounted a filesystem from remote server by using NFS. My application is trying to do lockf against one file in this remote filesystem and it dowsn't seems to be working. Has anyone faced such issue before. I don't know actual error code as it is done by application.

TIA
Shahul
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: lockf not working

Shalom Shahul,

For this to work, the remote filesystem need to be running NFS v4, which for HP-UX only ships for 11.23 11i v2.

NFS 3 is not capable of handling locks like this. See Dave Olker's NFS book for more on this.

A modern Linux box will support the NFS locking you need.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: lockf not working

You make it very difficult to help when you simply say that "it dowsn't seems to be working". What is the error message that the application generates (or does the application hang?). NFS file locking works. You need to make sure that lockd and statd are running. I have seen locking problems on PC implementations of NFS so that the lock was actually faked whether or not locking was actually occurring.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: lockf not working

Nonsense, NFS locking has been around since NFS was NFS.
If it ain't broke, I can fix that.
Shahul
Esteemed Contributor

Re: lockf not working


Hi,

Thanks for reponses. I have exported this filesystem to two systems (ServerA and ServerB). Bothe ServerA and ServerB are accessing same remote filesystem and running same application. In one server lockf is working and application is starting properly, in the other it just hang, application does not start properly.

NFS server Unix ver is 11.11.

I have to assume the actual error till app support enables the application debug logging.

Months back it occured and a reboot of NFS client solved the problem, but now I don't want to adopt the same method.

All suggestions are welcomed.

TIA
Shahul
A. Clay Stephenson
Acclaimed Contributor

Re: lockf not working

You keep mentioning lockf() but lockf() may have absolutely nothing to do with this. At this point, you should look for any NFS related patches and apply them but until you get some diagnostics, it's not self-evident that this is even an NFS-related problem (unless you are seeing some error messages that you aren't sharing).
If it ain't broke, I can fix that.