[net.unix] mail locking

lepreau@utah-cs.UUCP (Jay Lepreau) (03/16/84)

That's the whole point, that EVERY program that writes on /usr/spool/mail/user
must observe the same locking protocol.  Another problem with the locking as
distributed (in 4.x bsd at least) is that the timeout in binmail is too
short: only 30 seconds.  After that binmail declares the lock defunct and
merrily appends to the mail file.  That can easily be exceeded on a not very
loaded system by a user with a big mailbox, and many keep their boxes full of
pending mail.  As distributed, UCB Mail has the long timeout of 5 minutes,
but that is the program that normally only needs a short timeout, as
/bin/mail will append quickly.

Anyway, I have extracted the relevant locking code into a module mlock.c
containing, ah hah, mlock and mfree, which lock on /tmp.  If people want I'll
send it out (it's pretty minor, but it's done).  I didn't use 4.2 file locking
locking so it is portable.

Jay Lepreau

phil@amd70.UUCP (Phil Ngai) (03/22/84)

Some time ago there was discussion on the proper mode of /usr/spool/mail
and it was pointed out that /usr/ucb/Mail does its locking there so it
needs to be writable. Someone said they moved the locking to /tmp.

Isn't it also necessary to worry about the locking protocol used by
/bin/mail, which /etc/delivermail uses for local mail delivery?

-- 
Phil Ngai (408) 988-7777 {ucbvax,decwrl,ihnp4,allegra,intelca}!amd70!phil