From owner-freebsd-hackers@FreeBSD.ORG Fri Apr 2 07:19:50 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 AC56416A4CE for ; Fri, 2 Apr 2004 07:19:50 -0800 (PST) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 458D843D2F for ; Fri, 2 Apr 2004 07:19:50 -0800 (PST) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id C34E95310; Fri, 2 Apr 2004 17:19:48 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id 6A893530A; Fri, 2 Apr 2004 17:19:43 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id D82DB33CAA; Fri, 2 Apr 2004 17:19:42 +0200 (CEST) To: James Housley References: <406C8F4F.1040306@Thehousleys.net> From: des@des.no (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Fri, 02 Apr 2004 17:19:42 +0200 In-Reply-To: <406C8F4F.1040306@Thehousleys.net> (James Housley's message of "Thu, 01 Apr 2004 16:53:19 -0500") Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 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 15:19:50 -0000 James Housley writes: > 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. There is not much you can do unless you modify your program to write directly to the log file instead of stdout (in which case you just need to re-open the log file when you get a SIGHUP), or use something like Apache's logrotate instead of newsyslog (pipe the program's output to logrotate, which takes care of the rest) DES --=20 Dag-Erling Sm=F8rgrav - des@des.no