Subject: Re: newsyslog and script execution instead of sending signal to process
To: Juraj Hercek <>
From: Greg A. Woods <>
List: current-users
Date: 07/14/2007 14:56:47
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
> 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

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.

						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: VhVpzngsbdtAaSGc8qBqGWA3AYQFiI4q