Sample Header Ad - 728x90

Apache 2.4 keeps writing in old log file despite logrotate restart

0 votes
0 answers
153 views
I am using **logrotate** on **RHEL 9** to rotate access logs of an Apache 2.4 (actually IBM HTTP Server) running as root. The config I use is a series of the following for each access.log file: /logs/access.log { compress dateext maxage 60 rotate 99 daily notifempty missingok postrotate /bin/apachectl restart /bin/sleep 10|/bin/true endscript } However, after the rotation (and the postrotate action) the apache process seems to keep writing to the previous file /logs/access-.log *(the file inode to be honest)*, which now is deleted from compression action. The apache process starts writing to the original file /logs/access.log again only when running /bin/apachectl restart from cli. I have tried all possible combinations *(e.g. delaycompress, group all access files in one config and set sharedscripts etc)* on how to resolve this, except copytruncate, which I would like to avoid.
Asked by trikelef (460 rep)
Dec 10, 2024, 02:01 PM
Last activity: Dec 10, 2024, 02:49 PM