Two variables are used to track the state, to tell if we are connected or not
my $connected = 0; # flag to indicate if we're connected or not
and
my $ident = ''; # identifiant prepended to each message
($ident is used in sub syslog: "openlog() unless $ident;")
They are not cleaned up in closelog, which makes Sys::Syslog think that it has opened log connection, even that it was already closed.
The full story is covered in http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6935710
Patch I am using to fix the problem looks like this:
===================================== fix ======================================
--- /usr/perl5/5.8.4/lib/i86pc-solaris-64int/Sys/Syslog.pm ¿t kv¿ 21 07:18:49 2009
+++ /home/vm156888/s.pm po b¿e 29 22:03:33 2010
@@ -178,7 +178,9 @@
sub closelog {
$facility = $ident = '';
- disconnect_log();
+ disconnect_log() if $connected;
+ $connected=0;
+ $ident='';
}
sub setlogmask {
================================================================================
I believe that this might also close https://rt.cpan.org/Public/Bug/Display.html?id=49877 (not tested though).
Hope this helps
Thank you
--
Vlad