Operating System - HP-UX
1833271 Members
3067 Online
110051 Solutions
New Discussion

Re: file lock fails on nfs file system

 
Satya_6
Frequent Advisor

file lock fails on nfs file system

Hi,

The file locking (using lockf as well as fcntl) fails on a file (always returns -1 on a nfs filesystem). The 'errno' is set to ENOLCK.
This happens only on HP.

any help would be greatly appreciated

TIA
satya
3 REPLIES 3
Massimo Bianchi
Honored Contributor

Re: file lock fails on nfs file system

Hi,
check if on the server the rpc.lockd is active.

HTH,
Massimo

Jean-Louis Phelix
Honored Contributor

Re: file lock fails on nfs file system

Hi,

I think that you can find the answer in man lockf.

See the NFS section :

"Only advisory record locking is implemented for NFS files"

and in the ERRORS :

[ENOLCK] Either function is F_TLOCK or F_LOCK and the file is an NFS file with access bits set for enforcement mode, or the file is an NFS file and a system error occurred on the remote node.

Regards.
It works for me (© Bill McNAMARA ...)
Enrico P.
Honored Contributor

Re: file lock fails on nfs file system

Hi,
from manual:

If multiple users on different NFS clients will be writing to the file,
you must also turn off attribute caching on those clients by mounting
the file with the noac option.

Issue the following command on the NFS client to make sure the
server is running all the NFS server processes:

/usr/bin/rpcinfo -p servername
The rpcinfo command should display the following processes:
??? rpcbind
??? nfs
??? mountd
??? status
??? nlockmgr
??? llockmgr

Enrico