From owner-freebsd-stable Sun Jul 7 1:41: 8 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 9306637B400 for ; Sun, 7 Jul 2002 01:41:05 -0700 (PDT) Received: from mailout07.sul.t-online.com (mailout07.sul.t-online.com [194.25.134.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2666C43E4A for ; Sun, 7 Jul 2002 01:41:04 -0700 (PDT) (envelope-from nicolas@dauerreden.de) Received: from fwd06.sul.t-online.de by mailout07.sul.t-online.com with smtp id 17R7bJ-0007up-07; Sun, 07 Jul 2002 10:41:01 +0200 Received: from pc5.abc (520067998749-0001@[217.233.75.206]) by fmrl06.sul.t-online.com with esmtp id 17R7b4-29VWD2C; Sun, 7 Jul 2002 10:40:46 +0200 Received: from pc5.abc (localhost.abc [127.0.0.1]) by pc5.abc (8.12.3/8.12.3) with ESMTP id g678eiXP019243 for ; Sun, 7 Jul 2002 10:40:44 +0200 (CEST) (envelope-from nicolas@pc5.abc) Received: (from nicolas@localhost) by pc5.abc (8.12.3/8.12.3/Submit) id g678eigv019242 for freebsd-stable@FreeBSD.ORG; Sun, 7 Jul 2002 10:40:44 +0200 (CEST) Date: Sun, 7 Jul 2002 10:40:44 +0200 From: Nicolas Rachinsky To: freebsd-stable@FreeBSD.ORG Subject: Re: cvs commit: src/usr.sbin/newsyslog newsyslog.c Message-ID: <20020707084044.GA19140@narr.dauerreden.de> Mail-Followup-To: freebsd-stable@FreeBSD.ORG References: <200207011244.g61CiG3Y013597@freefall.freebsd.org> <20020707022423.GA51424@gw.tex.bogus> <3D27B7B2.1B8EEE9B@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D27B7B2.1B8EEE9B@FreeBSD.org> User-Agent: Mutt/1.3.28i X-Powered-by: FreeBSD X-Homepage: http://www.rachinsky.de X-PGP-Keyid: C11ABC0E X-PGP-Fingerprint: 19DB 8392 8FE0 814A 7362 EEBD A53B 526A C11A BC0E X-PGP-Key: http://www.rachinsky.de/nicolas/nicolas_rachinsky.asc X-Sender: 520067998749-0001@t-dialin.net 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 * Doug Barton [2002-07-06 20:38 -0700]: > 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 newsyslog in 4.6 RELEASE does: mv logfile logfile.old touch logfile hup daemon sleep(10) compress BTW I just mv'd some of my logfiles, syslogd is happily continuing to write to them. > 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 I don't think so. > 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. It wouldn't work for syslog. Nicolas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message