pfSense Support Subscription

Author Topic: squid3 access.log rotation  (Read 3510 times)

0 Members and 1 Guest are viewing this topic.

Offline Cino

  • Hero Member
  • *****
  • Posts: 1051
  • Karma: +0/-0
    • View Profile
squid3 access.log rotation
« on: February 01, 2012, 11:58:41 am »
Maybe I'm looking at this all wrong because of experience with sqiud2. But I can't seem to get squid3 to rotate the access.log file.

I have "logfile_rotate 1" in the squid.conf file and there is cron job to rotate the log. I've even manually ran /usr/local/sbin/squid -k rotate

Any ideas?

What is everyone else doing for their squid3 log rotation and retention?

Offline Cino

  • Hero Member
  • *****
  • Posts: 1051
  • Karma: +0/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #1 on: February 05, 2012, 09:51:19 am »
No one using squid3 out there? I can't be the only one

Offline marcelloc

  • Hero Member
  • *****
  • Posts: 9995
  • Karma: +3/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #2 on: February 06, 2012, 07:13:21 am »
Hi cino,

I think there maybe a missing conf on bsd rotate scripts(if any on pfsense)

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590833


Offline Cino

  • Hero Member
  • *****
  • Posts: 1051
  • Karma: +0/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #3 on: February 06, 2012, 12:53:59 pm »
Thanks Marcelloc! I take a look and see if maybe I can copy it over to my box

Stephen

Offline Cino

  • Hero Member
  • *****
  • Posts: 1051
  • Karma: +0/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #4 on: February 06, 2012, 02:33:48 pm »
I went ahead and installed logrotate and that seem to do the trick.. just have to tweak it now... thank you again!  

I somewhat followed this how-to http://teklimbu.wordpress.com/2007/10/16/managing-your-linuxunix-log-files-using-logrotate/  

now i just to make sure it doesn't lose data when LightSquid runs

Stephen
« Last Edit: February 06, 2012, 02:46:04 pm by Cino »

Offline atpoirie

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #5 on: February 17, 2012, 02:48:57 pm »
I tried changing the permissions on the log files chmod 777 /var/squid/logs/* and then did squid -k rotate and it was able to rotate. 

Since everything is owned by user proxy it looks like the squid user doesn't have permission to create and move files in /var/squid

Offline Cino

  • Hero Member
  • *****
  • Posts: 1051
  • Karma: +0/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #6 on: February 19, 2012, 08:54:55 am »
thanks apoirie!! Not sure if I had tried that already but i'll give it a shot.. If this works, I'll probably keep logrotate in place for now since i have it setup to keep 90days of web logs, 7 days of cache.log and setup for squidguard also.

Offline atpoirie

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #7 on: March 01, 2012, 06:50:02 am »
The permission change worked initially, but there appears to be something else going wrong with rotating the log files.  My current speculation is that it has something to do with the size of the log file that is getting rotated as mine can easily hit 1Gb in size in a day.

Offline atpoirie

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: squid3 access.log rotation
« Reply #8 on: March 01, 2012, 07:23:22 am »
Something that worked this time, who knows why.  I stopped the squid service and then started it using
Code: [Select]
squid -d 9 to get it to log what was going on to the console.  In a separate console I ran
Code: [Select]
squid -k rotate and then it worked without error.  No idea why that would make any difference.

***EDIT****
Found same thing was occurring on a second pfsense box, same version, same installed add-ons, much less traffic.  Did the commands listed above and rotate finally worked again.  I'm also killing the squid -d 9 process that I started for doing the log rotation and starting squid again through the web console.
« Last Edit: March 01, 2012, 09:27:47 am by atpoirie »