Penguin
Blame: lockfile-create(1)
EditPageHistoryDiffInfoLikePages
Annotated edit history of lockfile-create(1) version 8, including all changes. View license author blame.
Rev Author # Line
6 CraigBox 1 !!NAME
2
3 lockfile-progs - command-line programs to safely lock and unlock files and mailboxes (via liblockfile).
2 perry 4
5
6 !!SYNOPSIS
7
7 CraigBox 8 __mail-lock__ [[ --retry ''retry-count'' ] %%%
9 __mail-unlock__ %%%
10 __mail-touchlock__ [[ --oneshot ]
2 perry 11
6 CraigBox 12 __lockfile-create__ [[ --retry ''retry-count'' ] ''filename'' %%%
7 CraigBox 13 __lockfile-remove__ ''filename'' %%%
14 __lockfile-touch__ [[ --oneshot ] ''filename'' %%%
2 perry 15
16 !!DESCRIPTION
17
6 CraigBox 18 __lockfile-progs__ provide a method to lock and unlock mailboxes and files safely (via liblockfile).
2 perry 19
6 CraigBox 20 * __mail-lock:__ lock the current user's mailbox.
21 * __mail-unlock:__ unlock the current user's mailbox.
22 * __mail-touchlock:__ touch the lock on the current user's mailbox.
2 perry 23
6 CraigBox 24 Each of the mail locking commands is applied to the file /var/spool/mail/
2 perry 25
6 CraigBox 26 * __lockfile-create:__ lock a given file.
27 * __lockfile-remove:__ remove the lock on a given file.
28 * __lockfile-touch:__ touch the lock on a given file.
5 LaurenMatheson 29
30 Creating a file lock includes creating the file ''filename''.lock. This requires that the user running lockfile-create have write permission to the directory where ''filename'' resides.
2 perry 31
6 CraigBox 32 Once a file is locked, the lock must be touched at least once every five minutes, or it will be considered stale and a subsequent attempt to lock the file will succeed. For both of the locking commands __(mail-touchlock__ and __lockfile-touch),__ the --oneshot argument causes the program to touch the lock and exit immediately. Otherwise the program will loop forever, touching the lock once every minute until it is killed.
2 perry 33
6 CraigBox 34 For both of the locking commands __(mail-lock__ and __lockfile-create),__ the --retry argument specifies (as an integer) the maximum number of times to retry locking the file before giving up if attempts are failing. Each retry will be delayed a little longer than the last (in 5 second increments) until a maximum delay of one minute between retries is reached. The default retry count is 9 which, if all 9 attempts to lock the file fail, will give up after 180 seconds (3 minutes).
2 perry 35
36 !!EXAMPLES
37
6 CraigBox 38 __Locking a file during a lengthy process:__ lockfile-create /some/file lockfile-touch /some/file
2 perry 39
40 !!EXIT STATUS
41
6 CraigBox 42 * __0__ Successful program execution.
43 * __NOT-0__ Some problem was encountered.
2 perry 44
45 !!SEE ALSO
46
6 CraigBox 47 maillock(3), touchlock(3), mailunlock(3), lockfile-create(1), lockfile-remove(1), lockfile-touch(1), lockfile_create(3), lockfile_remove(3),
48 lockfile_touch(3).
2 perry 49
50 !!HISTORY
51
52 1998 - Written by Rob Browning
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 9 times)