Re: logfile daemon stuff

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Wed, 09 Aug 2006 00:46:52 +0200

tis 2006-08-08 klockan 17:29 +0800 skrev Adrian Chadd:

> * Reimplement logfile-daemon.c to not use stdio. I've noticed via strace
> that the Linux stdio implements its reading using one-byte read()s.

That depends on your stdio buffer setting. To get bigger reads you need
block/full buffering on stdin. Default for pipes and terminals is
unbuffered.

One note: I assume you do know that ipcCreate() currently redirects
stderr to cache.log at the time the ipc channel is created. This is why
all helpers is restarted on "squid -k rotate".

I think it would be a good idea to change this to have stderr from
helpers returned back to Squid, who then logs it to the debug log.. This
would allow us to not restart helpers on "squid -k rotate".

This is currently a little problem in setups using unlinkd, as the
initial cache.log then gets locked by the unlinkd process which is never
restarted. If I am not mistaken your new log helper shares this
property.. Not a big deal on UNIXes as there the file becomes anonymous
when the last name goes away, but not all platforms is this forgiving in
handling renames/delete of open files..

Regards
Henrik

Received on Tue Aug 08 2006 - 16:46:58 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Sep 01 2006 - 12:00:03 MDT