On Mon, Jun 18, 2007 at 04:31:33PM +0200, Rados??aw Koz??owski wrote:
> I'm running mon r1.22 on RHEL 4 with perl 5.8.5 and the following line:
>
> my @log = map { s/\%//mg; } @_;
>
> in
>
> no warnings; # Redefining syslog
> sub syslog {
> eval {
> local $SIG{"__DIE__"}= sub { };
> my @log = map { s/\%//mg; } @_;
> Sys::Syslog::syslog(@log);
> }
> }
> use warnings;
>
> breaks logging to syslogd for me (ie. nothing is being logged). If I
> pass @_ to Sys::Syslog::syslog directly, everything works fine.
>
> What's the idea behind this substitution, why is it needed?
Older versions of the Sys:Syslog module had an interesting feature -
they would crash the calling Perl program if your syslog server was
not running. As of Sys::Syslog-0.15, you can supply an option "nofatal"
when calling openlog(), which will only cause a warning to be emitted
rather than crashing your program.
The workaround above was written before the maintainers of Sys::Syslog
agreed to do anything about the problem - originally when I filed
a bug report they refused to accept it, claiming that it wasn't erroneous
behavior and that to change it now might break someone else's code.
_______________________________________________
mon mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/mon