[squid-users] Re: logrotate with SMP problem !!!

From: Dr.x <ahmed.zaeem_at_netstream.ps>
Date: Mon, 18 Nov 2013 02:12:01 -0800 (PST)

Amos Jeffries-2 wrote
> On 2013-11-18 07:22, Dr.x wrote:
>> Helmut Hullen wrote
>>> Hallo, Dr.x,
>>>
>>> Du meintest am 17.11.13:
>>>
>>>> ive configured squid to be logrotated from script in
>>>> /etc/logrotate.d/squid but ,
>>>> logrotating is not working fine !
>>>
>>> Sorry - "logrotate" works fine, but it works in another way than you
>>> want it to work.
>>>
>>>> as we see , i have access.log.1 ,access.log.2 ,access.log.3
>>>> ................................access.log.6
>>>
>>>> i dont want the numbered values here ,
>>>
>>> Then you need another program than "logrotate".
>>>
>>> Viele Gruesse!
>>> Helmut
>>
>> the same config above works fine on a debian machine os !!!
>> on debian os , no renamed files exist , all are deleted .
>>
>> ive copied the same config !!!!
>>
>
> When you set the directive in squid.conf:
> logfile_rotate 0
>
> Then squid does *NOT* do any log file name changing. All it does is
> close its connection to the logs and open a new connection to the
> un-numbered file.
>
> If you have wrongly set logfile_rotate to a number other than 0 (the
> default is 10 unless you configure it to something else). Or if you have
> wrongly used access.log.${process_number} to create log files then you
> will end up with numbered files.
>
> Note: Debian packages contain hard-coded chanegs that integrate Squid
> with logrotate. Including lgrotate script and squid.conf default
> "logfile_rotate 0".
>
> Check for those two problems. If they do not exist in your squid.conf
> then the problem is outside of Squid. Possibly you have two logrotate
> scripts managing squid log files?
> grep -R "squid" /etc/logrotate.d/
>
> Amos

hi amos,
you are extremelly right !
ive added logfile_rotate 0 directive in squid.conf
and now it working well
here is my test :
[root_at_squid ~]# logrotate -f -v /etc/logrotate.d/squid
reading config file /etc/logrotate.d/squid
reading config info for /var/log/squid/*.log

Handling 1 logs

rotating pattern: /var/log/squid/*.log forced from command line (no old
logs will be kept)
empty log files are rotated, old logs are removed
considering log /var/log/squid/access.log
  log needs rotating
considering log /var/log/squid/cache.log
  log needs rotating
rotating log /var/log/squid/access.log, log->rotateCount is 0
dateext suffix '-20131118'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/squid/access.log.1 to /var/log/squid/access.log.2
(rotatecount 1, logstart 1, i 1),
old log /var/log/squid/access.log.1 does not exist
renaming /var/log/squid/access.log.0 to /var/log/squid/access.log.1
(rotatecount 1, logstart 1, i 0),
old log /var/log/squid/access.log.0 does not exist
log /var/log/squid/access.log.2 doesn't exist -- won't try to dispose of it
rotating log /var/log/squid/cache.log, log->rotateCount is 0
dateext suffix '-20131118'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/squid/cache.log.1 to /var/log/squid/cache.log.2
(rotatecount 1, logstart 1, i 1),
old log /var/log/squid/cache.log.1 does not exist
renaming /var/log/squid/cache.log.0 to /var/log/squid/cache.log.1
(rotatecount 1, logstart 1, i 0),
old log /var/log/squid/cache.log.0 does not exist
log /var/log/squid/cache.log.2 doesn't exist -- won't try to dispose of it
renaming /var/log/squid/access.log to /var/log/squid/access.log.1
disposeName will be /var/log/squid/access.log.1
creating new /var/log/squid/access.log mode = 0640 uid = 500 gid = 4
renaming /var/log/squid/cache.log to /var/log/squid/cache.log.1
disposeName will be /var/log/squid/cache.log.1
creating new /var/log/squid/cache.log mode = 0640 uid = 500 gid = 4
running postrotate script
*removing old log /var/log/squid/access.log.1
removing old log /var/log/squid/cache.log.1*
[root_at_squid ~]# ls -l /var/log/squid/
total 304
-rw-r----- 1 squid adm 305024 Nov 18 05:07 access.log
-rw-r----- 1 squid adm 1945 Nov 18 05:07 cache.log
[root_at_squid ~]# du -sh /var/log/squid/
584K /var/log/squid/

as u see the named files were removed

thanks alot

regards

-----
Dr.x

--
View this message in context: http://squid-web-proxy-cache.1019090.n4.nabble.com/logrotate-with-SMP-problem-tp4663333p4663341.html
Sent from the Squid - Users mailing list archive at Nabble.com.
Received on Mon Nov 18 2013 - 10:18:07 MST

This archive was generated by hypermail 2.2.0 : Mon Nov 18 2013 - 12:00:05 MST