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

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Francesco Pasqualini
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] correct way to live update / rebuild dbm lookup db
Thanks,
I'm not sure if the rename is always implemented as an atomic operation....
(probably the link is always implemented as atomic)
but this is not a problem if either the old or the new file is always
available.

Francesco Pasqualini

On 4/26/06, Philip Hazel <ph10@???> wrote:
>
> 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

>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://www.exim.org/eximwiki/
>