Bug 64321 - rotatelogs: preserve log messages in case of rotation
Summary: rotatelogs: preserve log messages in case of rotation
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: support (show other bugs)
Version: 2.4.43
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Depends on:
Reported: 2020-04-07 11:39 UTC by jlp72
Modified: 2020-04-07 11:39 UTC (History)
0 users

patch for rotatelogs - 2.4.43 (2.12 KB, patch)
2020-04-07 11:39 UTC, jlp72
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jlp72 2020-04-07 11:39:05 UTC
Created attachment 37153 [details]
patch for rotatelogs - 2.4.43

I noticed that the ROTATELOGS program loses messages in case you pass the -n option.
For simplicity I indicate FILE_NAME the file passed as input to ROTATE_LOGS.
When I start Apache, rotatelogs always restarts from FILE_NAME even if the last write occurred in the FILE_NAME.x file (with 0 <x <n).
With the proposed modification, carried out on Apache version 2.4.39, the last modified file is checked in chronological order and the process starts in append on that file.

The error is present from version 2.4.37 (probably earlier) to 2.4.43.

In attach the patch obtained from version 2.4.43