Imported Debian patch 4.84-8
[hcoop/debian/exim4.git] / debian / manpages / exim_lock.8
1 .\" Hey, EMACS: -*- nroff -*-
2 .\" First parameter, NAME, should be all caps
3 .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
4 .\" other parameters are allowed: see man(7), man(1)
5 .TH EXIM_LOCK 8 "March 26, 2003"
6 .\" Please adjust this date whenever revising the manpage.
7 .\"
8 .\" Some roff macros, for reference:
9 .\" .nh disable hyphenation
10 .\" .hy enable hyphenation
11 .\" .ad l left justify
12 .\" .ad b justify to both left and right margins
13 .\" .nf disable filling
14 .\" .fi enable filling
15 .\" .br insert line break
16 .\" .sp <n> insert n+1 empty lines
17 .\" for manpage-specific macros, see man(7)
18 .\" \(oqthis text is enclosed in single quotes\(cq
19 .\" \(lqthis text is enclosed in double quotes\(rq
20 .SH NAME
21 exim_lock \- Mailbox maintenance
22 .SH SYNOPSIS
23 .B exim_lock
24 .RI [ options ] mailbox-file
25
26 .SH DESCRIPTION
27 The
28 .B exim_lock
29 utility locks a mailbox file using the same algorithm as Exim.
30 For a discussion of locking issues, see section 25.2.
31 .B exim_lock
32 can be used to prevent any modification of a mailbox by Exim or a user
33 agent while investigating a problem.
34 The utility requires the name of the file as its first argument.
35 If the locking is successful, the second argument is run as a command
36 (using C's \(lqsystem()\(rq function); if there is no second argument, the value
37 of the SHELL environment variable is used; if this is unset or empty,
38 /bin/sh is run.
39 When the command finishes, the mailbox is unlocked and the utility ends.
40 The following options are available:
41 .TP
42 .I \-fcntl
43 Use \(lqfcntl()\(rq locking on the open mailbox.
44 .TP
45 .I \-interval
46 This must be followed by a number, which is a number of seconds; it
47 sets the interval to sleep between retries (default 3).
48 .TP
49 .I \-lockfile
50 Create a lock file before opening the mailbox.
51 .TP
52 .I \-mbx
53 Lock the mailbox using MBX rules.
54 .TP
55 .I \-q
56 Suppress verification output.
57 .TP
58 .I \-retries
59 This must be followed by a number; it sets the number of times to try
60 to get the lock (default 10).
61 .TP
62 .I \-timeout
63 This must be followed by a number, which is a number of seconds; it
64 sets a timeout to be used with a blocking \(lqfcntl()\(rq lock.
65 If it is not set (the default), a non-blocking call is used.
66 .TP
67 .I \-v
68 Generate verbose output.
69
70 If none of
71 .I \-fcntl, \-lockfile
72 or
73 .I \-mbx
74 are given, the default is to create a lock file and also use \(lqfcntl()\(rq locking
75 on the mailbox, which is the same as
76 .B Exim's
77 default.
78 The use of
79 .I \-fcntl
80 requires that the file be writable; the use
81 of
82 .I \-lockfile
83 requires that the directory containing the file be writable.
84 Locking by lock file does not last for ever; Exim assumes that a lock file
85 is expired if it is more than 30 minutes old.
86
87 The
88 .I \-mbx
89 option is mutually exclusive with
90 .I \-fcntl.
91 It causes a shared lock to be taken out on the open mailbox, and an
92 exclusive lock on the file /tmp/.n.m where n and m are the device number
93 and inode number of the mailbox file.
94 When the locking is released, if an exclusive lock can be obtained for the
95 mailbox, the file in /tmp is deleted.
96
97 The default output contains verification of the locking that takes place.
98 The
99 .I \-v
100 option causes some additional information to be given.
101 The
102 .I \-q
103 option suppresses all output except error messages.
104 .PP
105 A command such as
106
107 exim_lock /var/spool/mail/spqr
108
109 runs an interactive shell while the file is locked, whereas
110
111 exim_lock \-q /var/spool/mail/spqr <<End
112 <some commands>
113 End
114
115 runs a specific non-interactive sequence of commands while the file is
116 locked, suppressing all verification output.
117 A single command can be run by a command such as
118
119 exim_lock \-q /var/spool/mail/spqr \
120 "cp /var/spool/mail/spqr /some/where"
121
122 Note that if a command is supplied, it must be entirely contained within
123 the second argument - hence the quotes.
124
125 .SH BUGS
126 This manual page needs a major re-work. If somebody knows better groff
127 than us and has more experience in writing manual pages, any patches
128 would be greatly appreciated.
129
130 .SH SEE ALSO
131 .BR exim (8),
132 /usr/share/doc/exim4\-base/
133
134 .SH AUTHOR
135 This manual page was stitched together from spec.txt by
136 Andreas Metzler <ametzler at downhill.at.eu.org>,
137 for the Debian GNU/Linux system (but may be used by others).