Subject: Re: newsyslog and script execution instead of sending signal to process
To: Aaron J. Grier <>
From: Greg A. Woods <>
List: current-users
Date: 07/17/2007 20:15:12
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Tue, 17 Jul 2007 13:12:30 -0700, Aaron J. Grier wrote:
Subject: Re: newsyslog and script execution instead of sending signal to pr=
> On Tue, Jul 17, 2007 at 02:26:32PM -0400, Greg A. Woods wrote:
> > And no, the purpose would not to be to watch a directory and move the
> > log again -- the purpose would be to find a log ready to process and
> > then rename it to a safe and unique name and then actually process it.
> how does the processing program know that syslog is done moving the
> logfile?  is "mv" an atomic operation?

I used the word "move" not "mv" intentionally.  :-)

(I think in an earlier post I also used the word "sub-directory" quite
intentionally, or at least I meant to.)

In fact my intention is to implement the move as a rename(2) and to barf
an error if it fails.  I'm sure as heck not going to call mv(1), nor am
I going to implement an internal file copy.

In fact one of the two main goals of this archive-to-a-directory idea is
for it to be an atomic rename into the new directory where its very
presence is a signal that it's ready to be processed (assuming as well
that no process still has it open for writing).  (The other idea is of
course to keep /var/log from being cluttered with many long-named files
once timestamp tagging is also implemented for the archived files.)

> how does the processing program avoid polling the logfile depot?

Well that's up to the person who implements it isn't it now!  If it were
me it wouldn't poll -- it would be invoked once a minute by cron and it
would exit cleanly, quickly and silently if there were no files ready to
process.  There are as many was to do this though as there are monkeys
to implement them.

						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <>
Planix, Inc. <>       Secrets of the Weird <>

Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

Version: PGPfreeware 5.0i for non-commercial use
MessageID: rbcB9huBT2b5QYQUPl8axCVOs4Cu2KXo