Steve McWilliams <[EMAIL PROTECTED]> writes: > I looked more closely at what is happening and actually the log file > IS being truncated by logrotate, however as soon as the logging process > writes to the log file again it is restored to it's original size and > grows from there again. The original content of the file is sometimes > garbled however, up to the point where it was truncated, which I hadn't > noticed originally. [...] > If this is the case then I don't see any purpose for the copytruncate > option here at all actually.
This area is underdocumented, but I ran a few tests:
(while true; do sleep 1; date; done) > mylog
The file will grow always, truncating just zeros what was there
already.
(while true; do sleep 1; date; done) >> mylog
Truncation works as expected.
So I think your program must open the log with O_APPEND and everything
should run dandy. Logfiles should probably always be opened this way,
i.e. failure to do so can be construed as a bug.
--
Robbe
signature.ng
Description: PGP signature

