Date: Tue, 4 Dec 2001 11:53:43 -0800 From: Gary Kline <kline@tao.thought.org> To: Michal Mertl <mime@traveller.cz> Cc: questions@FreeBSD.ORG Subject: Re: problem with apache log (newsyslog proposal) Message-ID: <20011204115342.C21660@tao.thought.org> In-Reply-To: <Pine.BSO.4.21.0112041116090.5444-100000@prg.traveller.cz>; from mime@traveller.cz on Tue, Dec 04, 2001 at 12:33:02PM %2B0100 References: <Pine.BSO.4.21.0112041116090.5444-100000@prg.traveller.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Dec 04, 2001 at 12:33:02PM +0100, Michal Mertl wrote: > The reason you couldn't realiably compress apache's logfiles is that after > renaming the log, the daemon process still writes to the old log file. > > Details: When you make it reopen the log (by sending USR1) new connections > (ones handled with children who have already restarted) get logged to the > new file. The ones which started before the signal was delivered are > logged to the old file. With HUP delivered to master apache process the > children are rather abruptly killed (thus all new log entries go the the > new file). If you don't mind killing some downloads from your site > (clients get only partial downloads) sending HUP should enable you to > compress the logs. If you don't like interrupted downloads (imagine 10MB > file over 56k modem interrupted at 9MB (client looses ~22 minutes) and > want to compress the logs, you can either compress them separately from > rotation much later (~hours to be sure) or you can rotate using some > script which monitors if the old log file is still open by some children > and start the compression only after there's no such children. I have > small script for that if someone is interested. > > I think there can be flag in newsyslog to make it check if there's a > process which has open the file which is to be compressed and postpone the > compression until either no such child exists or some timeout is hit. If > anyone thinks it's a good idea, I can try to implement that functionality. > > Thanks for the in-depth insights here. I think it would be great to have a flag that would [gb]zip or wait some -t N seconds. (Yes, diskspace is getting inexpensive (&c), but some of us are wedged with older hardware.... ) gary -- Gary Kline kline@thought.org www.thought.org Public service Unix To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011204115342.C21660>