From owner-freebsd-questions Thu Apr 22 12: 1:18 1999 Delivered-To: freebsd-questions@freebsd.org Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.144.32]) by hub.freebsd.org (Postfix) with ESMTP id 960B014C0B for ; Thu, 22 Apr 1999 12:01:13 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.8.8/8.8.8) with ESMTP id LAA05921; Thu, 22 Apr 1999 11:58:34 -0700 (PDT) (envelope-from dwhite@resnet.uoregon.edu) Date: Thu, 22 Apr 1999 11:58:33 -0700 (PDT) From: Doug White To: "Ronald F. Guilmette" Cc: questions@FreeBSD.ORG Subject: Re: Two questions about newsyslog(8) In-Reply-To: <29748.924798861@monkeys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 22 Apr 1999, Ronald F. Guilmette wrote: > > I have a couple of system log files that would benefit from the magic > performed by newsyslog(8), however I am concerned about trying to > employ this program on these specific log files, because the man page > for newsyslog(8) is not clear about a few important details of what > this program actually does. Specifically: > > #1) When the current log file is being archived, is that current log > file (simply renamed and then gzipped), or are its current contents > copied first to `logfile.0', followed by truncation to zero length > of the existing `logfile' file? > > (The answer to this question may perhaps make a BIG difference as > to whether I can use newsyslog(8) or not on the specific log files > I am concerned about. If it just tries to rename `logfile' to > `logfile.0' and if the daemon process that is writing the log file > is just holding `logfile' continuously open, then this may perhaps > not produce the desited results.) If the daemon reopens its logfiles with a HUP signal, you can point newsyslog at a pid file to run through 'kill -HUP `cat /path/to/pidfile`'. > #2) The man page for newsyslog(8) says that it will send a signal > to the daemon process that is writing the log file. But when exactly > will it do this? Just after it moves the log out of the way and touches the new log. > What I mean is: Does newsyslog(8) send the signal > to the daemon process just after it makes a copy of (or just after > it renames) the current log file? Is the assumption then that this > signal should cause the daemon to close the current logfile and open > a new one having the original (pre-archiving) filename? Yes. It will touch(1) the new log file since most daemons don't open logfiles with O_CREAT. Read the Source, Luke! :-) Doug White Internet: dwhite@resnet.uoregon.edu | FreeBSD: The Power to Serve http://gladstone.uoregon.edu/~dwhite | www.freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message