Subject: Re: newsyslog and script execution instead of sending signal to process
To: Juraj Hercek <nbsd@hck.sk>
From: Greg A. Woods <woods@planix.com>
List: current-users
Date: 07/14/2007 14:56:47
--pgp-sign-Multipart_Sat_Jul_14_14:56:47_2007-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

At Wed, 11 Jul 2007 20:39:42 +0200, Juraj Hercek wrote:
Subject: newsyslog and script execution instead of sending signal to process
>=20
> Is there any plan to support command execution in NetBSD's newsyslog?

I have plans for my version of newsyslog to support archival of logs
into a specified directory, at which point there's really no need or
purpose of having direct script execution from within newsyslog.  In
fact such additional complication in a program that's often run by
privileged users is really a very bad idea.

It's not even really all that difficult to have a program notice when a
new .0 (or .0.gz) file appears and then do something with it, especially
on systems which support kevent(2) and kqueue(2) or something similar.
To make it even easier you could have the program first move the .0 file
into another directory (and give it a unique name) before beginning its
processing.

Note of course that any program intending to do something with a fresh
newly archived log file must be sure that the file is no longer open by
any other process (for write at least) before it does anything, since
the sending of a signal and the renaming of the file do not on their own
say anything about whether or not all the writers to that file have
finished and closed it off.

--=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_Sat_Jul_14_14:56:47_2007-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

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

iQA/AwUBRpkcb2Z9cbd4v/R/EQKzhQCg7PDgOKlzMolFlf2sdA2QmMlkHucAn0dZ
C2CyZKHdwZXQSlz7XR6jG9IS
=THds
-----END PGP SIGNATURE-----

--pgp-sign-Multipart_Sat_Jul_14_14:56:47_2007-1--