[COMMIT LOGREPORT] service/all/lib/Lire Program.pm,1.3,1.4

Francis J. Lacoste francis.lacoste at Contre.COM
Tue Aug 28 04:00:35 CEST 2001


On Mon, Aug 27, 2001 at 11:42:12PM +0200, Joost van Baal wrote:
> On Sun, Aug 26, 2001 at 11:32:39AM -0700, Francis J. Lacoste wrote:
> > Update of /cvsroot/logreport/service/all/lib/Lire
> > In directory usw-pr-cvs1:/tmp/cvs-serv6884
> > 
> > Modified Files:
> > 	Program.pm 
> > Log Message:
> > All scripts that use Lire::Program now log performance data
> > and their command line argument.
> 
> Seeing
> 
>     $SIG{__WARN__} = sub {
>         lr_warn( @_ );
>     };
> 
> made me grab the perlvar manpage.  It looks nice.  BTW, do
> we still need lr_run?  What's your opinion on this?
> 

Personnally, I'm not totally happy with the fact that we have to
use lr_run to run most programs. But we still currently need it, because
a huge bulk of Lire configuration is done in the defaults configuration
file which is a shell script that we source.  So we need lr_run to have 
the environment variables properly setup. 

I could think of an awfull hack to parse defaults from perl using something
like 

open ( DEFAULTS, "sh -e 'source /etc/lire/defaults && env |")
    or die "open: $!\n";
while ( <DEFAULTS ) {
   chomp;
   my ( $name, $value ) = /^(\w+)=(.*)$/;
   $ENV{$name} = $value;
}
close DEFAULTS;

This could be made part of Lire::Program, but I'm not sure it's a nice
alternative to lr_run.

What do you think ? If we go with this, it's easy to add to Lire::Program
the setting of logging policy according to the configuration variables. There
is a Syslog interface which is part of perl.

BTW, what do you think of turning lr_spoold into a proper daemon. This is
easy to do in perl ?

-- 
Francis J. Lacoste
francis at Contre.COM
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.logreport.org/pipermail/development/attachments/20010827/2dc25402/attachment.bin 


More information about the Development mailing list