Subject: Re: newsyslog and script execution instead of sending signal to process
To: Aaron J. Grier <agrier@poofygoof.com>
From: Greg A. Woods <woods@planix.com>
List: current-users
Date: 07/17/2007 20:15:12
--pgp-sign-Multipart_Tue_Jul_17_20:15:11_2007-1
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=
ocess
>=20
> 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.
>=20
> 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.

--=20
						Greg A. Woods

H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>       Secrets of the Weird <woods@weird.com>

--pgp-sign-Multipart_Tue_Jul_17_20:15:11_2007-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

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

iQA/AwUBRp1bj2Z9cbd4v/R/EQKKswCguMxpTj6fVxCeD4E1ZSSjCg3/oAcAn0x4
j3Vw0/h/jIWoPl+JPb6/TK9A
=CFUH
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Tue_Jul_17_20:15:11_2007-1--