Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jan 1997 02:11:22 -0500
From:      Harlan Stenn <Harlan.Stenn@pfcs.com>
To:        freebsd-hackers@freebsd.org
Subject:   usr.sbin/ppp: reopen ppp.log on SIGUSR1?
Message-ID:  <6559.853657882@mumps.pfcs.com>

next in thread | raw e-mail | index | archive | help
I'm looking for a way to have ppp reopen its log file after I "rotate
out" the old one.

I figure there are 2 ways to do this:

- Have ppp "periodically" check the logfile and reopen it when it
  detects it's been rotated (stat the file and see if ctimespec !=
  mtimespec, right?)

- Reopen the logfile upon receipt of a signal

The problem with the first alternative is that ctimespec != mtimespec
only until the next write to the log file.  If we don't check during
that time, we'll miss detecting that the file's been rotated.

That leaves the signal() approach.

Anybody have a problem with my submitting a patch to reopen the log file
upon receipt of, say, SIGUSR1?

H



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