Re: Make squid reopen its logfiles upon a HUP

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 22 Mar 2002 06:31:26 +0100

The authoriative Squid documentation is squid.conf.default, and there
the following is said:

lofgile_rotate

        Specifies the number of logfile rotations to make when you
        type 'squid -k rotate'. The default is 10, which will rotate
        with extensions 0 through 9. Setting logfile_rotate to 0 will
        disable the rotation, but the logfiles are still closed and
        re-opened. This will enable you to rename the logfiles
        yourself just before sending the rotate signal.

        Note, the 'squid -k rotate' command normally sends a USR1
        signal to the running squid process. In certain situations
        (e.g. on Linux with Async I/O), USR1 is used for other
        purposes, so -k rotate uses another signal. It is best to get
        in the habit of using 'squid -k rotate' instead of 'kill -USR1
        <pid>'.

And in the FAQ the following references exists:

  3.8. squid command line options

     -k rotate
        Sends an USR1 signal, which causes Squid to rotate its log
        files. Note, if logfile_rotate is set to zero, Squid still
        closes and re-opens all log files.

and several references that you should be using "squid -k rotate" and
"logfile_rotate" to control your logfile rotation

  6.13. Which log files can I delete safely?
  6.15. My log files get very big!
  6.16. Managing log files

Do we really need more?

But still, we need something in the spirit of your patch. When Squid is
reconfigured it should reopen the logs and restart helpers to ensure the
new configuration is reflected but I would prefer if it is done
similarly to how if is done when rotating the logs rather than a second
approach, except for the actual rotation.

Regards
Henrik Nordström

Damien Miller wrote:
>
> On Thu, 21 Mar 2002, Duane Wessels wrote:
>
> > I don't understand.
> >
> > Why is it not sufficient to set log_rotate to zero and use
> > the normal log rotation signal (squid -k rotate)?
>
> I didn't know about this - perhaps you should consider mentioning it in
> the FAQ.
>
> -d
Received on Thu Mar 21 2002 - 22:29:59 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:52 MST