Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
dotlockfile(1)
Edit
PageHistory
Diff
Info
LikePages
DOTLOCKFILE !!!DOTLOCKFILE NAME SYNOPSIS DESCRIPTION OPTIONS RETURN VALUE NOTES BUGS SEE ALSO AUTHOR ---- !!NAME dotlockfile - Utility to manage lockfiles !!SYNOPSIS __/usr/bin/dotlockfile__ [[__-p__] [[__-c__] [[__-u__] [[__-m__] [[__-l|-u__] [[__-r__ ''retries''] [[__lockfile]__ !!DESCRIPTION __Dotlockfile__ is a command line utility to safely create, test and remove lockfiles. Lockfiles are created in an NFS-safe way. __Dotlockfile__ can lock and unlock mailboxes even if the mailspool directory is only writable by group mail. The name __dotlockfile__ comes from the way mailboxes are locked for updates on a lot of UNIX systems. A lockfile is created with the same filename as the mailbox but with the string __.lock'''' The names __dotlock__ and __lockfile__ were already taken - hence the name __dotlockfile__ '':)''. !!OPTIONS __-l__ Create a lockfile. This is the default. __-u__ Remove a lockfile. __-c__ Check for the existence of a __valid__ lockfile. __-p__ Write the ''process-id'' of the calling process into the lockfile. Also when testing for an existing lockfile, check the contents for a process-id to find out if the lockfile is still valid. __-r retries__ The number of times __dotlockfile__ tries to acquire the lock before giving up. The initial sleep after failing to acquire the lock is 5 seconds. After each next try, a sleep of 5 seconds ''extra'' occurs up to a maximum sleep of 60 seconds between tries. __-m__ Lock or unlock the current users mailbox. The path to the mailbox is the default system mailspool directory (usually ''/var/mail'') with the username as gotten from ''getpwuid()'' appended. If the environment variable ''$MAIL'' is set, that is used instead. Then the string '''' is appended to get the name of the actual lockfile. lockfile The lockfile to be created/removed, unless the __-m__ option is in effect. !!RETURN VALUE Zero on success, and non-zero on failure. For the __-c__ option, sucess means that a valid lockfile is already present. When locking (the default, or the __-l__ option) __dotlockfile__ returns the same values as the library function ''lockfile_create''(3). !!NOTES The lockfile is created exactly as named on the command line. The extension ''.lock'' is ''not'' automatically added. This utility is a lot like the lockfile(1) utility included with ''procmail'', and the ''mutt_dotlock''(1) utility included with ''mutt''. However the command-line arguments differ, and so does the return status. It is believed that ''dotlockfile'' is the most flexible implementation, since it automatically detects when it needs to use priviliges to lock a mailbox, and does it safely. !!BUGS None known. !!SEE ALSO lockfile_create(3), maillock(3) !!AUTHOR Miquel van Smoorenburg, miquels@cistron.nl ----
One page links to
dotlockfile(1)
:
Man1d
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.