dotlock(8) dotlock(8) NAME dotlock - Apply dotlocking to a mailbox file SYNOPSIS dotlock mailbox command [ args ... ] DESCRIPTION dotlock locks the file mailbox and runs command with the given arguments. If command does not finish within 55 seconds, it is sent an ALRM signal. It is the responsi- bility of command to take appropriate action in response to this signal; i.e., to restore mailbox to its original state. When command exits, or in any case after 60 sec- onds, the lock is removed. DOTLOCKING Dotlocking requires write access to the directory in which mailbox resides. dotlock creates a temporary file with a unique name in that directory, and attempts to link it to mailbox.lock. If this succeeds, the lock has been aquired. A countdown timer is started, the temporary file is removed, and command is run. If locking failed due to the existence of mailbox.lock, dotlock will wait and retry. However, if mailbox.lock is older than 60 seconds, it is consider fair game for being stolen, in which case dotlock will remove it and proceed as described before. The temporary file used by dotlock is given a name mail- box.lock followed by a string derived from dotlocks PID, the current time, and the name of the current host. BUGS Dotlocking is subject to a serious race condition in the case of the timer expiring, when the lock is stolen. Therefore, dotlocking should never be used unless the alternative is worse. Having to do file locking over NFS may be seen by some as worse, which is why this program was written in the first place. Users with NFS mounted home directories are adviced to rely on maildir delivery whenever possible. EXIT CODES Normally, dotlock will exit using the same exit status as command. Otherwise, the exit code is 100 for wrong usage, and 111 for other errors. SEE ALSO dot-qmail(9), mboxappend(8) dotlock(8)