Bug 16535 - /etc/logrotate.d/exim does not restart exim
/etc/logrotate.d/exim does not restart exim
Status: CLOSED RAWHIDE
Product: Red Hat Powertools
Classification: Retired
Component: exim (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Powers
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-18 11:37 EDT by mal
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-09-15 11:30:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mal 2000-08-18 11:37:08 EDT
The file
/etc/logrotate.d/exim
does not restart exim after logs we rotated.
This usually causes log messages
continued to be written to an old file.

Add the lines similar to ones used in /etc/logrotate.d/named
    postrotate
        /usr/bin/kill -HUP `cat /var/run/named.pid 2> /dev/null` 2>
/dev/null || true
    endscript

where pid file name should be /var/run/exim.pid
Comment 1 mal 2000-08-18 11:49:14 EDT
In addition.
Do it in a way similar to httpd.
One sighup to several files rotated.
man logrotate  , example here"

/var/log/httpd/access.log /var/log/httpd/error.log  {

	sharedscripts
           postrotate
....
	endscript
}

So postrotate script will be executed only once
Comment 2 Tim Powers 2000-08-18 12:12:20 EDT
That's a good idea. So you want something like this? (Please excuse bugzilla's
annoying wrapping of the first line):

/var/log/exim/exim_mainlog /var/log/exim/exim_rejectlog
/var/log/exim/exim_paniclog {
  missingok
  postrotate
    /bin/kill -HUP `cat /var/run/exim.pid 2>/dev/null` 2> /dev/null || true
  endscript
}
Comment 3 mal 2000-08-18 12:31:56 EDT
1. Yes, but just add

sharedscripts

keyword before postrotate
so the signal will be delivired only once.
Otherwise it will be delivered for every log file,
so exim may be restarted three times.

2. It may make sence to change log files names to 
/var/log/exim/exim_main.log instead of /var/log/exim/exim_mainlog
(.log extension), same thing with the other logs.

In a similar as samba.
Then logrotate script will be the following

 /var/log/exim/*.log {
   missingok
   noifempty
   sharedscripts
   postrotate
     /bin/kill -HUP `cat /var/run/exim.pid 2>/dev/null` 2> /dev/null || true
   endscript
 }

This is exactly how it set in samba
(the only problem with samba is samba pid files in wrong 
directory, I posted a bug report about this in
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=15343
Comment 4 Tim Powers 2000-08-18 12:41:36 EDT
Hmm. Path of least resistance ;) :

/var/log/exim/exim_*log {
  missingok
  noifempty
  sharedscripts
  postrotate
    /bin/kill -HUP `cat /var/run/exim.pid 2>/dev/null` 2> /dev/null || true
  endscript
}

Look good to you? If so, then I'll commit the changes and build the package.

Are there any other problems with exim that you've run into?

Tim
Comment 5 mal 2000-08-18 12:52:33 EDT
This logrotate looks OK to me.

>Are there any other problems with exim that you've run into?

We did not test it very much yet, 
two weeks ago I decided to get rid of 
qmail (because of its license) and go with GPL-ed exim.
It works ok, no problem so far.
The only diference (compared to RedHat 7.0 beta)
which I have is that I repackaged exim with exim-3.16 (latest stable).
No problem so far.
Comment 6 Tim Powers 2000-08-18 13:15:25 EDT
OK. New package is exim-3.13-19.

Tim
Comment 7 chris 2000-09-15 10:30:51 EDT
Just one thing: I think you mean "notifempty" in the logrotate script, rather
than "noifempty".

("noifempty" may well work as a synonym - but I can't find it anywhere in the
docs)
Comment 8 Tim Powers 2000-09-15 10:44:25 EDT
Nope. That's a screwup on my part :/ . Change it to notifempty when you install
it.
Comment 9 mal 2000-09-15 11:26:07 EDT
Yes, it should be 
notifempty
It was just misspelled in my posting.

Also exim-3.16 was around for a while (since Aug 1)
and seems being pretty stable.
May be it worth to upgrade exim to 3.16?
Comment 10 Tim Powers 2000-09-15 11:30:33 EDT
Too late to do this now. The new maintainer of the exim package will probably do
this for the release following 7.0, but that's his call.

Tim

Note You need to log in before you can comment on or make changes to this bug.