Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2004 16:48:04 -0400
From:      Garance A Drosehn <gad@FreeBSD.org>
To:        Garance A Drosehn <gad@FreeBSD.org>
Cc:        current@FreeBSD.org
Subject:   Re: Minor HEADSUP - "New order" for newsyslog
Message-ID:  <p06020464bcf116ef03f1@[128.113.24.47]>
In-Reply-To: <p06020462bcf0fce1e891@[128.113.24.47]>
References:  <p06020462bcf0fce1e891@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p06020464bcf116ef03f1>