[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

flock() vs lockf() in .../transports/mailbox/mailbox.c




[aside: I'm a newcomer to zmailer & elm administration]

Recently, when upgrading to the latest elm release we had some problems
with elm locking up.  The problem was tracked down to the use of
fcntl() in elm, which when disabled, seemed to solve our problems.

  [see below for the full description of my problems in elm, as posted
  recently to comp.mail.elm.  While eliciting some response, I did not
  hear from anyone who claimed zmailer experience]

I spent some time delving into the zmailer source code and located
.../transports/mailbox/mailbox.c which (I think) deals with local
delivery of mail into a users mailbox.  In the default setup, this
program appears to use flock() for locking the mailbox.  #ifdef'ed code
to use lockf() [fcntl()] is also there, but it has the wonderfully
reassuring comment attached: "does this really work?".  Also, so far I
have been unable to find any reference to this mailbox locking (In a
README or other documentation).

Is there some reason why lockf() is not used?  In our environment with the
/usr/spool/mail directory NFS-mounted all over the place, using this sort of
locking protocol would seem to make sense.  Has anyone out there configured
their zmailer to use lockf() instead of flock()? 

Thanks for any responses

...art

ps:  Attached here, for the sake of completeness, is the complete
     description of our problem with elm, as originally posted 
     to comp.mail.elm.  You may certainly skip this part. ;-)

pps: Our setup is elm 2.4pl21, zmailer 2.2, SunOS 4.1.1 (on the mail
     server.  We also have mips, dec, & sgi machines to contend with.)

---cut here---

Newsgroups: comp.mail.elm
Subject: elm 2.4 pl21 & locks.  (It *really* locks)

These past few days we've had problems with elm just locking up on
people.  It *seems* that the problem has to do with mailbox locking.
If you are in elm, and new mail arrives, elm locks up trying to rescan
your mailbox and then it's game over.  If you break out (even log out)
and then try to restart elm, it won't.  Elm displays the "Waiting to
read mailbox while mail is being received: attempt #0 " message.  After
it counts up to 7 (*if* it counts up, earlier tonite it wouldn't budge)
it gives up and begins to exit.  It never actually does exit.  Then
you're really stuck, as it gleefully ignores all attempts - via ^C,^Z
etc - to convince it to actually exit all the way.

I've tried rebooting my workstation and logging in elsewhere, no dice.
rebooting the central mail/news server does clear up the symptoms, but that
is not a satisfactory solution.

This is on a Sun4 (Sun3's have also exhibited the problem) running SunOS
4.1.1.  Elm version 2.4 pl 21.  Our MTA is zmailer 2.2.  our mailboxes are
in a central /usr/spool/mail, which is NFS-mounted everywhere.  (The mail
machine is also a sun 4)  As per the suggestions in Configure, we have
enabled all three forms of locking: "USE_DOTLOCK_LOCKING (.lock)
USE_FLOCK_LOCKING USE_FCNTL_LOCKING".  I also used gcc 2.3.3 when building.

Our mail/news server is rather heavily loaded, so I'm not convinced that elm
is the problem.  Also, our last version of elm also had all three locking
methods enabled.  However I did just install the new version, so I thought
that the possibility should be investigated.  Has something similar happened
to you?  If so, please email me your solution.  I'd also like to hear from
someone who has a site set-up similar to ours, who does *not* have any such
problems.  Can you mail me your 'config.sh' file?  

Newsgroups: comp.mail.elm
Subject: Re: elm 2.4 pl21 & locks. (It *really* locks)
Date:	Thu, 11 Mar 1993 22:12:44 -0700

art@cs.UAlberta.CA (Art Mulder) writes:

>These past few days we've had problems with elm just locking up on people.
...

as a brief follow up to this plea for help.

I have become more convinced that elm and the way it locks mailboxes is the
source of our problems.  For these reasons:  On another machine at our site,
running an older version of elm, I can read my mail, edit, delete, resynch my
folder, etc with no problems at all.  meanwhile, back on my sun workstation,
elm is still locked up in never never land.

This other machine is a MIPS M120-5, RiscOS 5.0, running elm 2.4 pl5, but
only using dotlock locking.  It accesses mailboxes in the same nfs-mounted
directory as all our other machines.

---cut here---