From owner-freebsd-stable Sat Jul 6 20:38:29 2002 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 8975D37B400; Sat, 6 Jul 2002 20:38:27 -0700 (PDT) Received: from mail-relay1.yahoo.com (mail-relay1.yahoo.com [216.145.48.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id 482BC43E31; Sat, 6 Jul 2002 20:38:27 -0700 (PDT) (envelope-from DougB@FreeBSD.org) Received: from FreeBSD.org (12-234-90-219.client.attbi.com [12.234.90.219]) by mail-relay1.yahoo.com (Postfix) with ESMTP id B40D18B5D8; Sat, 6 Jul 2002 20:38:26 -0700 (PDT) Message-ID: <3D27B7B2.1B8EEE9B@FreeBSD.org> Date: Sat, 06 Jul 2002 20:38:26 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.79 [en] (X11; U; FreeBSD 4.5-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Nuno Teixeira Cc: Maxim Konovalov , freebsd-stable@FreeBSD.ORG Subject: Re: cvs commit: src/usr.sbin/newsyslog newsyslog.c References: <200207011244.g61CiG3Y013597@freefall.freebsd.org> <20020707022423.GA51424@gw.tex.bogus> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Nuno Teixeira wrote: > Does this mean that now I can use newsyslog to compress apache logs? The problem with newsyslog and things like apache and named is that the process continues writing to the file after you mv it. The proper procedure for such processes is: mv logfile logfile.old hup process (process creates and starts writing to new log) compress logfile.old That way you don't lose anything. Since it's designed to work with syslogd, what newsyslog does is: mv logfile logfile.old (syslogd stops writing to logfile) compress logfile.old create logfile hup syslogd That works fine for syslog, but wreaks havoc with things like apache and named. There is a ${PREFIX}/sbin/rotatelogs script that comes with apache, you should take a look at that and modify it to suit your needs. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message