From owner-freebsd-arch Thu Feb 27 20:37:35 2003 Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8231837B401 for ; Thu, 27 Feb 2003 20:37:33 -0800 (PST) Received: from smtp-relay.omnis.com (smtp-relay.omnis.com [216.239.128.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0422743FB1 for ; Thu, 27 Feb 2003 20:37:33 -0800 (PST) (envelope-from wes@softweyr.com) Received: from 204.68.178.4 (66-75-151-22.san.rr.com [66.75.151.22]) by smtp-relay.omnis.com (Postfix) with ESMTP id C774042F99; Thu, 27 Feb 2003 20:36:29 -0800 (PST) From: Wes Peters Organization: Softweyr LLC To: Garance A Drosihn , arch@FreeBSD.ORG Subject: Re: NEWSYSLOG changes Date: Thu, 27 Feb 2003 20:45:24 -0800 User-Agent: KMail/1.5 References: <20030210114930.GB90800@melusine.cuivre.fr.eu.org> <200302251255.48219.wes@softweyr.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200302272045.24640.wes@softweyr.com> Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tuesday 25 February 2003 04:18 pm, Garance A Drosihn wrote: > At 12:55 PM -0800 2/25/03, Wes Peters wrote: > >On Monday 24 February 2003 18:08, Garance A Drosihn wrote: > > > The idea of -R is that newsyslog should always rotate the given > > > list of files, whether or not *it* thinks they need to be > > > rotated. > > > > > > > > > For now it is assumed that the caller is the same process which > >> > >> usually writes to the file, and thus it does NOT use the pid_file > >> to signal that process. The whole idea of this is to let Wes > >> change syslogd to use this, and it would be silly for newsyslog > >> to HUP syslogd when it's syslogd that is requesting the rotate. > >> It may be that we should handle the pid-file signalling a > >> different way. > > > >Uh, actually, syslogd needs the HUP to re-open the file. ;^) > > > >I can change that iff I run newsyslog -F, waiting for the "new" > >log file to appear. Let me think about how to best do that... > > Well, I'm seriously thinking of redoing the -R update a little, > and have a separate option to say "do not signal". So, -R will > still send the signal by default. OK. I think I'll use the "do not signal" option, cause syslogd essentially restarts itself on SIGHUP, which is a little overboard for just rolling one file. > Still, I'd think that syslogd would: > close the logfile > exec newsyslog -NR syslogd somefile > wait for that to finish > re-open the log file. Yup, that's what I came up with when I was hacking on it yesterday. The code looks astonishingly like what you have above. > If newsyslog does the HUP, then it is also going to sleep for > something like 5 seconds, because it wants to be sure that the > signaled-process has done all the processing it needs to do. Yeah, ugh. And syslogd needs to pause to allow newsyslog to start, and etc. Nah. > >... I do like the idea of not needing a HUP signal between the > >two since syslogd started the newsyslog anyhow. > > Also, wouldn't a HUP will cause all config-files to be re-read, and > all log files to be closed and opened? That seems like a lot of > unnecessary work. Yup, exactly. Let me know if you put in a separate option for "don't signal" so I can use it. -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC wes@softweyr.com http://softweyr.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message