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

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Nigel Metheringham
日付:  
To: Philip Hazel
CC: Piete Brooks, exim-users
題目: Re: exim can hold mainlog files open for a long time .....

ph10@??? said:
} Is stat() more expensive than time()? That is what it seems to come
} down to. Either stat() for each log write to see if the file has
} changed, or check the time() and close/reopen after a certain period
} (possibly only after a stat() to double-check).

stat() is a cheap operation in contxt - you don't really log stuff
*that* often.
Just save the inode number, and each time you log stat and check that
the file still has that inode.

Alternatively, just always close and open when you need to write.
Not sure how much that would cost you... A short test perl script
might be in order here :-)

} Use of stat() 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).

OK, so a few second window worst case.  That I can certainly live 
with.
-- 
[ Nigel.Metheringham@???   - Unix Applications Engineer ]
[ *Views expressed here are personal and not supported by PLAnet* ]
[ PLAnet Online : The White House     Tel : +44 113 2345566 x 612 ]
[ Melbourne Street, Leeds LS2 7PS UK. Fax : +44 113 2345656       ]