From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 2 06:13:20 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D0C616A4D7 for ; Fri, 2 Apr 2004 06:13:20 -0800 (PST) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id AA47843D46 for ; Fri, 2 Apr 2004 06:13:19 -0800 (PST) (envelope-from dwmalone@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 2 Apr 2004 15:13:18 +0100 (BST) Date: Fri, 2 Apr 2004 15:13:17 +0100 From: David Malone To: James Housley Message-ID: <20040402141317.GA46001@walton.maths.tcd.ie> References: <406C8F4F.1040306@Thehousleys.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <406C8F4F.1040306@Thehousleys.net> User-Agent: Mutt/1.5.3i Sender: dwmalone@maths.tcd.ie cc: freebsd-hackers@freebsd.org Subject: Re: Loosing STDOUT after file rotation X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2004 14:13:20 -0000 On Thu, Apr 01, 2004 at 04:53:19PM -0500, James Housley wrote: > I have a program that I have the is supposed to run forever. I log any > output to a log file. It is run in a startup script like thie: > > program_name >> $err_log 2>&1 > > The problem is that after newsyslog rotates the $err_log file, no more > data is written to the file. I can not stop and restart the program. I > can accept a signal. But what do I need to do in "program_name" to allow > the data to be written after the "rotation" of the file. You need to write the program to take the name of the file it should log to and then to reopen that file (either periodically or on a HUP signal...) David.