From owner-freebsd-questions Tue Dec 4 11:54: 2 2001 Delivered-To: freebsd-questions@freebsd.org Received: from tao.thought.org (sense-kline-249.oz.net [216.39.168.249]) by hub.freebsd.org (Postfix) with ESMTP id E676237B419 for ; Tue, 4 Dec 2001 11:53:57 -0800 (PST) Received: (from kline@localhost) by tao.thought.org (8.11.3/8.11.0) id fB4Jrh521834; Tue, 4 Dec 2001 11:53:43 -0800 (PST) (envelope-from kline) Date: Tue, 4 Dec 2001 11:53:43 -0800 From: Gary Kline To: Michal Mertl Cc: questions@FreeBSD.ORG Subject: Re: problem with apache log (newsyslog proposal) Message-ID: <20011204115342.C21660@tao.thought.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from mime@traveller.cz on Tue, Dec 04, 2001 at 12:33:02PM +0100 X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: Observing 15 years of service to the Unix community Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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