Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Oct 1997 06:30:02 -0700 (PDT)
From:      Martin Cracauer <cracauer@cons.org>
To:        freebsd-bugs
Subject:   Re: conf/4751: sendmail writing to old maillogs after rotation
Message-ID:  <199710131330.GAA23025@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@cons.org>
To: jbrogan@reply.net
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: conf/4751: sendmail writing to old maillogs after rotation
Date: Mon, 13 Oct 1997 15:19:21 +0200

 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.
 
 "scripts" in this case is /usr/sbin/newsyslog, which needs to know
 where to find the pid. The third field in /etc/newsyslog.conf is
 supposed to point to a file where a daemon stores its pid file, but
 it's empty on my systems.
 
 Apparaently, this works in the usual FreeBSD case because the old
 files are compressed, which means removed to the writing process,
 which then tries reopening it. Am I right that you don't have 'Z' in
 your /etc/newsyslog.conf line or don't use newsyslog at all?
 
 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?
 
 Thanks for the report
 	Martin
 -- 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Martin Cracauer <cracauer@cons.org> 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?199710131330.GAA23025>