From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8402 invoked from network); 16 Jul 1998 04:05:21 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 04:05:21 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id XAA11106; Wed, 15 Jul 1998 23:53:03 -0400 (EDT) Resent-Date: Wed, 15 Jul 1998 23:46:09 -0400 (EDT) Message-ID: <19980715234957.51065@astaroth.nit.gwu.edu> Date: Wed, 15 Jul 1998 23:49:57 -0400 From: Sweth Chandramouli To: ZSH Users Subject: rolling over high-traffic logfiles? Mail-Followup-To: ZSH Users Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89 Resent-Message-ID: <"0Mugm1.0.lh2.0UNhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1674 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu is there some easy way to roll over high-traffic logfiles in zsh, without losing any possible incoming data? i have a machine, for example, that receives syslog reports from many other machines on a network, which syslog.conf puts into the file /var/adm/extlog. for similar such files, i have a crontab entry that simply copies the log file to the file "log.`date`", and then copies /dev/null over the current logfile. this syslog file, however, is almost constatnly being updated. in the ideal world, i'd like to not have to worry about one or two entries getting added (and thus lost) to /var/adm/extlog in the time between when /var/adm/extlog.`date` is created and /dev/null gets copied over /var/adm/extlog. can zsh do some sort of file locking here? if not, does anyone have any other ideas on how to not lose and log entires? tia, sweth. -- Sweth Chandramouli IS Coordinator, The George Washington University / (202) 994 - 8521 (V) / (202) 994 - 0458 (F) * From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7148 invoked from network); 16 Jul 1998 05:52:07 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 05:52:07 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id BAA12333; Thu, 16 Jul 1998 01:27:01 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 01:12:31 -0400 (EDT) From: "Bart Schaefer" Message-Id: <980715220851.ZM13527@candle.brasslantern.com> Date: Wed, 15 Jul 1998 22:08:51 -0700 In-Reply-To: <19980715234957.51065@astaroth.nit.gwu.edu> Comments: In reply to Sweth Chandramouli "rolling over high-traffic logfiles?" (Jul 15, 11:49pm) References: <19980715234957.51065@astaroth.nit.gwu.edu> X-Mailer: Z-Mail (4.0b.820 20aug96) To: Sweth Chandramouli , ZSH Users Subject: Re: rolling over high-traffic logfiles? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Resent-Message-ID: <"GYQ4y3.0.f-2.-kOhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1675 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 15, 11:49pm, Sweth Chandramouli wrote: } Subject: rolling over high-traffic logfiles? } } is there some easy way to roll over high-traffic logfiles } in zsh, without losing any possible incoming data? There isn't any magic for this that is specific to zsh. } can zsh do some sort of file locking here? It wouldn't help. The processes that are writing to the log file would also have to use the equivalent locking. (There is such a thing in unix as "mandatory" file locking, but using that would likely just cause the logging processes to get errors. All other locking is "advisory," which means all processes involved must have been written so as to use the same cooperative calls.) } does anyone have any other ideas on how to not lose and log entires? Use "ln" and "mv" to replace the file, rather than "cp" over it. cp /dev/null extlog.new && ln extlog extlog.`date` && mv -f extlog.new extlog || rm -f extlog.new There's still a race condition where some process could attempt to write to extlog during the execution of "mv", that is, between unlinking the old extlog and renaming extlog.new to extlog. However, the window for failure is much smaller, and could be made smaller still by using the "files" module with zsh 3.1.4 so that "ln" and "mv" are shell builtins. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3761 invoked from network); 16 Jul 1998 08:55:57 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 08:55:57 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id EAA13903; Thu, 16 Jul 1998 04:49:16 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 04:35:19 -0400 (EDT) From: Zefram Message-Id: <199807160836.JAA25520@taos.demon.co.uk> Subject: Re: rolling over high-traffic logfiles? To: schaefer@brasslantern.com (Bart Schaefer) Date: Thu, 16 Jul 1998 09:36:43 +0100 (BST) Cc: sweth@astaroth.nit.gwu.edu, zsh-users@math.gatech.edu In-Reply-To: <980715220851.ZM13527@candle.brasslantern.com> from "Bart Schaefer" at Jul 15, 98 10:08:51 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"-_Pf-.0.ZM3.6jRhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1676 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: >There's still a race condition where some process could attempt to write >to extlog during the execution of "mv", that is, between unlinking the >old extlog and renaming extlog.new to extlog. mv should use rename() to atomically replace the log file, in which case there is no race condition. -zefram From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12431 invoked from network); 16 Jul 1998 12:58:52 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 12:58:52 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id IAA16161; Thu, 16 Jul 1998 08:52:59 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 08:45:51 -0400 (EDT) Date: Thu, 16 Jul 1998 08:46:09 -0400 From: Brian Harvell X-Sender: harvell@boondoggle.office.aol.com To: Bart Schaefer cc: Sweth Chandramouli , ZSH Users Subject: Re: rolling over high-traffic logfiles? In-Reply-To: <980715220851.ZM13527@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"0yDyX2.0.ov3._NVhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1677 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > > } does anyone have any other ideas on how to not lose and log entires? > > Use "ln" and "mv" to replace the file, rather than "cp" over it. > > cp /dev/null extlog.new && > ln extlog extlog.`date` && > mv -f extlog.new extlog || > rm -f extlog.new > > There's still a race condition where some process could attempt to write > to extlog during the execution of "mv", that is, between unlinking the > old extlog and renaming extlog.new to extlog. However, the window for > failure is much smaller, and could be made smaller still by using the > "files" module with zsh 3.1.4 so that "ln" and "mv" are shell builtins. > 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. All you need to do is mv the logfile to the new name. (syslog will continue to write to it even after the mv has completed) then send syslog a sighup. (It will then open a new log file) There is still a small chance that you will loose entries but that's the nature of syslog anyway. Syslogd can easily get overloaded and drop entries on the floor. Brian Brian Harvell harvell@aol.net http://boondoggle.web.aol.com/ echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13024 invoked from network); 16 Jul 1998 14:04:12 -0000 Received: from math.gatech.edu (root@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 14:04:12 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id JAA17764; Thu, 16 Jul 1998 09:53:44 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 09:43:30 -0400 (EDT) To: zsh-users@math.gatech.edu Subject: Re: rolling over high-traffic logfiles? Newsgroups: dis.lists.zsh References: <19980715234957.51065@astaroth.nit.gwu.edu> Reply-To: sinclair@dis.strath.ac.uk Date: Thu, 16 Jul 1998 14:45:20 +0100 Message-ID: <15546.900596720@dis.strath.ac.uk> From: Duncan Sinclair Resent-Message-ID: <"ikc1-1.0.RI4.2EWhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1678 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > is there some easy way to roll over high-traffic logfiles >in zsh, without losing any possible incoming data? As it is a syslog log file there is a standard way to do this: mv /var/adm/extlog /var/adm/extlog.`date` cp /dev/null /var/adm/extlog kill -HUP `cat /etc/syslog.pid` syslogd will continue writing to the old log file until the kill signal is sent to it. Nothing is ever lost - as long as syslog is behaving itself! Hope this helps. Duncan Sinclair. >From zsh-workers-request@math.gatech.edu Thu Jul 16 14:07:47 1998 Return-Path: Delivered-To: mason-zsh@primenet.com.au Received: (qmail 13065 invoked from network); 16 Jul 1998 14:07:46 -0000 Received: from math.gatech.edu (root@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 14:07:46 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id JAA17764; Thu, 16 Jul 1998 09:53:44 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 09:43:30 -0400 (EDT) To: zsh-users@math.gatech.edu Subject: Re: rolling over high-traffic logfiles? Newsgroups: dis.lists.zsh References: <19980715234957.51065@astaroth.nit.gwu.edu> Reply-To: sinclair@dis.strath.ac.uk Date: Thu, 16 Jul 1998 14:45:20 +0100 Message-ID: <15546.900596720@dis.strath.ac.uk> From: Duncan Sinclair Resent-Message-ID: <"ikc1-1.0.RI4.2EWhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1678 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > is there some easy way to roll over high-traffic logfiles >in zsh, without losing any possible incoming data? As it is a syslog log file there is a standard way to do this: mv /var/adm/extlog /var/adm/extlog.`date` cp /dev/null /var/adm/extlog kill -HUP `cat /etc/syslog.pid` syslogd will continue writing to the old log file until the kill signal is sent to it. Nothing is ever lost - as long as syslog is behaving itself! Hope this helps. Duncan Sinclair. >From zsh-workers-request@math.gatech.edu Thu Jul 16 14:12:59 1998 Return-Path: Delivered-To: mason-zsh@primenet.com.au Received: (qmail 13119 invoked from network); 16 Jul 1998 14:12:58 -0000 Received: from math.gatech.edu (root@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 14:12:58 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id JAA17764; Thu, 16 Jul 1998 09:53:44 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 09:43:30 -0400 (EDT) To: zsh-users@math.gatech.edu Subject: Re: rolling over high-traffic logfiles? Newsgroups: dis.lists.zsh References: <19980715234957.51065@astaroth.nit.gwu.edu> Reply-To: sinclair@dis.strath.ac.uk Date: Thu, 16 Jul 1998 14:45:20 +0100 Message-ID: <15546.900596720@dis.strath.ac.uk> From: Duncan Sinclair Resent-Message-ID: <"ikc1-1.0.RI4.2EWhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1678 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > is there some easy way to roll over high-traffic logfiles >in zsh, without losing any possible incoming data? As it is a syslog log file there is a standard way to do this: mv /var/adm/extlog /var/adm/extlog.`date` cp /dev/null /var/adm/extlog kill -HUP `cat /etc/syslog.pid` syslogd will continue writing to the old log file until the kill signal is sent to it. Nothing is ever lost - as long as syslog is behaving itself! Hope this helps. Duncan Sinclair. 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16440 invoked from network); 16 Jul 1998 16:27:27 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 16:27:27 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id MAA21119; Thu, 16 Jul 1998 12:15:01 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 12:12:43 -0400 (EDT) From: Zefram Message-Id: <199807161614.RAA32121@taos.demon.co.uk> Subject: Re: rolling over high-traffic logfiles? To: schaefer@brasslantern.com (Bart Schaefer) Date: Thu, 16 Jul 1998 17:14:28 +0100 (BST) Cc: zsh-users@math.gatech.edu, sweth@astaroth.nit.gwu.edu In-Reply-To: <980716082633.ZM15563@candle.brasslantern.com> from "Bart Schaefer" at Jul 16, 98 08:26:32 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"k5j_43.0.385.xPYhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1680 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bart Schaefer wrote: >} 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. POSIX.1 defines rename() to be atomic, as is historical practice. On multiprocessor systems the kernel just has to take a little extra care. POSIX.2 defines mv to behave as if it were calling rename(). -zefram From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16613 invoked from network); 16 Jul 1998 16:54:48 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 16 Jul 1998 16:54:48 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id MAA21810; Thu, 16 Jul 1998 12:46:14 -0400 (EDT) Resent-Date: Thu, 16 Jul 1998 12:40:05 -0400 (EDT) Message-ID: <19980716221117.A22693@cse.iitb.ernet.in> Date: Thu, 16 Jul 1998 22:11:17 +0530 From: Nitin P Garg To: zsh-users@math.gatech.edu, sweth@astaroth.nit.gwu.edu Subject: Re: rolling over high-traffic logfiles? References: <980716082633.ZM15563@candle.brasslantern.com> <199807161614.RAA32121@taos.demon.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.1i In-Reply-To: <199807161614.RAA32121@taos.demon.co.uk>; from Zefram on Thu, Jul 16, 1998 at 05:14:28PM +0100 Resent-Message-ID: <"Vyfvy3.0.uH5.apYhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1681 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu [snipped...lots of suggestions] hmm...maybe there is a simple solution, how about making the file a named pipe ? then a process could simply read from it and write to a somefile.date and the reading process could simply keep changing .date part as frequent as one programs it to. any problems with this ??? ++garg From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29118 invoked from network); 17 Jul 1998 08:01:53 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 17 Jul 1998 08:01:53 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id DAA02404; Fri, 17 Jul 1998 03:52:44 -0400 (EDT) Resent-Date: Fri, 17 Jul 1998 03:37:15 -0400 (EDT) Message-ID: <19980717093632.A9392@mpn.cp.philips.com> Date: Fri, 17 Jul 1998 09:36:32 +0200 From: Jos Backus To: zsh-users@math.gatech.edu Subject: Re: rolling over high-traffic logfiles? References: <980716082633.ZM15563@candle.brasslantern.com> <199807161614.RAA32121@taos.demon.co.uk> <19980716221117.A22693@cse.iitb.ernet.in> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.92.10i In-Reply-To: <19980716221117.A22693@cse.iitb.ernet.in>; from Nitin P Garg on Thu, Jul 16, 1998 at 10:11:17PM +0530 Resent-Message-ID: <"t2eKt3.0.eY.gylhr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1682 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 Thu, Jul 16, 1998 at 10:11:17PM +0530, Nitin P Garg wrote: > how about making the file a named pipe ? > then a process could simply read from it and write to a somefile.date and the > reading process could simply keep changing .date part as frequent as one > programs it to. Tbis is what fifo and cyclog (part of Dan Bernstein's daemontools package, see http://www.pobox.com/~djb/daemontools.html) do. -- Jos Backus _/ _/_/_/ "Reliability means never _/ _/ _/ having to say you're sorry." _/ _/_/_/ -- D. J. Bernstein _/ _/ _/ _/ Jos.Backus@nl.origin-it.com _/_/ _/_/_/ use Std::Disclaimer; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1905 invoked from network); 24 Jul 1998 23:54:21 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 24 Jul 1998 23:54:21 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id TAA01359; Fri, 24 Jul 1998 19:45:19 -0400 (EDT) Resent-Date: Fri, 24 Jul 1998 19:40:30 -0400 (EDT) Date: Fri, 24 Jul 1998 19:42:35 -0400 (EDT) From: Todd Graham Lewis X-Sender: tlewis@reflections.eng.mindspring.net To: Bart Schaefer cc: zsh-users@math.gatech.edu Subject: Re: rolling over high-traffic logfiles? In-Reply-To: <980716082633.ZM15563@candle.brasslantern.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"dYmE12.0.zI.jjHkr"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1686 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 Thu, 16 Jul 1998, Bart Schaefer wrote: > 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. This is why kernel locking is such a big issue in SMP. The semantics don't change; rename() is always atomic under Unix. -- Todd Graham Lewis (800) 719-4664, x2804 ******Linux****** MindSpring Enterprises tlewis@mindspring.net