From owner-freebsd-questions Sat Apr 1 12:41:28 2000 Delivered-To: freebsd-questions@freebsd.org Received: from europe.std.com (europe.std.com [199.172.62.20]) by hub.freebsd.org (Postfix) with ESMTP id DAD6737B569 for ; Sat, 1 Apr 2000 12:41:26 -0800 (PST) (envelope-from lowell@world.std.com) Received: from world.std.com (lowell@world-f.std.com [199.172.62.5]) by europe.std.com (8.9.3/8.9.3) with ESMTP id PAA09843; Sat, 1 Apr 2000 15:41:24 -0500 (EST) Received: (from lowell@localhost) by world.std.com (8.9.3/8.9.3) id PAA15292; Sat, 1 Apr 2000 15:41:23 -0500 (EST) To: Arcady Genkin , freebsd-questions@freebsd.org Subject: Re: Rotating apache logs (new logs don't appear) References: <874s9ly5k5.fsf@tea.thpoon.com> From: Lowell Gilbert Date: 01 Apr 2000 15:41:23 -0500 In-Reply-To: Arcady Genkin's message of 01 Apr 2000 14:39:06 -0500 Message-ID: Lines: 21 X-Mailer: Gnus v5.5/Emacs 20.2 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Arcady Genkin writes: > I've set up a cron job to rotate apache access and error logs, but > suspect that there's a fault with my script. [...] > I suspect that perhaps apache keeps track of the log file as a file > descriptor and doesn't check if the file needs to be re-created when > trying to write to it, but I might be wrong. No, you're exactly right. You need to tell Apache when you're moving the files out from under it. [This is documented in the Apache manuals, which is where I figured it out from.] You need to send a SIGHUP to Apache at the right time. I use newsyslog(8) for this, with the relevant line being: /var/log/httpd-access.log 644 4 100 336 Z /var/run/httpd.pid but if you really need to write your own script, you'll have to use kill(1) to do so. For the record, I recommend using newsyslog if you can. Be well. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message