Relax chown requirements when check_owner is false
[hcoop/debian/exim4.git] / debian / manpages / exim_lock.8
CommitLineData
de45f55a
AM
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
21exim_lock \- Mailbox maintenance
22.SH SYNOPSIS
23.B exim_lock
24.RI [ options ] mailbox-file
25
26.SH DESCRIPTION
27The
28.B exim_lock
29utility locks a mailbox file using the same algorithm as Exim.
30For a discussion of locking issues, see section 25.2.
31.B exim_lock
32can be used to prevent any modification of a mailbox by Exim or a user
33agent while investigating a problem.
34The utility requires the name of the file as its first argument.
35If 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
37of the SHELL environment variable is used; if this is unset or empty,
38/bin/sh is run.
39When the command finishes, the mailbox is unlocked and the utility ends.
40The following options are available:
41.TP
42.I \-fcntl
43Use \(lqfcntl()\(rq locking on the open mailbox.
44.TP
45.I \-interval
46This must be followed by a number, which is a number of seconds; it
47sets the interval to sleep between retries (default 3).
48.TP
49.I \-lockfile
50Create a lock file before opening the mailbox.
51.TP
52.I \-mbx
53Lock the mailbox using MBX rules.
54.TP
55.I \-q
56Suppress verification output.
57.TP
58.I \-retries
59This must be followed by a number; it sets the number of times to try
60to get the lock (default 10).
61.TP
62.I \-timeout
63This must be followed by a number, which is a number of seconds; it
64sets a timeout to be used with a blocking \(lqfcntl()\(rq lock.
65If it is not set (the default), a non-blocking call is used.
66.TP
67.I \-v
68Generate verbose output.
69
70If none of
71.I \-fcntl, \-lockfile
72or
73.I \-mbx
74are given, the default is to create a lock file and also use \(lqfcntl()\(rq locking
75on the mailbox, which is the same as
76.B Exim's
77default.
78The use of
79.I \-fcntl
80requires that the file be writable; the use
81of
82.I \-lockfile
83requires that the directory containing the file be writable.
84Locking by lock file does not last for ever; Exim assumes that a lock file
85is expired if it is more than 30 minutes old.
86
87The
88.I \-mbx
89option is mutually exclusive with
90.I \-fcntl.
91It causes a shared lock to be taken out on the open mailbox, and an
92exclusive lock on the file /tmp/.n.m where n and m are the device number
93and inode number of the mailbox file.
94When the locking is released, if an exclusive lock can be obtained for the
95mailbox, the file in /tmp is deleted.
96
97The default output contains verification of the locking that takes place.
98The
99.I \-v
100option causes some additional information to be given.
101The
102.I \-q
103option suppresses all output except error messages.
104.PP
105A command such as
106
107 exim_lock /var/spool/mail/spqr
108
109runs 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
115runs a specific non-interactive sequence of commands while the file is
116locked, suppressing all verification output.
117A 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
122Note that if a command is supplied, it must be entirely contained within
123the second argument - hence the quotes.
124
125.SH BUGS
126This manual page needs a major re-work. If somebody knows better groff
127than us and has more experience in writing manual pages, any patches
128would be greatly appreciated.
129
130.SH SEE ALSO
131.BR exim (8),
132/usr/share/doc/exim4\-base/
133
134.SH AUTHOR
135This manual page was stitched together from spec.txt by
136Andreas Metzler <ametzler at downhill.at.eu.org>,
137for the Debian GNU/Linux system (but may be used by others).