1 |
perry |
1 |
lockfile-progs |
|
|
2 |
!!!lockfile-progs |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
EXAMPLES |
|
|
7 |
EXIT STATUS |
|
|
8 |
SEE ALSO |
|
|
9 |
HISTORY |
|
|
10 |
---- |
|
|
11 |
!!NAME |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
lockfile-progs - command-line programs to safely lock and unlock files and mailboxes (via liblockfile). |
|
|
15 |
!!SYNOPSIS |
|
|
16 |
|
|
|
17 |
|
|
|
18 |
__mail-lock__ [[ --retry ''retry-count'' ]__ |
|
|
19 |
mail-unlock |
|
|
20 |
mail-touchlock__ [[ --oneshot ] |
|
|
21 |
|
|
|
22 |
|
|
|
23 |
__lockfile-create__ [[ --retry ''retry-count'' ] |
|
|
24 |
''filename''__ |
|
|
25 |
lockfile-remove__ ''filename''__ |
|
|
26 |
lockfile-touch__ [[ --oneshot ] |
|
|
27 |
''filename'' |
|
|
28 |
!!DESCRIPTION |
|
|
29 |
|
|
|
30 |
|
|
|
31 |
__lockfile-progs__ provide a method to lock and unlock |
|
|
32 |
mailboxes and files safely (via liblockfile). |
|
|
33 |
|
|
|
34 |
|
|
|
35 |
__mail-lock:__ lock the current user's mailbox.__ |
|
|
36 |
mail-unlock:__ unlock the current user's mailbox.__ |
|
|
37 |
mail-touchlock:__ touch the lock on the current user's |
|
|
38 |
mailbox. |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
Each of the mail locking commands is applied to the file |
|
|
42 |
/var/spool/mail/ |
|
|
43 |
|
|
|
44 |
|
|
|
45 |
__lockfile-create:__ lock a given file.__ |
|
|
46 |
lockfile-remove:__ remove the lock on a given file.__ |
|
|
47 |
lockfile-touch:__ touch the lock on a given |
|
|
48 |
file. |
|
|
49 |
|
|
|
50 |
|
|
|
51 |
Once a file is locked, the lock must be touched at least |
|
|
52 |
once every five minutes, or it will be considered stale and |
|
|
53 |
a subsequent attempt to lock the file will succeed. For both |
|
|
54 |
of the locking commands __(mail-touchlock__ and |
|
|
55 |
__lockfile-touch),__ the --oneshot argument causes the |
|
|
56 |
program to touch the lock and exit immediately. Otherwise |
|
|
57 |
the program will loop forever, touching the lock once every |
|
|
58 |
minute until it is killed. |
|
|
59 |
|
|
|
60 |
|
|
|
61 |
For both of the locking commands __(mail-lock__ and |
|
|
62 |
__lockfile-create),__ the --retry argument specifies (as |
|
|
63 |
an integer) the maximum number of times to retry locking the |
|
|
64 |
file before giving up if attempts are failing. Each retry |
|
|
65 |
will be delayed a little longer than the last (in 5 second |
|
|
66 |
increments) until a maximum delay of one minute between |
|
|
67 |
retries is reached. The default retry count is 9 which, if |
|
|
68 |
all 9 attempts to lock the file fail, will give up after 180 |
|
|
69 |
seconds (3 minutes). |
|
|
70 |
!!EXAMPLES |
|
|
71 |
|
|
|
72 |
|
|
|
73 |
__Locking a file during a lengthy process:__ |
|
|
74 |
|
|
|
75 |
|
|
|
76 |
lockfile-create /some/file lockfile-touch /some/file |
|
|
77 |
!!EXIT STATUS |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
__0__ |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
Successful program execution. |
|
|
84 |
|
|
|
85 |
|
|
|
86 |
__NOT-0__ |
|
|
87 |
|
|
|
88 |
|
|
|
89 |
Some problem was encountered. |
|
|
90 |
!!SEE ALSO |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
maillock(3), touchlock(3), |
|
|
94 |
mailunlock(3), lockfile-create(1), |
|
|
95 |
lockfile-remove(1), __lockfile-touch__(1), |
|
|
96 |
lockfile_create(3), __lockfile_remove__(3), |
|
|
97 |
lockfile_touch(3). |
|
|
98 |
!!HISTORY |
|
|
99 |
|
|
|
100 |
|
|
|
101 |
1998 - Written by Rob Browning |
|
|
102 |
---- |