Skip Menu |

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

Report information
The Basics
Id: 40305
Status: open
Priority: 0/
Queue: Sys-Syslog

People
Owner: Nobody in particular
Requestors: vladimir_yanakiev [...] fanniemae.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Code works with Solaris 8, but not with Solaris 10
Date: Thu, 23 Oct 2008 09:59:09 -0400
To: <bug-Sys-Syslog [...] rt.cpan.org>
From: "Yanakiev, Vladimir" <vladimir_yanakiev [...] fanniemae.com>
I need to send syslog messages over local 'stream' interface, not on UDP or TCP. Using Solaris 8, I have success: root@labser12# uname -a SunOS labser12 5.8 Generic_117350-54 sun4u sparc SUNW,Ultra-250 root@labser12# pkginfo -l SUNWpl5u PKGINST: SUNWpl5u NAME: Perl 5.005_03 CATEGORY: system ARCH: sparc VERSION: 11.8.0,REV=2000.01.08.18.12 BASEDIR: / VENDOR: Sun Microsystems, Inc. DESC: Perl 5 programming language PSTAMP: on28-patch20060307150522 INSTDATE: Jul 24 2008 11:44 HOTLINE: Please contact your local service provider STATUS: completely installed FILES: 535 installed pathnames 4 shared pathnames 3 linked files 63 directories 33 executables 9924 blocks used (approx) root@labser12# cat test #!/usr/bin/perl -w ######################################################################## ####### # ------------------------------------------------------------------------ ----- # Vladimir Yanakiev # System Engineer # (c) Fannie Mae # # October 14, 2008 # # ======================================================================== ===== # 10/14/2008 s5uvry 1.00 First release. # ======================================================================== ===== # Use progVersion=%I% for fudge and other scripts managed by sccs. my $progVersion=1.00; my $progUserId=s5uvry; #----------------------------------------------- # Used OS modules #----------------------------------------------- use strict; use File::stat; use File::Basename; use File::Path; use Sys::Syslog qw(:DEFAULT setlogsock); use Sys::Hostname; #----------------------------------------------- # Get host and command names: my $Host = hostname; if (-f "/etc/VRTSvcs/conf/sysname"){ open(NAME, "/etc/VRTSvcs/conf/sysname"); $Host=<NAME>; close NAME; } my $Cmd=basename($0); setlogsock('unix','/dev/console'); openlog('tester','ndelay,cons','user'); syslog('LOG_NOTICE|LOG_DAEMON', "Successful unix test"); closelog(); root@labser12# tail /var/adm/messages . . . Oct 23 09:34:28 labser12.fanniemae.com tester: Successful unix test If I replace the ('unix','/dev/console') with ('stream'), system complains: root@labser12# ./test Invalid argument passed to setlogsock; must be 'unix' or 'inet' at ./test line 40 This code gives error message, but still works in Solaris 10: root@labser14# uname -a SunOS labser14 5.10 Generic_137111-06 sun4u sparc SUNW,Sun-Fire-V240 root@labser14# pkginfo -l SUNWperl584core PKGINST: SUNWperl584core NAME: Perl 5.8.4 (core) CATEGORY: system ARCH: sparc VERSION: 11.10.0,REV=2005.01.21.15.53 BASEDIR: / VENDOR: Sun Microsystems, Inc. DESC: Perl 5.8.4 programming language (core) PSTAMP: on10-patch20080523141917 INSTDATE: Sep 30 2008 18:25 HOTLINE: Please contact your local service provider STATUS: completely installed FILES: 559 installed pathnames 18 shared pathnames 1 linked files 113 directories 36 executables 10042 blocks used (approx) root@labser14# pkginfo -l SUNWperl584usr PKGINST: SUNWperl584usr NAME: Perl 5.8.4 (non-core) CATEGORY: system ARCH: sparc VERSION: 11.10.0,REV=2005.01.21.15.53 BASEDIR: / VENDOR: Sun Microsystems, Inc. DESC: Perl 5.8.4 programming language (non-core) PSTAMP: on10-patch20080523141918 INSTDATE: Sep 30 2008 18:25 HOTLINE: Please contact your local service provider STATUS: completely installed FILES: 938 installed pathnames 14 shared pathnames 2 linked files 78 directories 48 executables 41232 blocks used (approx) root@labser14# ./test unix passed to setlogsock, but path not available at ./test line 39 root@labser14# tail /var/adm/messages . . . . Oct 23 09:48:27 labser14.fanniemae.com tester: Successful unix test If I try ('stream'), it simply doesn't send the message. What is wrong? This e-mail and its attachments are confidential and solely for the intended addressee(s). Do not share or use them without Fannie Mae's approval. If received in error, contact the sender and delete them.
Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Fri, 24 Oct 2008 02:36:53 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Hello, Vladimir Yanakiev wrote: Show quoted text
> I need to send syslog messages over local 'stream' interface, not > on UDP > or TCP. Using Solaris 8, I have success: [...] > > If I replace the ('unix','/dev/console') with ('stream'), system > complains: [...] > > This code gives error message, but still works in Solaris 10:[..] > > If I try ('stream'), it simply doesn't send the message. What is > wrong?
If I sum up: - on Perl 5.005_03 / Solaris 8: - setlogsock("unix", "/dev/console") => works - setlogsock("stream") => complains but works - on Perl 5.8.4 / Solaris 10: - setlogsock("unix", "/dev/console") => works - setlogsock("stream") => doesn't work I guess you're using the versions shipped with their respective Perl distribution, which means a version so old it wasn't even numbered in Perl 5.005_03, and version 0.05 in Perl 5.8.4. The behaviour on Perl 5.005_03 / Solaris 8 is normal: "stream" wasn't a supported mechanism at that time, so setlogsock() complains and defaults on "unix". The behaviour on Perl 5.8.4 / Solaris 10 make come from an incompatible change in Solaris itself. As noted in the comments, the "stream" mechanism is a little dodgy: # XXX: this only works if the OS stream implementation makes a write # look like a putmsg() with simple header. For instance it works on # Solaris 8 but not Solaris 7. # To be correct, it should use a STREAMS API, but perl doesn't have one. I don't know if Sun kept this in Solaris 10. A simple solution is to upgrade to a recent Sys::Syslog, which now have support for true native syslog(3), using the actual C functions. It's also the default mechanism so you don't need to specify it with setlogsock() (in fact, using this function is now strongly discouraged). With this, your Perl programs will behave exactly like any other program sending message to the syslog subsystem, easing further dispatching from within the daemon. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: RE: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Fri, 24 Oct 2008 08:22:11 -0400
To: <bug-Sys-Syslog [...] rt.cpan.org>
From: "Yanakiev, Vladimir" <vladimir_yanakiev [...] fanniemae.com>
Thanks for the response, Sebastien! I would like to correct your sum up: - on Perl 5.005_03 / Solaris 8: - setlogsock("unix", "/dev/console") => works - setlogsock("stream") => does not work - error message "must be unix or UDP" - on Perl 5.8.4 / Solaris 10: - setlogsock("unix", "/dev/console") => complains "path not found", but works - setlogsock("stream") => doesn't work Where can I get the latest Sys::Syslog? How my syntax will change with it? Thanks again! V. This e-mail and its attachments are confidential and solely for the intended addressee(s). Do not share or use them without Fannie Mae's approval. If received in error, contact the sender and delete them. Show quoted text
-----Original Message----- From: Sébastien Aperghis-Tramoni via RT [mailto:bug-Sys-Syslog@rt.cpan.org] Sent: Thursday, October 23, 2008 8:37 PM To: Yanakiev, Vladimir Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10 <URL: http://rt.cpan.org/Ticket/Display.html?id=40305 > Hello, Vladimir Yanakiev wrote:
> I need to send syslog messages over local 'stream' interface, not > on UDP > or TCP. Using Solaris 8, I have success: [...] > > If I replace the ('unix','/dev/console') with ('stream'), system > complains: [...] > > This code gives error message, but still works in Solaris 10:[..] > > If I try ('stream'), it simply doesn't send the message. What is > wrong?
If I sum up: - on Perl 5.005_03 / Solaris 8: - setlogsock("unix", "/dev/console") => works - setlogsock("stream") => complains but works - on Perl 5.8.4 / Solaris 10: - setlogsock("unix", "/dev/console") => works - setlogsock("stream") => doesn't work I guess you're using the versions shipped with their respective Perl distribution, which means a version so old it wasn't even numbered in Perl 5.005_03, and version 0.05 in Perl 5.8.4. The behaviour on Perl 5.005_03 / Solaris 8 is normal: "stream" wasn't a supported mechanism at that time, so setlogsock() complains and defaults on "unix". The behaviour on Perl 5.8.4 / Solaris 10 make come from an incompatible change in Solaris itself. As noted in the comments, the "stream" mechanism is a little dodgy: # XXX: this only works if the OS stream implementation makes a write # look like a putmsg() with simple header. For instance it works on # Solaris 8 but not Solaris 7. # To be correct, it should use a STREAMS API, but perl doesn't have one. I don't know if Sun kept this in Solaris 10. A simple solution is to upgrade to a recent Sys::Syslog, which now have support for true native syslog(3), using the actual C functions. It's also the default mechanism so you don't need to specify it with setlogsock() (in fact, using this function is now strongly discouraged). With this, your Perl programs will behave exactly like any other program sending message to the syslog subsystem, easing further dispatching from within the daemon. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Fri, 24 Oct 2008 15:17:20 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Vladimir Yanakiev wrote: Show quoted text
> Thanks for the response, Sebastien! I would like to correct your sum up: > > - on Perl 5.005_03 / Solaris 8: > - setlogsock("unix", "/dev/console") => works > - setlogsock("stream") => does not work - error message "must be unix > or UDP" > > - on Perl 5.8.4 / Solaris 10: > - setlogsock("unix", "/dev/console") => complains "path not found", > but works > - setlogsock("stream") => doesn't work > > Where can I get the latest Sys::Syslog?
From the CPAN, where you opened this ticket in the first place: » http://search.cpan.org/dist/Sys-Syslog/ Depending on how your system is configured, you can use the CPAN shell by executing the "cpan" command, or, if it's not installed, "perl -MCPAN -eshell", and typing "install Sys::Syslog". If your CPAN shell isn't configured and you don't want to configure it, simply download the latest Sys::Syslog tarball, unpack it ans run "perl Makefile.PL && make all test", then run "make install" as root. Show quoted text
> How my syntax will change with it?
You should have nothing to change except removing the setlogsock() calls. Sys::Syslog will by default use the native syslog(3) mechanism. If you have a problem, don't hesistate to mail me through this ticket. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: RE: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Fri, 24 Oct 2008 09:30:58 -0400
To: <bug-Sys-Syslog [...] rt.cpan.org>
From: "Yanakiev, Vladimir" <vladimir_yanakiev [...] fanniemae.com>
After changing Syslog.pm to 0.27: Sys::Syslog object version 0.05 does not match bootstrap parameter 0.27 at /usr/perl5/5.8.4/lib/sun4-solaris-64int/Sys/Syslog.pm line 70. Compilation failed in require at test line 26. main::BEGIN() called at /usr/perl5/5.8.4/lib/sun4-solaris-64int/Sys/Syslog.pm line 26 eval {...} called at /usr/perl5/5.8.4/lib/sun4-solaris-64int/Sys/Syslog.pm line 26 BEGIN failed--compilation aborted at test line 26. How must I upgrade to this version? V. This e-mail and its attachments are confidential and solely for the intended addressee(s). Do not share or use them without Fannie Mae's approval. If received in error, contact the sender and delete them. Show quoted text
-----Original Message----- From: Sébastien Aperghis-Tramoni via RT [mailto:bug-Sys-Syslog@rt.cpan.org] Sent: Thursday, October 23, 2008 8:37 PM To: Yanakiev, Vladimir Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10 <URL: http://rt.cpan.org/Ticket/Display.html?id=40305 > Hello, Vladimir Yanakiev wrote:
> I need to send syslog messages over local 'stream' interface, not > on UDP > or TCP. Using Solaris 8, I have success: [...] > > If I replace the ('unix','/dev/console') with ('stream'), system > complains: [...] > > This code gives error message, but still works in Solaris 10:[..] > > If I try ('stream'), it simply doesn't send the message. What is > wrong?
If I sum up: - on Perl 5.005_03 / Solaris 8: - setlogsock("unix", "/dev/console") => works - setlogsock("stream") => complains but works - on Perl 5.8.4 / Solaris 10: - setlogsock("unix", "/dev/console") => works - setlogsock("stream") => doesn't work I guess you're using the versions shipped with their respective Perl distribution, which means a version so old it wasn't even numbered in Perl 5.005_03, and version 0.05 in Perl 5.8.4. The behaviour on Perl 5.005_03 / Solaris 8 is normal: "stream" wasn't a supported mechanism at that time, so setlogsock() complains and defaults on "unix". The behaviour on Perl 5.8.4 / Solaris 10 make come from an incompatible change in Solaris itself. As noted in the comments, the "stream" mechanism is a little dodgy: # XXX: this only works if the OS stream implementation makes a write # look like a putmsg() with simple header. For instance it works on # Solaris 8 but not Solaris 7. # To be correct, it should use a STREAMS API, but perl doesn't have one. I don't know if Sun kept this in Solaris 10. A simple solution is to upgrade to a recent Sys::Syslog, which now have support for true native syslog(3), using the actual C functions. It's also the default mechanism so you don't need to specify it with setlogsock() (in fact, using this function is now strongly discouraged). With this, your Perl programs will behave exactly like any other program sending message to the syslog subsystem, easing further dispatching from within the daemon. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Fri, 24 Oct 2008 15:17:20 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Vladimir Yanakiev wrote: Show quoted text
> Thanks for the response, Sebastien! I would like to correct your sum up: > > - on Perl 5.005_03 / Solaris 8: > - setlogsock("unix", "/dev/console") => works > - setlogsock("stream") => does not work - error message "must be unix > or UDP" > > - on Perl 5.8.4 / Solaris 10: > - setlogsock("unix", "/dev/console") => complains "path not found", > but works > - setlogsock("stream") => doesn't work > > Where can I get the latest Sys::Syslog?
From the CPAN, where you opened this ticket in the first place: » http://search.cpan.org/dist/Sys-Syslog/ Depending on how your system is configured, you can use the CPAN shell by executing the "cpan" command, or, if it's not installed, "perl -MCPAN -eshell", and typing "install Sys::Syslog". If your CPAN shell isn't configured and you don't want to configure it, simply download the latest Sys::Syslog tarball, unpack it ans run "perl Makefile.PL && make all test", then run "make install" as root. Show quoted text
> How my syntax will change with it?
You should have nothing to change except removing the setlogsock() calls. Sys::Syslog will by default use the native syslog(3) mechanism. If you have a problem, don't hesistate to mail me through this ticket. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: RE: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Fri, 24 Oct 2008 11:32:36 -0400
To: <bug-Sys-Syslog [...] rt.cpan.org>
From: "Yanakiev, Vladimir" <vladimir_yanakiev [...] fanniemae.com>
So far - so good: root@labser14# perl -MSys::Syslog -wle'print $Sys::Syslog::VERSION' 0.27 But now I can't send anything: root@labser14# cat test #!/usr/bin/perl -w #----------------------------------------------- # Used OS modules #----------------------------------------------- use strict; use File::stat; use File::Basename; use File::Path; use Sys::Syslog qw(:DEFAULT setlogsock); use Sys::Hostname; openlog('tester','ndelay','user'); syslog('notice|daemon', "Other Successful stream test"); closelog(); root@labser14# logger -p daemon.notice -t info "This is test message" root@labser14# tail /var/adm/messages . . Oct 24 11:28:21 labser14 info: [ID 702911 daemon.notice] This is test message root@labser14# ./test ... Nothing in syslog. The module connect to "native", and does not complain about anything. Using "unix" croax... V. This e-mail and its attachments are confidential and solely for the intended addressee(s). Do not share or use them without Fannie Mae's approval. If received in error, contact the sender and delete them. Show quoted text
-----Original Message----- From: Sébastien Aperghis-Tramoni via RT [mailto:bug-Sys-Syslog@rt.cpan.org] Sent: Friday, October 24, 2008 10:40 AM To: Yanakiev, Vladimir Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10 <URL: http://rt.cpan.org/Ticket/Display.html?id=40305 > Vladimir Yanakiev wrote:
> Thanks for the response, Sebastien! I would like to correct your sum up: > > - on Perl 5.005_03 / Solaris 8: > - setlogsock("unix", "/dev/console") => works > - setlogsock("stream") => does not work - error message "must be unix > or UDP" > > - on Perl 5.8.4 / Solaris 10: > - setlogsock("unix", "/dev/console") => complains "path not found", > but works > - setlogsock("stream") => doesn't work > > Where can I get the latest Sys::Syslog?
From the CPAN, where you opened this ticket in the first place: » http://search.cpan.org/dist/Sys-Syslog/ Depending on how your system is configured, you can use the CPAN shell by executing the "cpan" command, or, if it's not installed, "perl -MCPAN -eshell", and typing "install Sys::Syslog". If your CPAN shell isn't configured and you don't want to configure it, simply download the latest Sys::Syslog tarball, unpack it ans run "perl Makefile.PL && make all test", then run "make install" as root.
> How my syntax will change with it?
You should have nothing to change except removing the setlogsock() calls. Sys::Syslog will by default use the native syslog(3) mechanism. If you have a problem, don't hesistate to mail me through this ticket. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Mon, 27 Oct 2008 08:56:48 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Vladimir Yanakiev wrote via RT: Show quoted text
> So far - so good: > > root@labser14# perl -MSys::Syslog -wle'print $Sys::Syslog::VERSION' > 0.27 > > But now I can't send anything[...] > root@labser14# logger -p daemon.notice -t info "This is test message" > root@labser14# tail /var/adm/messages > . > . > Oct 24 11:28:21 labser14 info: [ID 702911 daemon.notice] This is > test message > root@labser14# ./test > ... > > Nothing in syslog. The module connect to "native", and does not > complain about anything. Using "unix" croax...
Could you try compiling and executing this C code? #include <syslog.h> int main(void) { openlog("tester", LOG_NDELAY, LOG_USER); syslog(LOG_NOTICE|LOG_DAEMON, "another syslog test (from C)"); closelog(); return 0; } On my system (OSX), both this code and its Perl equivalent successfully send message to syslog, and should behave similar on all POSIX systems. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: RE: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Mon, 27 Oct 2008 09:57:21 -0400
To: <bug-Sys-Syslog [...] rt.cpan.org>
From: "Yanakiev, Vladimir" <vladimir_yanakiev [...] fanniemae.com>
Sebastien, I believe I sort out the things - within the new code (I checked Perl 5.8.4 with Syslog.pm Ver 0.27 and Perl 5.10.0 Syslog.pm Ver 0.22) if omit the setlogsock part the Syslog defaults to "native", which, to my understanding is "streams" for Solaris 10 - is this correct? In this case my problem appears to be solved, and the only outstanding issue is the functionality of the setlogsock piece itself... V. This e-mail and its attachments are confidential and solely for the intended addressee(s). Do not share or use them without Fannie Mae's approval. If received in error, contact the sender and delete them. Show quoted text
-----Original Message----- From: Sébastien Aperghis-Tramoni via RT [mailto:bug-Sys-Syslog@rt.cpan.org] Sent: Monday, October 27, 2008 3:57 AM To: Yanakiev, Vladimir Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10 <URL: http://rt.cpan.org/Ticket/Display.html?id=40305 > Vladimir Yanakiev wrote via RT:
> So far - so good: > > root@labser14# perl -MSys::Syslog -wle'print $Sys::Syslog::VERSION' > 0.27 > > But now I can't send anything[...] > root@labser14# logger -p daemon.notice -t info "This is test message" > root@labser14# tail /var/adm/messages > . > . > Oct 24 11:28:21 labser14 info: [ID 702911 daemon.notice] This is > test message > root@labser14# ./test > ... > > Nothing in syslog. The module connect to "native", and does not > complain about anything. Using "unix" croax...
Could you try compiling and executing this C code? #include <syslog.h> int main(void) { openlog("tester", LOG_NDELAY, LOG_USER); syslog(LOG_NOTICE|LOG_DAEMON, "another syslog test (from C)"); closelog(); return 0; } On my system (OSX), both this code and its Perl equivalent successfully send message to syslog, and should behave similar on all POSIX systems. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.
Subject: Re: [rt.cpan.org #40305] Code works with Solaris 8, but not with Solaris 10
Date: Tue, 28 Oct 2008 09:01:33 +0100
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Vladimir Yanakiev wrote via RT: Show quoted text
> I believe I sort out the things - within the new code (I checked > Perl 5.8.4 with Syslog.pm Ver 0.27 and Perl 5.10.0 Syslog.pm Ver > 0.22) if omit the setlogsock part the Syslog defaults to "native", > which, to my understanding is "streams" for Solaris 10 - is this > correct? In this case my problem appears to be solved, and the only > outstanding issue is the functionality of the setlogsock piece > itself...
No: since version 0.16, the default mechanisme for sending message to syslog is to use the "native" one, calling the POSIX functions syslog (3). ("native" is probably not a very good name but I didn't have a better one, and "unix" was already taken.) The general rule is to avoid calling setlogsock() so Sys::Syslog can select the best default mechanism: "native" on Unix, "eventlog" on Win32. -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.