Re: Summary: File locking discussion
I noticed that during this discussion two issues that are not intrinsically
related keep on getting tied together:
1) Reliable file locking, including over NFS
2) Reliable mail delivery to users' inboxes
I cannot claim to be an expert on NFS locking, but I have a fairly strong
feeling that 1) is almost impossible. Of course, if it is possible then I
think we should do the Unix community a great service by providing an easy to
use library, as has been suggested.
Regardless of whether 1) is attainable, 2) is _not_ possible by use of locks
alone. The reasons for this are covered in a fair amount of detail in the
qmail documentation, but boil down to the fact that it is possible to corrupt
a conventional mbox by writing a partial message to the end.
If we are serious about changing our mail delivery policy, then I think we
should seriously consider moving to Maildir delivery as our default, with
dot-locking as a required alternative (for backwards compatibility).
Maildir delivery does not need any locking to be performed, and allows
multiple processes to create/modify/delete mail messages simultaneously
without the possibility of inbox corruption. No deadlocks or stale locks can
occur because no locking is required.
I think we need to write two libraries:
1) libnfslock (or whatever)
2) libmailaccess (or whatever)
libmailaccess should be something like PAM for mail delivery, providing access
to a user's mailbox by use of either Maildir, or dot-locking (via libnfslock
say), or whatever other method --- as selected by the user.
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
Trouble? e-mail to email@example.com .