Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Nov 2006 18:02:35 -0400
From:      Garance A Drosehn <gad@FreeBSD.org>
To:        Curtis Jewell <swordsman@csjewell.fastmail.us>, questions@FreeBSD.org
Subject:   Re: Apache log rotation question...
Message-ID:  <p06240828c17168598b6a@[128.113.24.47]>
In-Reply-To: <20061104043357.S4041@lap.curtisjewell.boldlygoingnowhere.org>
References:  <20061104043357.S4041@lap.curtisjewell.boldlygoingnowhere.org>

next in thread | previous in thread | raw e-mail | index | archive | help
At 5:02 AM +0900 11/4/06, Curtis Jewell wrote:
>
>My question really is, does newsyslog send the signal at the right
>time [after the rotation is done, per
>       http://httpd.apache.org/docs/2.2/logs.html#rotation ]
>and does it do the lines in order???)

You can see what it will do by running newsyslog with the options
of `-nv' to see what it would do, without it doing anything.
Eg:
          newsyslog -nvvf /tmp/newsyslog.conf

In your case you'd first want to use a different time in the entries
you've added, just so the time to rotate is "this hour" (ie, whatever
hour it is that you're running the program...).  So, do that, and
then run:
          newsyslog -nvf /tmp/newsyslog.conf

You'll see that it first rotates all files that should be rotated
for this run, then sends all signals it is supposed to send, then
waits 10 seconds or so, and finally it compresses any of the
old-files that it should compress.

If you have a set of files which are all written to by a single
process, then you should add the '/var/run/httpd.pid' to the
newsyslog entry for *every* file that process writes to.  The
way newsyslog handles things, it will only send a single signal
to any given process id, even if several different files from
that process were rotated.  Since all files have been rotated
before the process is signalled, the process will only need to
be signalled one time.

Try the run with '-nv' to see exactly how it would work.

-- 
Garance Alistair Drosehn     =               drosehn@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?p06240828c17168598b6a>