Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: persson [...] katamail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.27
Fixed in: 0.29



Subject: closelog() appears to not do so
Download (untitled) / with headers
text/plain 698b
Maybe I'm just misunderstanding how it should work, but the following code: ----------------------- use warnings; use strict; use Sys::Syslog qw(:standard :macros); my $ourname = "foodaemon"; openlog($ourname, 'ndelay,pid,perror', 'daemon') or die "Error opening syslog"; syslog(LOG_ERR, "This should go to stderr and syslog"); closelog() or die "Error closing syslog"; openlog($ourname, 'ndelay,pid', 'daemon') or die "Error opening syslog"; syslog(LOG_ERR, "This should only go to syslog"); ----------------------- Prints both messages to stderr (expected: only the first one). This is perl 5, version 14, subversion 1 (v5.14.1) built for x86_64-linux-thread-multi Thanks for any help.
Subject: Re: [rt.cpan.org #70761] closelog() appears to not do so
Date: Tue, 6 Sep 2011 21:30:03 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 414b
persson wrote via RT: Show quoted text
> Maybe I'm just misunderstanding how it should work, but the > following code: > > <snip> > > Prints both messages to stderr (expected: only the first one).
As far as I can tell, this bug was fixed with version 0.29, released earlier this year. See ticket #49877. Can you upgrade to the latest version and try again? -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: persson [...] katamail.com
Download (untitled) / with headers
text/plain 785b
On Tue Sep 06 15:29:38 2011, SAPER wrote: Show quoted text
> persson wrote via RT: >
> > Maybe I'm just misunderstanding how it should work, but the > > following code: > > > > <snip> > > > > Prints both messages to stderr (expected: only the first one).
> > > As far as I can tell, this bug was fixed with version 0.29, released > earlier this year. See ticket #49877. > Can you upgrade to the latest version and try again?
Yes, 0.29 does work, thanks. However the machine where this will run has 5.10 with Sys::Syslog 0.22, and upgrading (either Perl or just the Sys::Syslog module) is probably out of the question (I need to check). Is there a workaround to somehow reset the perror flag from the caller? Otherwise I'll have to refactor the code to not use that sequence of calls. Thanks!
Subject: Re: [rt.cpan.org #70761] closelog() appears to not do so
Date: Wed, 7 Sep 2011 22:44:33 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Download (untitled) / with headers
text/plain 999b
persson wrote via RT: Show quoted text
> Yes, 0.29 does work, thanks. However the machine where this will > run has > 5.10 with Sys::Syslog 0.22, and upgrading (either Perl or just the > Sys::Syslog module) is probably out of the question (I need to check).
Production system? I know this kind of problem. Depending on your OS, a separate package may already be available. For example on Debian and Red Hat: » http://rpm.pbone.net/?search=perl-Sys- Syslog&stat=3&simple=1&srodzaj=3 » http://packages.debian.org/search?keywords=libsys-syslog- perl&searchon=names&suite=all&section=all Show quoted text
> Is there a workaround to somehow reset the perror flag from the > caller?
I can't think of a clean one, sorry. Show quoted text
> Otherwise I'll have to refactor the code to not use that sequence of > calls. Thanks!
If adding another module in the equation is acceptable, you may want to try with IO::CaptureOutput to capture the messages sent to STDERR. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
From: persson [...] katamail.com
On Wed Sep 07 16:44:05 2011, SAPER wrote: Show quoted text
> persson wrote via RT: >
> > Yes, 0.29 does work, thanks. However the machine where this will > > run has > > 5.10 with Sys::Syslog 0.22, and upgrading (either Perl or just the > > Sys::Syslog module) is probably out of the question (I need to check).
> > Production system? I know this kind of problem.
You guessed it. Show quoted text
> Depending on your OS, a separate package may already be available. > For example on Debian and Red Hat: > » http://rpm.pbone.net/?search=perl-Sys- > Syslog&stat=3&simple=1&srodzaj=3 > » http://packages.debian.org/search?keywords=libsys-syslog- > perl&searchon=names&suite=all&section=all
Thanks, I'll have a look. Show quoted text
> > Is there a workaround to somehow reset the perror flag from the > > caller?
> > I can't think of a clean one, sorry. >
> > Otherwise I'll have to refactor the code to not use that sequence of > > calls. Thanks!
> > If adding another module in the equation is acceptable, you may want > to try with IO::CaptureOutput to capture the messages sent to STDERR.
Good suggestion. Thank you again.
From: persson [...] katamail.com
Download (untitled) / with headers
text/plain 115b
BTW, I don't seem to be able to close the bug, but you can close it, as I don't think there's anything else to add.


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.