Filesystem Hierarchy Standard

5.5 /var/lock : Lock files

Lock files should be stored within the /var/lock directory structure.

Device lock files, such as the serial device lock files that were originally found in either /usr/spool/locks or /usr/spool/uucp, must now be stored in /var/lock. The naming convention which must be used is LCK.. followed by the base name of the device. For example, to lock /dev/cua0 the file LCK..cua0 would be created.

"LCK.." followed by the base name of the device. For example, to lock /dev/cua0 the file "LCK..cua0" would be created.

The format used for device lock files must be the HDB UUCP lock file format. The HDB format is to store the process identifier (PID) as a ten byte ASCII decimal number, with a trailing newline. For example, if process 1230 holds a lock file, it would contain the eleven characters: space, space, space, space, space, space, one, two, three, zero, and newline.

Then, anything wishing to use /dev/cua0 can read the lock file and act accordingly (all locks in /var/lock should be world-readable).


Previous: /var/games : Variable game data
Next: /var/log : Log files and directories
Up: Table of Contents

Translated by troff2html 1.5 on 16 November 1997 by quinlan