From owner-freebsd-questions@FreeBSD.ORG Wed Jul 2 02:08:40 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 33CF637B401 for ; Wed, 2 Jul 2003 02:08:40 -0700 (PDT) Received: from hypernet.hyper.net (hypernet.hyper.net [193.218.1.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0FD4443FCB for ; Wed, 2 Jul 2003 02:08:38 -0700 (PDT) (envelope-from dxoch@escape.gr) Received: from escape.gr (bus.hyper.gr [193.218.2.30])h628Rq816195 for ; Wed, 2 Jul 2003 11:27:53 +0300 Date: Wed, 2 Jul 2003 12:08:31 +0300 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed From: Jim Xochellis To: freebsd-questions@FreeBSD.ORG Content-Transfer-Encoding: 7bit Message-Id: X-Mailer: Apple Mail (2.552) Subject: About newsyslog behavior X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jul 2003 09:08:40 -0000 Hi list, I am using the newsyslog utility to turn over my log files automatically. I have noticed that some processes have problem to continue using their log file after newsyslog has turned it over and need to receive the SINGHUP signal to re-start logging correctly. However sending SINGHUP has uncomfortable consequences in some cases (for instance when sending signal to netatalk, or other file servers perhaps). I suspected that some processes are confused because a *new* log file is created and these processes are making the assumption that their log file will be always the same and perhaps they open it once and then work with the FILE pointer. (just a simple theory that explains some facts) I have confirmed that newsyslog actually creates a new log file (instead of copying it and then disposing its contents) by reading the source of the newsyslog.c file and particularly the dotrim() function. I have also tested that changing the contents of the log files by hand does not affect the logging of most processes (surely not the logging of netatalk). Having the above in mind, isn't it worthwhile to add an option in newsyslog in order to avoid the creation of a new log file when it is inconvenient? Isn't it feasible to dispose the contents of the old log file instead of creating a new one? Anything that I am missing here? (giving the fact that I am not a unix guru, only a C programmer) Thank you very much for your time Jim Xochellis