Re: exim-0.41 first look - db locking problems

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Nigel Metheringham
日付:  
To: Philip Hazel
CC: Neal Becker, exim-users
題目: Re: exim-0.41 first look - db locking problems
Regarding this blast from the past...

} > 3.  I tried sending mail to a remote.  It was sent, but I also got
} >     'Sleeping for dbm lock: try again' and finally 'failed to get
} >     write lock for /var/spool/exim/db/wait-smtp'.  No other exim could
} >     have been running at this time.
} >     /var/spool/exim/db/wait-smtp.{dir,pag} exist, have owner exim,
} >     group exim, and are mode 640.  On Linux we have used gdbm in place
} >     of ndbm (the default setup on exim-0.41, which is based on
} >     comments about linux that are now obsolete BTW, but gdbm should
} >     work). 
} 
} This is not something anybody else has had a problem with, so I'm as 
} mystified as you are. The code in db.c is pretty simple; it is just 
} trying to get an fcntl() lock. Exim must already have successfully 
} opened the dbm file for it to have got to the stage of trying to lock 
} it. I suspect some problem with dbm_dirfno() or dbm_pagfno(), whichever 
} is in use. Incidentally, which are the obsolete comments? The most 
} recent changes I put in for Linux came from someone who was talking 
} about "the latest Linux libraries". 


I just hit this problem having upgraded (to Red Hat 3.0.3).

What has happened is that the ndbm.h header file uses the ndbm
compatiblity code of the Berkeley db code. However exim is linked
against the gdbm library functions!

If this is changed so that you link against -ldb rather than -lgdbm
then it works OK... however the Berkeley db stuff, uses *one* file
with a .db extension rather than 2 (.dir/.pag) files, so exim_buildb
will fail.

I think the best solution is to ditch dbm compatibility and rewrite
to Berekeley db, which is available on all usable platforms, handles
locking correctly (the others go do extreme lengths to break locking
schemes :-), and is faster than anything else in the known universe
(probably), as well as having just one data file which is *much*
cleaner....

There are bindings for Perl (v5 only) as well!

    Nigel.



-- 
[ Nigel.Metheringham@???   - Unix Applications Engineer ]
[ *Views expressed here are personal and not supported by PLAnet* ]
[ PLAnet Online : The White House     Tel : +44 113 2345566 x 612 ]
[ Melbourne Street, Leeds LS2 7PS UK. Fax : +44 113 2345656       ]