From owner-freebsd-bugs Mon Oct 13 06:30:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA23035 for bugs-outgoing; Mon, 13 Oct 1997 06:30:06 -0700 (PDT) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id GAA23025; Mon, 13 Oct 1997 06:30:02 -0700 (PDT) (envelope-from gnats) Date: Mon, 13 Oct 1997 06:30:02 -0700 (PDT) Message-Id: <199710131330.GAA23025@hub.freebsd.org> To: freebsd-bugs Cc: From: Martin Cracauer Subject: Re: conf/4751: sendmail writing to old maillogs after rotation Reply-To: Martin Cracauer Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR conf/4751; it has been noted by GNATS. From: Martin Cracauer 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 http://www.cons.org/cracauer/ BSD User Group Hamburg/Germany http://www.bsdhh.org/