Re: [squid-users] Squid keeps rotating.

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Fri, 06 Jun 2008 00:57:14 +1200

Angela Williams wrote:
> Hi!
> On Thursday 05 June 2008, Amos Jeffries wrote:
>> Indunil Jayasooriya wrote:
>>>> In my squid.conf I have edited the line logfile_rotate 0
>>>> so this should prevent squid from changing access.log to access.log.1
>>> That's true
>>>
>>>> However for some reason it keeps doing that. Squid needs to write to
>>>> /var/log/squid/access.log since that is a named pipe that has a text
>>>> processor behind it. Any idea why Squid is still doing this ?
>>> How's /etc/logrotate.d/squid file. this is JUST one .
>>>
>>>
>>> Example of /etc/logrotate.d/squid
>>>
>>> /var/log/squid/access.log {
>>> daily
>>> rotate 4
>>> copytruncate
>>> compress
>>> notifempty
>>> missingok
>>> }
>>>
>>> /var/log/squid/cache.log {
>>> daily
>>> rotate 4
>>> copytruncate
>>> compress
>>> notifempty
>>> missingok
>>> }
>>>
>>> /var/log/squid/store.log {
>>> daily
>>> rotate 4
>>> copytruncate
>>> compress
>>> 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
>>> }
>>>
>>> As you can see, I use the /usr/sbin/squid -k rotate command to let
>>> squid rotate his logs. You can issue this command everytime you feel
>>> the need to.
>> Does anyone have working experience with this?
>
> Just a bit!
>
>> I'm wondering if the above works and want to find out why. Because last
>> time I trusted logrotate like this. It renumbered the logs on me. Then
>> squid -k rotate did it again. Which resulted in twice as many logs and
>> every second one being empty.
>
> I sat and puzzled over this a few times!
> I ended up with a cronscript to do my sarg stuff and then tell squid to rotate
> its logs itself! The extra puzzling thing is that a few of my squid server
> boxes worked correctly with the above logrotate script and logfile_rotate 0
> in the squid.conf. Each server is pretty much configured the same with Gentoo
> and regular updates. I even tried telling logrotate to rotate 10 and squid 5
> to try and get a handle on it! I just gave up and used my sarg cronscript!

Ah, memories :-)

I'm just wondering if anyone knows enough to say why it works when it does.

Amos

-- 
Please use Squid 2.7.STABLE1 or 3.0.STABLE6
Received on Thu Jun 05 2008 - 12:57:20 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 05 2008 - 12:00:02 MDT