Re: exim can hold mainlog files open for a long time .....

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Piete Brooks
Ημερομηνία:  
Προς: Philip Hazel
Υ/ο: exim-users
Καινούρια Θέματα: Segmentation fault in file lookups
Αντικείμενο: Re: exim can hold mainlog files open for a long time .....
>> A simple stat() would show that the inode number of the file hasn't changed.
> Is stat() more expensive than time()?


I suspect that it's fairly likely that I can answer that for most (all ?)
systems ... Yes.
It may not be much, so some people may tailor the time to be 0 ...

> That is what it seems to come down to.


It is configuable !

> Either stat() for each log write to see if the file has changed,


... by setting the interval to 0 ...

> or check the time()


Yup.

> and close/reopen after a certain period


No -- I meant
    IF   time expired
    AND  stat shows that the filke has moved
    AND  open of the file works
    THEN replace the old fd with the new


> (possibly only after a stat() to double-check).


Not "double check" -- nearly every time stat will show that there is no need.

> Use of stat()


*every* time

> would ensure that *no* further writes were done after the file has been
> mv-ed (apart from anything that is actually in progress at the time of the
> mv).


well, could be "stat", then "mv", then "write", but yes -- unlikley.