On Wed, 22 Sep 2010 13:49:01 -0300, Sergio Belkin <seb...@gmail.com>
wrote:
> 2010/9/22 Amos Jeffries <squ...@treenet.co.nz>:
>> On 23/09/10 03:06, Sergio Belkin wrote:
>>>
>>> 2010/9/16 Amos Jeffries<squ...@treenet.co.nz>:
>>>>
>>>> On 17/09/10 01:46, Sergio Belkin wrote:
>>>>>
>>>>> 2010/9/16 Peter Albrecht<albre...@opensourceservices.de>:
>>>>>>
>>>>>> Hi Sergio,
>>>>>>
>>>>>>> I use squid squid-2.6.STABLE21-3.el5 on CentOS 5.4. The problem is
>>>>>>> that squid can't be restarted and "rotate" isnt working, I mean
log
>>>>>>> rotating is done but I have to start  the service by hand.
>>>>>>>
>>>
>>> I think that I found the cause of problem. Since I was rotating on a
>>> different times each log, only executed "squid -k rotate" when it
>>> rotated the store.log, but it didn't when it made the access.log and
>>> cache log. So I've append
>>> postrotate
>>>       /usr/sbin/squid -k rotate
>>>     endscript
>>>
>>> at the end of both access.log and cache.log sections.
>>>
>>
>> Careful that this does not make squid overwrite log data.
>>
> 
> Why do you say that? Could that happen? Stupid question:  What does
> 'squid -k rotate' really do?

It:
  schedules helpers to restart and release their cache.log connections
  renames all log files N to N+1 (for logfile_rotate number of files)
  releases the log file descriptors
  re-opens the un-numbered log files
  begin writing again from the file start

With logfile_rotate set at 0 and logrotate.d calling -k rotate from two
differently timed actions you likely end up with access.log being rotated
by rotate.d then *both* logs released and re-started by squid. This is not
as bad as the opposite case when access.log gets reset by cache.log
rotation.

Amos

Reply via email to