On 29.3.2007, at 21.30, Stewart Dean wrote:
There are three applications that have their mitts on files on my
mail server, which is running AIXV5.3 and UWIMAP and mbox format.
The mail folders and INBOXES are native to that machine, but also
are NFS exported to a login server and a mailing list server. All
three machines are running the lockd daemon.Everybody wants to lock differently
- procmail (delivering for sendmail), which seems to want to use
dotlocking, fcntl and lockf locking; for whatever reasons, the
compile time tests seem to disallow flock.- UWIMAP which according to wiki.dovecot.org/Migration/UW uses: mbox_read_locks = flock mbox_write_locks = dotlock flock
- I want to run dovecot in the same environment as I switch over,
for which the locking strategy is supposed to be (according to
http://wiki.dovecot.org/MboxLocking) mbox_read_locks = fcntl mbox_write_locks = dotlock fcntlSince that same page in the wiki says. "*It's important that all
software that's reading or writing to mboxes use the same locking
settings.",* I had recompiled procmail so it only usedotlocking and
fcntl (thus removing lockf in addition to the disallowed
flock)...but now I bumped into the Migration/UW page and there
looks to be a conflict.
It doesn't actually hurt to use more locking mechanisms, as long as
they all use at least one common and they're not in different order.
I want to be able to run dovecot (for testing) and UWIMAP (for all
users/production) at the same time (but never at the same time
with the same mailbox), but UWIMAP is doc'ed to use flock and
Dovecot doesn't It's conceivable that the different locking strategies of UWIMAP
and Dovecot don't matter because they would never be going after
the same mail files (right?) but there is procmail, which has to
interact with both. It appears to not use flock OK, even though
the docs say it should since UWIMAP expects it, and I've disabled
lockf as well. But will there be a conflict with procmail and
dovecot's use of fcntl, which UWIMAP doesn't use?
You could use:
mbox_read_locks = fcntl flock mbox_write_locks = dotlock fcntl flock
Both UW-IMAP and Procmail use dotlock as the first write lock and
reading uses only a single lock method, so there won't be any deadlocks.
Hmm. I think when delivering new mails only the write lock matters.
At least with UW-IMAP. Looks like Dovecot also at least usually write
locks the mbox if it has changed.
So the read lock is mostly useful in situations like where one
process is reading the mails while another process expunges messages.
UW-IMAP doesn't allow two processes to access the same mbox
simultaneously anyway.