Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Oct 1997 11:00:01 -0700 (PDT)
From:      Martin Cracauer <cracauer@wavehh.hanse.de>
To:        freebsd-bugs
Subject:   Re: conf/4751: sendmail writing to old maillogs after rotation
Message-ID:  <199710201800.LAA09444@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR conf/4751; it has been noted by GNATS.

From: Martin Cracauer <cracauer@wavehh.hanse.de>
To: Peter Wemm <peter@netplex.com.au>
Cc: Martin Cracauer <cracauer@cons.org>, jbrogan@reply.net,
        freebsd-gnats-submit@freebsd.org
Subject: Re: conf/4751: sendmail writing to old maillogs after rotation
Date: Tue, 14 Oct 1997 12:42:59 +0200

 Ops, Peter is of course just right here. Please ignore my comments,
 they are applicable only if you use newsyslog to rotate logfiles from
 a daemon that doesn't use syslog (i.e. apache).
 
 In <199710140131.JAA24190@spinner.netplex.com.au>, Peter Wemm wrote: 
 > Martin Cracauer wrote:
 > >  In <199710131156.EAA17286@hub.freebsd.org>, jbrogan@reply.net wrote: 
 > >  > Anyway, now when the maillogs are rotated as follows...
 > >  > 
 > >  > ...
 > >  > maillog.0 ----> maillog.1
 > >  > maillog   ----> maillog.0
 > >  > 
 > >  > Just like it has always done.  But now sendmail will start writing
 > >  > to maillog.0 instead of maillog where it's supposed to.  In fact,
 > >  > I've even found times when it's writing to maillog.2 or even
 > >  > maillog.3.  And when I actually *rename* a maillog it is writing
 > >  > to.... it will write to that renamed version!  Real neat, but not
 > >  > good.
 > >  
 > >  If you rename a file that is opened by a process, the file pointer
 > >  inside that process will still point to the original file.
 > >  
 > >  daemons are supposed to reopen their log file on `kill -HUP` and
 > >  scripts that rename logfiles are supposed to send -HUP to the daemon
 > >  in question.
 > [..]
 > >  John, if you have some time, could you please add
 > >  "/var/run/sendmail.pid" as the last field to your /etc/newsyslog.conf,
 > >  *not* enable compression and see if that solves your problem? Maybe
 > >  you could test this for other lines in newsyslog.conf as well?
 > 
 > Umm, no.. Sendmail does not write to log files.  It sends log messages to 
 > syslogd via the /var/run/log socket.  syslogd needs the kill -HUP, not 
 > sendmail.  Do *not* put /var/run/sendmail.pid into newsyslog.conf, that 
 > will cause something completely different... (a kill -HUP to sendmail will 
 > cause it to shutdown and re-exec itself)
 > 
 > newsyslog(8) automatically sends a HUP signal to syslogd after rotation and
 > before compression.  If you move the mail log rotation elsewhere, you need
 > to add back the explicit kill -HUP to syslogd again.
 > 
 > You can change the /etc/crontab entry that calls newsyslog so that it only 
 > runs at 12:01am if you want.  You can also remove the 'Z' flag on the 
 > maillog line if you want to keep uncompressed mail logs.  Surely that 
 > would be simpler...
 > 
 > Cheers,
 > -Peter
 > --
 > Peter Wemm <peter@netplex.com.au>   Netplex Consulting
 > 
 > 
 
 -- 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Martin.Cracauer@wavehh.hanse.de http://www.cons.org/cracauer/
 BSD User Group Hamburg/Germany  http://www.bsdhh.org/ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710201800.LAA09444>