[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Qmail, mailbox locking and the FSSTND



On Wed, 12 Mar 1997 lukas@teorica0.ifisicacu.unam.mx wrote:

> chudon@ee.mcgill.ca said:
> > 
> > Also... is it a <ahem> big problem if qmail uses flock to lock the
> > mailbox?
> > 
> You could use procmail or deliver to do the delivery into the user mailbox, 
> calling them via qsmhook. 
[explanation of how to do this deleted]

I might be tempted to do that if it really solved the problem... But as
soon as users start using .qmail files, the mailbox locking problem comes
back. Also I'm reluctant to ship a Debian qmail that requires a recompile
to make it behave like the default qmail.

So it looks like qmail will have to learn to do dot-locking. The only
problem is, I'm not really sure how to do dot-locking properly. (I could
always try a guess... but I don't think the people using my package would
like that.) So could somehow either give me a snippet of code that does
dot-locking or point me to an application that is known to do dot-locking
properly? Qmail does all its locking through the following three
functions: 

int lock_ex(fd) int fd; { return flock(fd,LOCK_EX); }
int lock_un(fd) int fd; { return flock(fd,LOCK_UN); }
int lock_exnb(fd) int fd; { return flock(fd,LOCK_EX | LOCK_NB); }

[ "ex" stands for exclusive, "nb" for non-blocking and "un" for unlock.]

These three functions should be replaced with functions that do
dot-locking but behave the same way as flock (with respect to return codes
and setting errno) So if someone knowledgeable about such matters could
help me (or at least point me in the right direction) it'd be great! 

   Christian

PS Does anyone know if someone is working on a rpc.lockd/rpc.statd daemon
pair for Linux? I have a page on NFS locking and Linux
(http://www.swb.de/personal/okir/lockd.html), but the last update was on
July 15th, 1995 (i.e. two years ago). I am right in believing that until
we get those, flock will not work over NFS for Linux, right? 

PPS About Qmail and the FSSTND: one thing I forgot forgot to mention...
alias also stays under /var/qmail. Hopefully all that is mostly
FSSTND-compliant. If anyone have comments about my FSSTND-ized layout for
qmail, please make themnow, *before* I release qmail.deb.



Reply to: