[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hosting control panel

Craig Sanders wrote:
> you need to make it an atomic operation, anyway as is good practice when
> updating any postmap-able file. you do that by generating a tmp file and
> only mv-ing it into place if everything's OK.

Yes, makes things more reliable. That being said, over 3 years using a
non atomic system, there was no issue. Exept when the hard drive is
full, I see no way how a script that dumps from MySQL to file would fail
"sometimes". That would be a very badly written script. By the way this
is in our todo to make all operations in the cron being atomic. Wouldn't
be very hard to do anyway...

> btw, it's also useful to only update the postmap file IF the database
> has changed (in order to avoid making postfix reload its maps
> unneccessarily). that's easy to do with postgres, because you can set
> up a trigger to update a timestamp whenever a database record changes
> (UPDATE, DELETE, or INSERT), then check the timestamp before you
> regenerate the map files. mysql doesn't do triggers.

We resolved that by having a flag in the database. Whenever it's switch
to yes, the file get generated (by the cron launched every 10 minutes).
You just need to


Reply to: