Minor HEADSUP - "New order" for newsyslog

Garance A Drosehn gad at FreeBSD.org
Sat Jun 12 20:48:36 GMT 2004

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

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 at gilead.netel.rpi.edu
Senior Systems Programmer               or   gad at FreeBSD.org
Rensselaer Polytechnic Institute;             Troy, NY;  USA

More information about the freebsd-current mailing list