Bug 50417 - logrotate file for Squid package is bogus
logrotate file for Squid package is bogus
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: squid (Show other bugs)
7.1
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-30 21:49 EDT by Florin Andrei
Modified: 2014-03-16 22:22 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-30 21:49:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Florin Andrei 2001-07-30 21:49:32 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.19 i686; en-US; rv:0.9.1)
Gecko/20010608

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,
cache.log, store.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.

How reproducible:
Always

Steps to Reproduce:
1.Install Squid
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.

Additional info:

I suggest replacing /etc/logrotate.d/squid with this file:

/var/log/squid/bogus_file {
    notifempty
    missingok
# 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
    postrotate
      /usr/sbin/squid -k rotate
    endscript
}

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.
Comment 1 Bill Nottingham 2001-07-30 22:18:52 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.