Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jan 1997 07:15:16 -0800 (PST)
From:      mark thompson <thompson@tgsoft.com>
To:        Harlan.Stenn@pfcs.com
Cc:        hackers@freefall.freebsd.org
Subject:   Re: usr.sbin/ppp: reopen ppp.log on SIGUSR1?
Message-ID:  <199701191515.HAA12852@squirrel.tgsoft.com>
In-Reply-To: message from Harlan Stenn on Sun, 19 Jan 1997 02:11:22 -0500

next in thread | raw e-mail | index | archive | help
   From: Harlan Stenn <Harlan.Stenn@pfcs.com>
   Date: Sun, 19 Jan 1997 02:11:22 -0500

   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

Well, this may be ignorance talking, but i thought that daemons that did
logging were supposed to close/open their logfiles regularly (every
message?) so that they automatically get the right one after
rotation. Is this not so?

-mark



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