Skip Menu |
 

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 56084
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: Nobody in particular
Requestors: vlmarek [...] volny.cz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.27
Fixed in: 0.28



Download (untitled) / with headers
text/plain 1.1k
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
Subject: Re: [rt.cpan.org #56084]
Date: Tue, 30 Mar 2010 02:15:58 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 1.6k
Hello, Vladimir Marek wrote via RT: Show quoted text
> 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=''; > }
I can understand "disconnect_log() if $connected", but not the other two lines: setting $connected to 0 is the first thing disconnect_log () does, and $ident is set to the empty string just before. Granted, I can move the all resets after calling disconnect_log(). Show quoted text
> I believe that this might also close https://rt.cpan.org/Public/Bug/ > Display.html?id=49877 (not tested though).
(Gack! one of the numerous tickets I haven't answered yet..) I don't think it is related. The problem from that ticket comes from the fact that the options aren't reset at each call of openlog(). I don't know how it's supposed to behave. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #56084] Reset connection tracking vars
Date: Sun, 17 Apr 2011 09:49:53 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 956b
Sébastien Aperghis-Tramoni wrote: Show quoted text
> Vladimir Marek wrote via RT: >
>> 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.
> > I can understand "disconnect_log() if $connected", but not the > other two lines: setting $connected to 0 is the first thing > disconnect_log() does, and $ident is set to the empty string just > before. > Granted, I can move the all resets after calling disconnect_log().
Applied, and released as of Sys::Syslog 0.28, sponsored by the Perl QA Hackathon 2011 in Amsterdam. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.