Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Feb 2003 20:45:24 -0800
From:      Wes Peters <wes@softweyr.com>
To:        Garance A Drosihn <drosih@rpi.edu>, arch@FreeBSD.ORG
Subject:   Re: NEWSYSLOG changes
Message-ID:  <200302272045.24640.wes@softweyr.com>
In-Reply-To: <p05200f22ba81b269ba0f@[128.113.24.47]>
References:  <20030210114930.GB90800@melusine.cuivre.fr.eu.org> <200302251255.48219.wes@softweyr.com> <p05200f22ba81b269ba0f@[128.113.24.47]>

next in thread | previous in thread | raw e-mail | index | archive | help
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




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