Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 1997 18:40:02 -0700 (PDT)
From:      Peter Wemm <peter@netplex.com.au>
To:        freebsd-bugs
Subject:   Re: conf/4751: sendmail writing to old maillogs after rotation 
Message-ID:  <199710140140.SAA10249@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: Peter Wemm <peter@netplex.com.au>
To: Martin Cracauer <cracauer@cons.org>, jbrogan@reply.net
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: conf/4751: sendmail writing to old maillogs after rotation 
Date: Tue, 14 Oct 1997 09:31:49 +0800

 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
 
 



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