Skip Menu |

This queue is for tickets about the Logfile-Rotate CPAN distribution.

Report information
The Basics
Id: 65874
Status: new
Priority: 0/
Queue: Logfile-Rotate

People
Owner: Nobody in particular
Requestors: hemingway [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.04
Fixed in: (no value)



I'm considering replacing our use of the system logrotate with this module and have a concern. I believe the correct sequence is; 1. *File::Copy::move* the active file to its new location; 2. execute post steps (as this is where you'd HUP apache etc.) 3. compress the newly rotated file. If (as at the moment) the file is copied, then for a process that retains a handle to its log file (like apache), in the delay between the copy finishing and the post steps executing, the application may well write to the log file, that you then delete. As moving is an atomic operation within the same filesystem on Unix, the application will still have a handle to the newly rotated file and will continue to write there until it is HUPped. Then you need to wait for all processes to relinquich their handles to it, before compressing it. If you agree with this summary, I can create and provide a patch to achieve these changes. (Tho the wait may just be a sleep 10 ;-