Apache log rotation question...
Garance A Drosehn
gad at FreeBSD.org
Fri Nov 3 23:02:40 UTC 2006
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.
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
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 at rpi.edu
Senior Systems Programmer or gad at FreeBSD.org
Rensselaer Polytechnic Institute; Troy, NY; USA
More information about the freebsd-questions