Bug 16535

Summary: /etc/logrotate.d/exim does not restart exim
Product: [Retired] Red Hat Powertools Reporter: mal
Component: eximAssignee: Tim Powers <timp>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: chris
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-09-15 15:30:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mal 2000-08-18 15:37:08 UTC
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 15:49:14 UTC
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 16:12:20 UTC
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 16:31:56 UTC
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 16:41:36 UTC
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 16:52:33 UTC
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 17:15:25 UTC
OK. New package is exim-3.13-19.

Tim

Comment 7 chris 2000-09-15 14:30:51 UTC
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 14:44:25 UTC
Nope. That's a screwup on my part :/ . Change it to notifempty when you install
it.

Comment 9 mal 2000-09-15 15:26:07 UTC
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 15:30:33 UTC
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