On Mon, May 13, 2002 at 10:26:01AM -0400, Michael Stenner wrote:
> I've tracked the problem down pretty far.  If syslog-ng is restarted
> after a Sys::Syslog::connect(), and then &syslog() is called, the
> process will die with "Broken Pipe".  
> 
> It does not appear that this can be caught.  I tried wrapping it in an
> eval {} and it still killed the process.
> 
> I'm also not sure where it's coming from.  I grepped through
> /usr/bin/perl and all modules, manpages and included libraries that I
> could find, looking for "Broken Pipe".

Well, "broken pipe" is really the process receiving a SIGPIPE.  So a
possible solution would be something like:

my $old = $SIG{'PIPE'};
$SIG{'PIPE'} = sub { closelog; openlog ... ; }

do logging;

$SIG{'PIPE'} = $old;


around the logging areas.  That way the signal will be trapped when
appropriate and handled.


-- 
Randomly Generated Tagline:
I've generally found Sarathy's tastes to be impeccable, though everyone's
 tastes need pecking now and then.
              -- Larry Wall in <[EMAIL PROTECTED]>

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to