lockd Daemon

Purpose

Processes lock requests.

Syntax

/usr/sbin/rpc.lockd [ -t TimeOut ] [ -g GracePeriod ] [ -d debug ] [ -x xnfs ] [ -T RetransmissionsTimeout ] [ number of server ]

Description

The lockd daemon processes lock requests that are either sent locally by the kernel or remotely by another lock daemon. The lockd daemon forwards lock requests for remote data to the server site lock daemon through the RPC package. The lockd daemon then asks the statd (status monitor) daemon for monitor service. The reply to the lock request is not sent to the kernel until both the statd daemon and the server site lockd daemon reply. The statd daemon should always be started before the lockd daemon.

If either the status monitor or the server site lock daemon is unavailable, the reply to a lock request for remote data is delayed until all daemons become available.

When a server recovers, it waits for a grace period for all client site lockd daemons to submit reclaim requests. The client site lockd daemons, on the other hand, are notified of the server recovery by the statd daemon. These daemons promptly resubmit previously granted lock requests. If a lockd daemon fails to secure a previously granted lock at the server site, the lockd daemon sends a SIGLOST signal to the process.

The lockd daemon is started and stopped with the following System Resource Controller (SRC) commands:
startsrc -s rpc.lockd
stopsrc -s rpc.lockd
To modify the arguments passed to the lockd daemon when it is started, use the following command:
chssys -s rpc.lockd Parameters...

The status monitor maintains information about the location of connections as well as the status in the /var/statmon/sm directory, the /var/statmon/sm.bak file, and the /var/statmon/state file. When restarted, the statd daemon queries these files and tries to reestablish the connection it had prior to termination. To restart the statd daemon, and subsequently the lockd daemon, without prior knowledge of existing locks or status, delete these files before restarting the statd daemon.

By default rpc.lockd establishes a dynamic socket port number for receiving requests. Entries may be added to the /etc/services file specifying the port that rpc.lock will listen for requests on. The service name is lockd and a unique port number should be specified. The following entries in /etc/services file would specify that port 16001 be used for both tcp and udp.
lockd 16001/tcp
lockd 16001/udp

Flags

Item Description
-d debug Specifies the debug level of the rpc.statd daemon. By default, the debug level is disabled.
-g GracePeriod Uses the GracePeriod variable to specify the amount of time, in seconds, that the lockd daemon should wait for reclaim requests for previously granted locks. The default value of the GracePeriod variable is 45 seconds.
-T RetransmissionsTimeout Specifies the timeout for one-way RPC connections. One-way RPC connections stay valid for RetransmissionsTimeout number of seconds. If this variable is set to 0, then there is no client cache for one-way RPC calls. The default value for the RetransmissionsTimeout variable is 300 seconds.
-t TimeOut Uses the TimeOut variable to specify the interval between retransmitting lock requests to the remote server. The default value for the TimeOut variable is 15 seconds.
-x xnfs Specifies if the rpc.lockd daemon needs to follow the xnfs specification. By default, this flag is turned off.

Parameters

Item Description
number of server Specifies the number of daemons to start.

Examples

  1. To specify a grace period, enter:
    /usr/sbin/rpc.lockd  -g 60
    In this example, the grace period is set for 60 seconds.
  2. To specify the amount of time the lockd daemon should wait before retransmitting a lock request, enter:
    /usr/sbin/rpc.lockd  -t 30
    In this example, the retransmissions occur after 30 seconds.

Files

Item Description
/etc/services Contains lockd parameter information entries.