From owner-freebsd-stable@FreeBSD.ORG Sat Nov 26 01:12:45 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 21AA916A41F for ; Sat, 26 Nov 2005 01:12:45 +0000 (GMT) (envelope-from hk@alogis.com) Received: from alogis.com (firewall.solit-ag.de [212.184.102.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5209543D62 for ; Sat, 26 Nov 2005 01:12:44 +0000 (GMT) (envelope-from hk@alogis.com) Received: from alogis.com (localhost [127.0.0.1]) by alogis.com (8.13.1/8.13.1) with ESMTP id jAQ1CeRe085445; Sat, 26 Nov 2005 02:12:40 +0100 (CET) (envelope-from hk@alogis.com) Received: (from hk@localhost) by alogis.com (8.13.1/8.13.1/Submit) id jAQ1CdIv085444; Sat, 26 Nov 2005 02:12:39 +0100 (CET) (envelope-from hk) Date: Sat, 26 Nov 2005 02:12:39 +0100 From: Holger Kipp To: "Dan O'Connor" Message-ID: <20051126011239.GB84800@intserv.int1.b.intern> References: <200511250845.43542.distro.watch@msa.hinet.net> <007601c5f221$b0d9e640$0599460a@Dan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <007601c5f221$b0d9e640$0599460a@Dan> User-Agent: Mutt/1.4.2.1i Cc: freebsd-stable@freebsd.org Subject: Re: Rotating web server logs without restarting Apache X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Nov 2005 01:12:45 -0000 On Fri, Nov 25, 2005 at 04:38:14PM -0800, Dan O'Connor wrote: > >Every time my httpd-access.log file is rotated I need to restart > >Apache, otherwise it won't write into the new httpd-access.log file. > > In /etc/newsyslog.conf: > > /var/log/httpd-access.log 644 4 100 * J > /var/run/httpd.pid 30 > /var/log/httpd-error.log 644 4 100 * J > /var/run/httpd.pid 30 > > This will signal apache to do a graceful restart following a log > rotation... Don't compress those files in this case! For a comprehesive explanation see http://www.freebsddiary.org/rotatelogs.php but it boils down to the following: if sending SIGUSR1 to apache, not all children might have finished writing to the log files immediately, so the file might still be written to (it was not copied, but merely renamed by newsyslog) for some time (depending on the requests, client bandwidth, delays etc. this might be a few minutes for http-connections to finish). Regards, Holger Kipp alogis AG, Berlin