[Mailman-Users] Scripts Associated with Log File Rotation
Greg Sims
greg at headingup.net
Tue Feb 5 17:55:29 CET 2008
Hi There,
I have been studying the mailman code this morning to find a way to do some
processing when the mailman logs are rotated. My goal is to process the
data in /var/log/mailman/subscribe.1 and /var/log/mailman/bounce.1 just
after they are rotated. I reviewed the file /etc/logrotate.d/mailman on my
RHEL system which seems to control rotating the logs - below is a copy of
the file for reference.
/var/log/mailman/bounce /var/log/mailman/digest /var/log/mailman/error
/var/log/mailman/post /var/log/mailman/smtp /var/log/mailman/smtp-failure
/var/log/mailman/qrunner /var/log/mailman/locks /var/log/mailman/fromusenet
/var/log/mailman/subscribe /var/log/mailman/vette {
missingok
sharedscripts
postrotate
/usr/lib/mailman/bin/mailmanctl reopen >/dev/null 2>&1 || true
endscript
}
I have a couple of question about doing what I need to without breaking
anything:
(1) The time stamps of the log files on my system are not all the same.
The time stamp of /var/log/mailman/subscribe.1 and /var/log/mailman/bounce.1
are not even on the same day. This implies that rotation for these files is
happening at different times. I'm concerned about making one change to the
logrotate.d file above - like adding a line to the postrotate section - as a
result.
(2) My first concern leads me to break subscribe and bounce into separate
entries in the logrotate.d file. Is the solution to what I am trying to
accomplish as simple as the following:
a. Append the existing logrotate.d file to itself two times - resulting
in a file that has three logrotate sections
b. Delete bounce and subscribe from the first section
c. Delete all but bounce from the second section & add my script to run
against bounce.1 just before endscript
d. Delete all but subscribe from the third section & add my script to
run against subscribe.1 just before endscript.
e. This implies mailmanctl will run three times for each invocation of
logrotate - it only runs once with the distribution file due to
sharedscripts. Is this OK?
Thanks for your assistance with this & helping me not break anything as I
make this enhancement to our production system, Greg
More information about the Mailman-Users
mailing list