/etc/locks Directory

Purpose

Contains lock files that prevent multiple uses of communications devices and multiple calls to remote systems.

Description

The /etc/locks directory contains files that lock communications devices and remote systems so that another user cannot access them when they are already in use. Other programs check the /etc/locks directory for lock files before attempting to use a particular device or call a specific system.

A lock file is a file placed in the /etc/locks directory when a program uses a communications device or contacts a remote system. The file contains the process ID number (PID) of the process that creates it.

The Basic Networking Utilities (BNU) program and other communications programs create a device lock file whenever a connection to a remote system, established over the specified device, is actually in use. The full path name of a device lock file is:

/etc/locks/DeviceName

where the DeviceName extension is the name of a device, such as tty3.

When the BNU uucico daemon, cu command, or tip command places a call to a remote system, it puts a system lock file in the /etc/locks directory. The full path name of a system lock file is:

/etc/locks/SystemName

where the SystemName extension is the name of a remote system, such as hera. The system lock file prevents more than one connection at a time to the same remote system.

Under normal circumstances, the communications software automatically removes the lock file when the user or program ends the connection to a remote system. However, if a process executing on the specified device or system does not complete its run (for example, if the computer crashes), the lock file remains in the /etc/locks directory either until the file is removed manually or until the system is restarted after a shutdown.