Hello, I installed the ClamAV package onto a CentOS 6.3 server using yum. I then modified the /etc/freshclam.conf file to run a perl script whenever the ClamAV databases were updated: OnUpdateExecute /usr/local/bin/xymon_event ... The 'xymon_event' command is used on several servers, and generally works with no problems. However, on this server when the /etc/cron.daily/freshclam script runs in the early morning, I get sent an email error message: ====================================/etc/cron.daily/freshclam: Can't locate strict.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/xymon_event line 15. BEGIN failed--compilation aborted at /usr/local/bin/xymon_event line 15. ==================================== The problem is that 'strict.pm' is located in /usr/share/perl5 (as it is on our other servers), and /usr/share/perl5 is specified in @INC. So I am a bit lost as to why perl seems to think that strict.pm cannot be found. Anyone any ideas? We run ClamAV, with the freshclam cron job and xymon_event, on other servers (albeit CentOS 5.8) with no problems. Thanks, John. -- John Horne Tel: +44 (0)1752 587287 Plymouth University, UK Fax: +44 (0)1752 587001
On 10/10/2012 4:38 AM, John Horne wrote:> > The problem is that 'strict.pm' is located in /usr/share/perl5 (as it is > on our other servers), and /usr/share/perl5 is specified in @INC.Perl can do this is when you've run it out of file handles, then someone tries to load a not-previously-loaded Perl module. The Perl interpreter needs one more file handle to open the new module, but it can't get another from the kernel, so it gives that message. Generally this results from a bug in the code, typically one involving an over-reliance on Perl's garbage collector. Perl will close opened file handles for you eventually, but not as long as it thinks they're still being used. If you have a long-running script, you need to be careful about this if it also opens a lot of files, since the default FD limit per process is 1024 on Linux. You can monitor FD usage in a program with ls /proc/`pidof my-program`/fd | wc -l I don't know if you want to put "xymon_event" in for "my-program" or something higher up, since I don't know anything about that or ClamAV. Regardless, if you see that number climb continuously, then see the problem happen shortly after the number crests 1000, you've confirmed my guess.
On Wed, 2012-10-10 at 11:38 +0100, John Horne wrote:> > the /etc/cron.daily/freshclam script runs in the early morning, I get > sent an email error message: > > ====================================> /etc/cron.daily/freshclam: > > Can't locate strict.pm in @INC (@INC > contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/bin/xymon_event line 15. > BEGIN failed--compilation aborted at /usr/local/bin/xymon_event line 15. > ====================================>Hello, Turns out this is an SELinux issue - the audit.log file shows access to strict.pm being denied. As the problem occurs on 6.3, but not on our 5.8 systems, I have submitted it as a bug to RedHat (#865390) to see what they say. (We have both CentOS and RedHat 5.8/6.3 servers.) John. -- John Horne Tel: +44 (0)1752 587287 Plymouth University, UK Fax: +44 (0)1752 587001