File locking is not working over NFS, from a SLES 8 NFS client.

(Last modified: 22Feb2006)

This document (10100506) is provided subject to the disclaimer at the end of this document.

fact

Suse Linux Enterprise Server 8

SLES 8

symptom

File locking is not working over NFS, from a SLES 8 NFS client.

An application or process is attempting to lock files on and NFS mount, but no lock requests are being passed to the NFS server.

cause

For an NFS client to support locking, both lockd and rpc.statd must be running.  Lockd is usually loaded automatically as needed, but on SLES 8 rpc.statd is not always loaded automatically (depending on the configuration).

If the locking call is made through flock, it will not work over NFS.  This is documented in the flock man page.  However, locks using fcntl calls should work over NFS, provided lockd and rpc.statd are running.

fix

To enable NFS lock support dynamically, the root user should execute:
/etc/rc.d/nfslock start

To make this a persistent part of the configuration, the root user should execute:
chkconfig nfslock 35

To check the current configuration:
chkconfig -l | grep nfslock
The output should show that nfslock will be "on" in run levels 3 and 5.

To check the current services:
rpcinfo -p
The output should include services "portmapper," "nlockmgr," and "status."

Note: nlockmgr might not be listed if no nfs file system is currently mounted.
Note: These services should also be running on the remote NFS server.
Note: "rstatd" is a different service; "status" must be listed in the output of rpcinfo -p.

document

Document Title: File locking is not working over NFS, from a SLES 8 NFS client.
Document ID: 10100506
Solution ID: NOVL105205
Creation Date: 17Feb2006
Modified Date: 22Feb2006
Novell Product Class:COMM/NFS

disclaimer

The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.