Hi, In redhat 6.1 I used Sys::Syslog in some scripts. The same script doesn't work in Redhat 7. I can't find any solution like changing the syntax etc. This example script doesn't work: --- #!/usr/bin/perl # Syslog variables $ident = "apa"; use Sys::Syslog; # Log to syslog sub logthis { openlog ( $ident,"ndelay","daemon"); syslog ( alert , "@_[0]" ); closelog; } Sys::Syslog::setlogsock("unix") if defined &Sys::Syslog::setlogsock; logthis ("test!"); --- This is the error message: Usage: Sys::Syslog::_PATH_LOG() at /usr/lib/perl5/5.6.0/i386-linux/Sys/Syslog.pm line 277
This problem also occurs with 6.2-based systems. (i've got a "clean and fresh" install of krud's updates) ## stig/POD1 (pts/0) -- Sat Nov 18 -- 19:24:04 ## ## /ice/tmp >> cat test.pl use Sys::Syslog; openlog('fooprogram', 'pid,nowait','mail'); syslog('notice', 'this is another test'); syslog('mail|warning', 'this is a better test: %d', time); closelog(); ## stig/POD1 (pts/0) -- Sat Nov 18 -- 19:24:17 ## ## /ice/tmp >> perl -w test.pl Constant subroutine __stub_lgammal redefined at /usr/lib/perl5/5.00503/i386-linux/gnu/stubs.ph line 58. Constant subroutine __stub_lgammal_r redefined at /usr/lib/perl5/5.00503/i386-linux/gnu/stubs.ph line 64. Constant subroutine __need___va_list undefined at /usr/lib/perl5/5.00503/i386-linux/stdarg.ph line 9. ## stig/POD1 (pts/0) -- Sat Nov 18 -- 19:24:23 ## ## /ice/tmp >> whperl bash: whperl: command not found ## stig/POD1 (pts/0) -- Sat Nov 18 -- 19:24:34 ## ## /ice/tmp >> wh perl perl is hashed (/usr/bin/perl) -- -rwxr-xr-x 2 root root 527888 Aug 10 12:37 /usr/bin/perl -- Name : perl Relocations: (not relocateable) Version : 5.00503 Vendor: Red Hat, Inc. Release : 12 Build Date: Thu 10 Aug 2000 12:37:21 PM PDT Install date: Thu 16 Nov 2000 08:31:01 PM PST Build Host: porky.devel.redhat.com Group : Development/Languages Source RPM: perl-5.00503-12.src.rpm Size : 14005304 License: GPL Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> Summary : The Perl programming language. Description : Perl is a high-level programming language with roots in C, sed, awk and shell scripting. Perl is good at handling processes and files, and is especially good at handling text. Perl's hallmarks are practicality and efficiency. While it is used to do a lot of different things, Perl's most common applications are system administration utilities and web programming. A large proportion of the CGI scripts on the web are written in Perl. You need the perl package installed on your system so that your system can handle Perl scripts. Install this package if you want to program in Perl or enable your system to handle Perl scripts. ## stig/POD1 (pts/0) -- Sat Nov 18 -- 19:24:36 ## ## /ice/tmp >> pg kernel kernel-headers-2.2.16-3 kernel-2.2.16-3 kernel-pcmcia-cs-2.2.16-3 kernel-source-2.2.16-3 kernel-utils-2.2.16-3 kernelcfg-0.5-5
tom (the latest author of the Syslog.pm file) suggests the following patch to Syslog.pm I have tried this under RH7.0 and it works. 277c277 > my $syslog = &_PATH_LOG || croak "_PATH_LOG not found in syslog.ph"; < my $syslog = _PATH_LOG() || croak "_PATH_LOG not found in syslog.ph";
This fix is made in the Syslog.pm that comes with perl-5.6.1. Use perl-5.6.1. If you are affected by this bug, I have built a perl-5.6.1 RPM based on RedHat's perl-5.6.0. Email me if you want it.
perl 5.6.1 is in rawhide now, and this bug would seem to be gone