Re: [exim] correct way to live update / rebuild dbm lookup d…

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Francesco Pasqualini
CC: exim-users
Assumpte: Re: [exim] correct way to live update / rebuild dbm lookup db
On Wed, 26 Apr 2006, Francesco Pasqualini wrote:

> what is the correct way to update a dbm (Berkley db usually) lookup db while
> exim is running?


Make a new file, and move it into place using "mv".

> I will use the perl interface to DB_File, do I need to aquire a lock or
> something else to assure that exim4 does not read incorrect information
> while updating the db ?


As Exim is only reading these files in lookups, it doesn't use any
locking.

> Is it safe to rebuild a db with the exim_dbmbuild utility ?


Yes, because exim_dbmbuild makes a new file and then renames it.

> What appen if exim do a lookup while the utility is running ?


It should be OK, because the operating system should ensure integrity
for a rename operation. Either it will see the old file, or it will see
the new one.

-- 
Philip Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book