From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16072 invoked from network); 16 Jul 1998 15:37:28 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 15:37:28 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id LAA20165; Thu, 16 Jul 1998 11:31:13 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 11:24:54 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980716082633.ZM15563@candle.brasslantern.com> Date: Thu, 16 Jul 1998 08:26:32 -0700 In-Reply-To: <199807160836.JAA25520@taos.demon.co.uk> Comments: In reply to Zefram "Re: rolling over high-traffic logfiles?" (Jul 16, 9:36am) References: <199807160836.JAA25520@taos.demon.co.uk> In-Reply-To: Comments: In reply to Brian Harvell "Re: rolling over high-traffic logfiles?" (Jul 16, 8:46am) X-Mailer: Z-Mail (4.0b.820 20aug96) To: zsh-users@math.gatech.edu Subject: Re: rolling over high-traffic logfiles? Cc: sweth@astaroth.nit.gwu.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"tqIyw1.0.Gu4.5jXhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1679 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu On Jul 16, 9:36am, Zefram wrote: } Subject: Re: rolling over high-traffic logfiles? } } mv should use rename() to atomically replace the log file, in which case } there is no race condition. Fair enough. There are two or more filesystem operations necessary even if only only system call, but I suppose that's only a possible problem on a multiprocessor system. On Jul 16, 8:46am, Brian Harvell wrote: } Subject: Re: rolling over high-traffic logfiles? } } > Use "ln" and "mv" to replace the file, rather than "cp" over it. } } That won't work. You are going to have to send syslog a sighup before it } will release it's current file handle and reopen to a new one. I assumed that this was some other kind of log, not syslog output, and that therefore the file had to exist in order to be correctly opened and written by the logger. Now that I think about it, Brian's answer is more likely the correct one, and I should have mentioned it, too. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com