3.5.1 Matrix Server Command Reference
Chapter 1: Matrix Server Commands 45
Copyright © 1999-2007 PolyServe, Inc. All rights reserved.
psfssema – manage matrix-wide file locks
Synopsis
/opt/polyserve/bin/psfssema -i <filename>
/opt/polyserve/bin/psfssema -g <filename>
/opt/polyserve/bin/psfssema -r <filename>
/opt/polyserve/bin/psfssema -d <filename>
Description
The psfssema semaphore utility provides a simple synchronization
mechanism for managing matrix-wide file locks. This utility can be used in
shell scripts on different nodes of a matrix and takes advantage of the PSFS
filesystem and its internode communication abilities. For example, you might
want to use matrix-wide file locking in a Start or Stop script for a service or
device monitor.
The options are:
-i <filename>
Create the PSFS command-line semaphore file <filename> and the
supplemental file <filename.pid> if either file does not already exist. The
command then initializes the files to create the PSFS command-line
semaphore. <filename> must be a path on a PSFS filesystem.
-g <filename>
Lock the PSFS command-line semaphore associated with <filename>,
which is the name of a semaphore file created by psfssema -i. If the
semaphore is already locked by another node in the matrix, the calling
process blocks until the semaphore becomes available.
An error is returned if <filename> does not exist or has not been initialized
by psfssema -i, or if <filename.pid> does not exist.
-r <filename>
Unlock the PSFS command-line semaphore associated with <filename>,
which is the name of a semaphore file created by psfssema -i. If other
nodes are blocked on the semaphore when psfssema-r is called, one of the
blocked psfssema -g processes will return successfully.
-d <filename>
Delete the PSFS command-line semaphore associated with <filename>,
which is the name of a semaphore file created by psfssema -i. It also
deletes <filename> and <filename.pid>.