From owner-freebsd-hackers Sun Jan 19 07:14:16 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id HAA04804 for hackers-outgoing; Sun, 19 Jan 1997 07:14:16 -0800 (PST) Received: from squirrel.tgsoft.com (squirrel.tgsoft.com [207.167.64.183]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id HAA04798 for ; Sun, 19 Jan 1997 07:14:13 -0800 (PST) Received: (from thompson@localhost) by squirrel.tgsoft.com (8.8.3/8.6.12) id HAA12852; Sun, 19 Jan 1997 07:15:16 -0800 (PST) Date: Sun, 19 Jan 1997 07:15:16 -0800 (PST) Message-Id: <199701191515.HAA12852@squirrel.tgsoft.com> From: mark thompson To: Harlan.Stenn@pfcs.com CC: hackers@freefall.freebsd.org In-reply-to: message from Harlan Stenn on Sun, 19 Jan 1997 02:11:22 -0500 Subject: Re: usr.sbin/ppp: reopen ppp.log on SIGUSR1? Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk From: Harlan Stenn 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