[rhn-users] syslog / logrotate question

Jesse Becker jbecker at northwestern.edu
Tue Nov 30 16:42:09 UTC 2004


On Tue, Nov 30, 2004 at 10:22:08AM -0500, FM wrote:
> Hello
> my syslog conf :
> # Openldap Server daemon slapd
> local4.debug                                            /var/log/slapd
> 
> my logrotate.conf
> /var/log/slapd {
>    daily
>    rotate 2
>    create 0664 root ldap
>    compress
> }
> 
> 
> Every morning I have to restart syslog to allow slapd daemon to populate 
> the slapd log file instead of the messages log

The slapd process still has the old filehandle open, even after the files are
rotated.  Thus, you have to kick it to make sure it knows things have changed.

> Am I missing something in the config ?

Yes, a short section called "postrotate".  Try using this section (note the
last 3 lines):


/var/log/slapd {
   daily
   rotate 2
   create 0664 root ldap
   compress
   postrotate
      pkill -HUP slapd
   endscript
}

Of course, this only works if slapd honors the HUP signal.  If you need to
actually do a full restart, then replace 'pkill -HUP slapd' with a command to
bounce the service.

-- 
Jesse Becker
GPG-fingerprint: BD00 7AA4 4483 AFCC 82D0  2720 0083 0931 9A2B 06A2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/rhn-users/attachments/20041130/4c79bd4e/attachment.sig>


More information about the rhn-users mailing list