Re: [patch] extension of newsyslog

2001-10-13 Thread Toshihiko ARAI

+ <[EMAIL PROTECTED]>, Cyrille Lefevre wrote:

>> I add script call features to newsyslog.  This adds a one field to
>> newsyslog.conf.  When newsyslog processed log file, this can execute
>> arbitrary program.
>> 
>> Situation to assume:
>> * For the log file which cannot use signal.
>> * Cases to do statistical application for log file.

By the way, is there a user needing such a features really?  It may
not be general besides me.  If it is features to be comparatively
general, as for it, what specification method is desirable?

> it would be interresting to have the possibility to pass optional
> args to program.

The first patch does not consider it.  It specified merely pathname
of program.  I put a patch of a update version in the following URL.

 http://people.freebsd.org/~toshi/d/

> also, how about testing for the first (or the last) char to be &
> to run the program asynchronously ?

Command execution goes by way of /bin/sh in a new patch.
Asynchronous execution of program became possible.

> much better, always run the program asynchronously so that hanging
> programs (who knowns?) don't block the whole process. to do this,
> somewhere in main(), add something such as signal(SIGCHLD, SIG_IGN)
> and delete the while statment in post_prog().

I added some debug routine, and I tested it.  So far a problem does
not occur.

--
Toshihiko ARAI

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: [patch] extension of newsyslog

2001-10-08 Thread Cyrille Lefevre

Toshihiko ARAI wrote:
> Hello,
> 
> I add script call features to newsyslog.  This adds a one field to
> newsyslog.conf.  When newsyslog processed log file, this can execute
> arbitrary program.
> 
> Situation to assume:
>  * For the log file which cannot use signal.
>  * Cases to do statistical application for log file.
> 
> A sample entry of newsylog.conf:
> # logfilename  [owner:group] mode count size when [ZB] [/pid_file] [sig_num] 
>[/program]
> /var/log/foo.log  bar:baz640  1 100  * Z   -  -  /etc/foo.sh
> 
> '-' is usable as a filler of null field.
> 
> I used similar enhanced function from the past.  I think that you can
> apply this patch for 5-current.  In addition, I can prepare a patch
> for 4-stable if it is necessary.
> 
> I ask for testing and a review of the following patches.

it would be interresting to have the possibility to pass optional
args to program.

also, how about testing for the first (or the last) char to be &
to run the program asynchronously ?

much better, always run the program asynchronously so that hanging
programs (who knowns?) don't block the whole process. to do this,
somewhere in main(), add something such as signal(SIGCHLD, SIG_IGN)
and delete the while statment in post_prog().

Cyrille.
-- 
Cyrille Lefevre mailto:[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message