From owner-freebsd-current@FreeBSD.ORG Sat Jun 12 20:48:35 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DF3A016A4CE; Sat, 12 Jun 2004 20:48:35 +0000 (GMT) Received: from smtp2.server.rpi.edu (smtp2.server.rpi.edu [128.113.2.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 91B1A43D58; Sat, 12 Jun 2004 20:48:35 +0000 (GMT) (envelope-from gad@FreeBSD.org) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp2.server.rpi.edu (8.12.8/8.12.8) with ESMTP id i5CKm6Vu019572; Sat, 12 Jun 2004 16:48:06 -0400 Mime-Version: 1.0 X-Sender: gad@gilead.netel.rpi.edu (Unverified) Message-Id: In-Reply-To: References: Date: Sat, 12 Jun 2004 16:48:04 -0400 To: Garance A Drosehn From: Garance A Drosehn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Scanned-By: CanIt (www . canit . ca) cc: current@FreeBSD.org Subject: Re: Minor HEADSUP - "New order" for newsyslog X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jun 2004 20:48:36 -0000 At 3:54 PM -0400 6/12/04, Garance A Drosehn wrote: >I have flipped the switch in newsyslog, so it will now use the >"neworder" of performing it's tasks (rotating files, signaling >daemons, compressing files). I have mentioned this change on some other lists (enough that people might be tired of hearing about it), but this is the first time I have mentioned it on this list so maybe I should give a bit more detail. In the old order of things, newsyslog would: find one log to rotate from blah to blah.0 rotate that log signal the matching daemon or process group (if any) waits 10 seconds fork off a separate task to gzip/bzip2 the blah.0 file. find the next log file which needed to be rotated ...repeat... In the new order, it: finds all log files which need to be rotated rotates *all* files which needed to be rotated sends ONE signal to each daemon or process group which is related to any file that had to be rotated. waits 10 seconds (after all signals are sent) does a gzip/bzip2 on each newly-rotated blah.0 file, and after each one does the appropriate chown/chmod/chflag calls. (note that it does not fork off multiple concurrent tasks to do these compressions, so it always behaves as if the 'W' flag has been specified). Assuming I have not made any bugs, the end result should be the same as the end-result in the oldorder, it's just that things are done in a safer order, and any single daemon is sent only one signal (instead of one signal for each log file that needed to be rotated). That last issue is a huge win for people trying to rotate a large number of apache log files, for instance. Really this isn't much of a big deal, except that I did have to reorganize a fair amount of code to implement it. That's why I described my testing-related shell script in my previous message. [I am glossing over a few details here, but this message is probably already longer than anyone cares to read.] -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@FreeBSD.org Rensselaer Polytechnic Institute; Troy, NY; USA