Subject: Re: newsyslog and script execution instead of sending signal to process
To: Eric Haszlakiewicz <erh@nimenees.com>
From: Greg A. Woods <woods@planix.com>
List: current-users
Date: 07/16/2007 02:49:29
--pgp-sign-Multipart_Mon_Jul_16_02:49:28_2007-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
At Sun, 15 Jul 2007 11:36:38 -0500, Eric Haszlakiewicz wrote:
Subject: Re: newsyslog and script execution instead of sending signal to pr=
ocess
>=20
> eh? How do you figure? If you're using newsyslog to rotate the logs
> for a program that needs a specialized restart procedure when the logs
> are rotated, then just moving them to a separate directory isn't going
> to do anything useful.
For example (there are probably thousands or more ways to do this --
here's just one) have cron invoke your script after newsyslog has
finished and have it look in the archive directory. As soon as a file
appears in that directory then gobble it up and when you're done
processing it move it off into the final "processed" archive directory
(or delete it or whatever). This doesn't require any special features
anywhere and it allows full separation of privilege (e.g. between the
logfile writer and the logfile processor) without any hassle or
significant risk whatsoever.
If your script safely can run with sufficient privileges to manipulate
the archived logfiles directly in the location where they are written to
then you don't even need the sub-directory archiving feature -- just
look for any new "archive" file (e.g. a *.0 file) and away you go.
It's extremely inelegant to have newsyslog invoking other programs,
never mind opening a whole new can of worms on the security front.
--=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_Mon_Jul_16_02:49:28_2007-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: CjqUnw/EOEXEewatprbdyARjyEObRHbz
iQA/AwUBRpsU+GZ9cbd4v/R/EQJAXACg74i0Uo6Eka+VD67NfsNssePrJekAoLP2
WcLO69BGc1n9B9DFQ9XwfQ9x
=Fidj
-----END PGP SIGNATURE-----
--pgp-sign-Multipart_Mon_Jul_16_02:49:28_2007-1--