Red Hat Bugzilla – Bug 50417
logrotate file for Squid package is bogus
Last modified: 2014-03-16 22:22:13 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.19 i686; en-US; rv:0.9.1)
Description of problem:
The typical logrotate file for the Squid package tries to rotate
individually all the Squid's log files: (/var/log/squid/)access.log,
At the end, it will send a signal to Squid (squid -k rotate) telling it...
to rotate its own logs! :-)
That's wrong. The logs should not be rotated twice (once by logrotate, once
by Squid), but just once is enough.
Steps to Reproduce:
2.Run it for a while
3.Watch the Squid logs
Actual Results: The logs are rotated twice.
Expected Results: The logs should be rotated once.
I suggest replacing /etc/logrotate.d/squid with this file:
# This script asks squid to rotate its logs on its own.
# Restarting squid is a long process and it is not worth
# doing it just to rotate logs
/usr/sbin/squid -k rotate
This way, Squid will take care of its own log files, as it is supposed to
do. Moreover, if one modifies squid.conf and alters the log files
structure, with my solution there is no need to also modify the Squid
logrotate file ;-) because Squid will take care of everything.
I suggest to use this method for every daemon that is capable of rotating
its own logs.
You're misunderstanding how it's set up. squid is set up with 'logfile_rotate 0'
in /etc/squid/squid.conf; hence, when it you call 'squid -k rotate', it's
just telling it to re-open the logs.
I suppose I should change the commentary to reflect this better.