[Dovecot] [IDEA] Re: wierd ssl-parameters.dat regeneration error

Timo Sirainen tss at iki.fi
Sun May 13 20:27:15 EEST 2007


On Sun, 2007-05-13 at 10:07 -0600, Kyle Wheeler wrote:
> On Sunday, May 13 at 09:57 AM, quoth Kyle Wheeler:
> > On Sunday, May 13 at 06:27 PM, quoth Timo Sirainen:
> >> Only one of them needs to regenerate the file. The rest of them should 
> >> just copy it to their login_dir.
> >
> > Hmm, okay. How do they know when the file is fully regenerated?
> 
> Oh! I think I see; file_try_lock() blocks until the lock is obtained 
> or fails, correct?

No. It goes something like this:

 - see if global ssl-parameters.dat's mtime is higher than in login dir
   - if yes, copy the file to login dir preserving its mtime
 - check if login/ssl-parameters.dat's mtime is older than configured
regeneration time
   - if not, try again in 10 mins
 - open ssl-parameters.dat.tmp file
 - try to lock it
    - if it fails someone's already rebuilding it. check again in 10
mins.
 - write the new parameters to the .tmp file
 - rename() .tmp to ssl-parameters.dat
 - copy to login/

So the processes that failed to lock the .tmp file will just copy the
ssl-parameters.dat after 10 minutes.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20070513/62de9e61/attachment.pgp 


More information about the dovecot mailing list