Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: WALTMAN [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.16
Fixed in: 0.17



Subject: Can't log to unix sockets
The following code illustrates the problem in Sys-Syslog-0.16: #!/usr/local/bin/perl -w use strict; use Sys::Syslog qw(:DEFAULT setlogsock); setlogsock("unix") or die "error on setlogsock(): $!"; openlog("test_syslog", "ndelay,pid", "local0") or die "error on openlog(): $!"; syslog("info", "test") or die "error on syslog(): $!"; closelog or die "error on closelog(): $!"; When I run this, I get the following error: no connection to syslog available - _PATH_LOG not available in syslog.h at test_syslog.pl line 7 I noticed the problem when I rebooted this evening and spamd (part of spamassassin 3.1.3) printed this error when it restarted. This patch appears to fix it: --- Syslog.pm.orig 2006-06-20 17:22:31.000000000 -0400 +++ Syslog.pm 2006-07-21 23:32:39.000000000 -0400 @@ -520,7 +520,7 @@ my ($errs) = @_; if (not defined $syslog_path and length _PATH_LOG()) { $syslog_path = _PATH_LOG(); - } else { + } elsif (not defined $syslog_path) { push @$errs, "_PATH_LOG not available in syslog.h"; return 0; } And finally, some information about my platform: % perl -v This is perl, v5.8.8 built for i686-linux % uname -a Linux caspar 2.6.16-2-686-smp #1 SMP Sat Jul 15 22:33:00 UTC 2006 i686 GNU/Linux
Subject: Re: [rt.cpan.org #20622] Can't log to unix sockets
Date: Sat, 22 Jul 2006 20:58:03 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Show quoted text
> The following code illustrates the problem in Sys-Syslog-0.16: [...] > When I run this, I get the following error: > > no connection to syslog available > - _PATH_LOG not available in syslog.h at test_syslog.pl line 7
I can't reproduce this on my Linux system, but I can on my OSX. Show quoted text
> I noticed the problem when I rebooted this evening and spamd (part of > spamassassin 3.1.3) printed this error when it restarted.
Ouch. Breaking Spamassassin is not good. Breaking spammers would be a better option. Show quoted text
> This patch appears to fix it:
Thanks, applied. Show quoted text
> And finally, some information about my platform: [...]
Thanks. Could you also tell me the syslog daemon used on your distribution and, if you know it, how it's configured, which connection mechanisms it accepts ? -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #20622] Can't log to unix sockets
Date: Sat, 22 Jul 2006 15:33:58 -0400
To: Sébastien Aperghis-Tramoni via RT <bug-Sys-Syslog [...] rt.cpan.org>
From: Walt Mankowski <waltman [...] pobox.com>
On Sat, Jul 22, 2006 at 02:46:27PM -0400, Sébastien Aperghis-Tramoni via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=20622 > > >
> > The following code illustrates the problem in Sys-Syslog-0.16: [...] > > When I run this, I get the following error: > > > > no connection to syslog available > > - _PATH_LOG not available in syslog.h at test_syslog.pl line 7
> > I can't reproduce this on my Linux system, but I can on my OSX.
I'm surprised by that. I haven't looked at the entire module, but at least on the surface it seems to be a pretty obvious bug. When setlogsock() is called with "unix", it sets $syslog_path on line 160. So then when connect_unix() is called, $syslog_path is defined so it falls into the else block and reports the error. I'm curious how it *doesn't* fail on your Linux system. Show quoted text
> > I noticed the problem when I rebooted this evening and spamd (part of > > spamassassin 3.1.3) printed this error when it restarted.
> > Ouch. Breaking Spamassassin is not good. Breaking spammers would be a > better option.
Indeed. It looks like what happened is that I hadn't restarted spamd in about 2 months, so it was still running with an older version of Sys::Syslog that didn't have this bug. But when I rebooted last night it picked up the new version and reported the error. Show quoted text
> > This patch appears to fix it:
> > Thanks, applied.
Cool. Show quoted text
> Thanks. Could you also tell me the syslog daemon used on your distribution > and, if you know it, how it's configured, which connection mechanisms it > accepts ?
I'm running sysklogd version 1.4.1-18, which is the lastest version in Debian testing. As far as I know I've never made any changes to Debian's default settings for it. The socket it uses for unix sockets is /dev/log. Walt
Subject: Re: [rt.cpan.org #20622] Can't log to unix sockets
Date: Sun, 23 Jul 2006 04:18:21 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Show quoted text
>> I can't reproduce this on my Linux system, but I can on my OSX.
> > I'm curious how it *doesn't* fail on your Linux system.
That's because I'm stoopid: the Sys::Syslog module on my Linux was only version 0.13. Show quoted text
>>> This patch appears to fix it:
>> >> Thanks, applied.
> > Cool.
I just uploaded version 0.17 on the CPAN. Thanks for your bug report. Sébastien Aperghis-Tramoni -- - --- -- - -- - --- -- - --- -- - --[ http://maddingue.org ] Close the world, txEn eht nepO