--- On Wed, 7/23/08, Bernhard Aichinger <[EMAIL PROTECTED]> wrote:

> From: Bernhard Aichinger <[EMAIL PROTECTED]>
> Subject: [Simple-evcorr-users] redirecting/piping STDERR from sec
> To: [email protected]
> Date: Wednesday, July 23, 2008, 8:41 AM
> Hi,
> 
> 
> in order to write a wrapper for sec, which filters input, I
> would like to 
> read STDERR from sec.  Just in case error handling has do
> be done by the 
> wrapper.
> 
> Unfortunately, reading the output from sec is not possible
> due to line 388 
> (version 2.4.2):
> 
>    if (-t STDERR)  { print STDERR "$msg\n"; }
> 
> Is the test for tty indispensable?  What are the
> consequences writing to a 
> non-tty?

Bernhard,

the test for tty is part of the log_msg() subroutine which *does not* handle 
unpredictable stderr messages from the Perl instance that is running SEC, but 
it rather concerns the logging of known fault conditions detected by the SEC 
code. The test for tty is done for the following reason -- if stderr is 
connected to tty (which means that SEC is connected to terminal while running), 
the log message is also written to that terminal for debugging purposes only, 
in addition to other logging means. If you want to configure proper logging for 
SEC, I highly recommend using syslog or a separate log file instead (please 
check -log, -syslog, and -debug options which allow for configuring SEC logging 
in various ways).

However, if you are concerned about stderr messages coming from the Perl 
instance that is running SEC, it is possible to get such messages only if SEC 
is not running in a daemon mode. If SEC is run as a daemon, part of the proper 
"daemonization" is redirecting its standard input, output and error to 
/dev/null, in order to relinquish the controlling terminal completely. 
Therefore, you can't read stderr when -detach option is given.

hth,
risto


> 
> 
> - Bernhard
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move
> Developer's challenge
> Build the coolest Linux based applications with Moblin SDK
> & win great prizes
> Grand prize is a trip for two to an Open Source event
> anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Simple-evcorr-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users


      

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to