From owner-freebsd-hackers Fri Dec 22 00:46:18 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id AAA13721 for hackers-outgoing; Fri, 22 Dec 1995 00:46:18 -0800 (PST) Received: from omega.physik.fu-berlin.de (omega.physik.fu-berlin.de [130.133.3.51]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id AAA13282 for ; Fri, 22 Dec 1995 00:32:59 -0800 (PST) Received: from julia.physik.fu-berlin.de (julia.physik.fu-berlin.de [130.133.3.235]) by omega.physik.fu-berlin.de (8.7.1/8.7.1) with ESMTP id JAA10244; Fri, 22 Dec 1995 09:32:38 +0100 (MET) Received: (from graichen@localhost) by julia.physik.fu-berlin.de (8.6.12/8.6.12) id JAA26432; Fri, 22 Dec 1995 09:32:37 +0100 From: Thomas Graichen Message-Id: <199512220832.JAA26432@julia.physik.fu-berlin.de> Subject: Re: weekly/monthly logs rotating idea (commit candidate) To: ache@astral.msk.su Date: Fri, 22 Dec 1995 09:32:36 +0100 (MET) Cc: hackers@freebsd.org X-Mailer: ELM [version 2.4 PL23] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org Precedence: bulk hasn't =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= said ? ... > > Current logs rotating code > ... > if [ -f $i.1 ]; then mv -f $i.1 $i.2; fi > if [ -f $i.0 ]; then mv -f $i.0 $i.1; fi > if [ -f $i ]; then mv -f $i $i.0; fi > >$i > isn't good for daemons, because thet keep log descriptor open. > It means that daemon_log moved to daemon_log.0 and diagnostics > still writted to daemon_log.0! New daemon_log leaves zero-sized > until reboot. > > What I suggest: > > if [ -f $i.0 ]; then mv -f $i.0 $i.1; fi > if [ -f $i ]; then cp -fp $i $i.0; fi > >$i > > It means that you copy log preserving file times and then > zero the same descriptor. > > If I not see objections with explanations, I plan to commit it. > i plan to commit newsyslog from NetBSD which does all the rotation automatically - you may configure it using /etc/newsyslog.conf you may get my test-package from freefall ~graichen/misc/review.tgz or via ftp from dirac.physik.fu-berlin.de:/pub/freebsd/misc/review.tgz please look at it and send me all problems you find with it - i asked around in hackers if there are any contra's to committing it - but i got only pro's :-) i plan to commit it between christmas and new year - if anybody will test it before t _______________________________________________________||___________________ __|| Perfection is reached, not when there is no __|| thomas graichen longer anything to add, but when there __|| freie universitaet berlin is no longer anything to take away __|| fachbereich physik __|| - Antoine de Saint-Exupery - __|| graichen@mail.physik.fu-berlin.de ___________________________||__________________graichen@FreeBSD.org_________