Re: [squid-users] FW: FATAL: logfileWrite: /var/log/squid/access.log: (32) Broken pipe

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Wed, 29 Jan 2014 18:54:17 +1300

On 29/01/2014 6:28 p.m., üÍÉÒ wrote:
>
>
> Attached squid conf and squid log
>
> From: üÍÉÒ
> Hello,
>
>
>
> I need to disable Squid LogRotation function, this option periodically
> kills squid (.
>
> Traditional ways to disable log rotation do not help. I tried many ways.
>
> Deleted squid - rm /etc/logrotate.d/squid,
>
> added log_rotate 0 to squid.conf
>
> All this does not help I cant disable squid log rotation procedure :(
>
>
>
> storeDirWriteCleanLogs: Starting...
>
> FATAL: logfileWrite: /var/log/squid/access.log: (32) Broken pipe
>

?? you dont have any such log file in your squid.conf. It says
/var/log/squid/traffpro.log instead.

Perhapse you have some other Squid instance running or some other
squid.conf file being used?

>
>
> Logs writing in /var/log/squid/access.log then TraffPro take it to MySQL and
> keeps clean access.log.

How is TraffPro doing that? if it is taking the log file out from
underneath a Squid which is actively writing to it there could indeed be
trouble. It is possible, but not always done right.

>
> But the problem is, squid wants to clean logs as you see:
>
> storeDirWriteCleanLogs: Starting...
>
> Then he cant do it and falls down:
>
> FATAL: logfileWrite: /var/log/squid/access.log: (32) Broken pipe
>

What Squid does here with logfile_rotate set to 0 is close all the file
handle(s) it has open for writing to the log. Then open a new one(s) to
the same file.

> I need to disable logrotate in squid or cut rotate function from default
> build squid from src (if you had manual how to cut LogRotate function from
> src, and build default squid but without Log Rotate please show me how)

Log rotation is not automatic. It is done by Squid only when a signal is
delivered by an external command such as "squid -k rotate".

TraffPro should be initiating that signal somehow once it has moved the
log file to a new name (so Squid re-open creates a new file with
original name) and before it starts doing anything with the log contents
(so any last-second Squid data writes will be finished and in the file).

It is no use Squid continuing to write to the old log file handle after
TraffPro has taken it away and potentially deleted all or part of it. Or
for Squid to re-opening the same file which is about to be cleared by
TraffPro. The error you see may be the result of either of those happening.

PS. Is there anything particularly special TraffPro is doing with the
log data? The latest releases of Squid are bundled with a helper daemon
that can log straight to a SQL database in realtime.

Amos
Received on Wed Jan 29 2014 - 05:54:35 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 29 2014 - 12:00:06 MST