Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS (http://www.linux-archive.org/centos/)
-   -   Perl - strict.pm not found (http://www.linux-archive.org/centos/711146-perl-strict-pm-not-found.html)

John Horne 10-10-2012 10:38 AM

Perl - strict.pm not found
 
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Warren Young 10-10-2012 11:44 AM

Perl - strict.pm not found
 
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.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

John Horne 10-10-2012 12:38 PM

Perl - strict.pm not found
 
On Wed, 2012-10-10 at 05:44 -0600, Warren Young wrote:
> 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,
>
Hello,

Thanks for this, but no. The program is relatively short, runs okay at
other times throughout the day on this and several other servers (both
CentOS 5 and 6 servers). We have other servers that are much more likely
to run out of file descriptors, and they use 'xymon_event' too
throughout the day with no problem.




John.

--
John Horne Tel: +44 (0)1752 587287
Plymouth University, UK Fax: +44 (0)1752 587001
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

John Horne 10-11-2012 10:34 AM

Perl - strict.pm not found
 
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
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Daniel J Walsh 10-11-2012 03:42 PM

Perl - strict.pm not found
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/11/2012 06:34 AM, John Horne wrote:
> 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.
>
What is the path to strict.pm? Do you see any AVC messages?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB26NYACgkQrlYvE4MpobN4PQCeMfbCgHRDcN 98oVJZezXSWw1w
XoQAoKxjI1gboJLTPP0NGFUgwpWivOnl
=tjgK
-----END PGP SIGNATURE-----
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

John Horne 10-11-2012 03:47 PM

Perl - strict.pm not found
 
On Thu, 2012-10-11 at 11:42 -0400, Daniel J Walsh wrote:
> On 10/11/2012 06:34 AM, John Horne wrote:
> > 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.
> >
> What is the path to strict.pm? Do you see any AVC messages?
>
Hello,

The path is '/usr/share/perl5/strict.pm'.

The audit.log shows:

=============================================
type=AVC msg=audit(1349922579.929:111741): avc: denied { getattr } for
pid=29296 comm="xymon_event" path="/usr/share/perl5/strict.pm" dev=sda1
ino=922261 scontext=system_u:system_r:freshclam_t:s0-s0:c0.c1023
tcontext=system_u:object_r:usr_t:s0 tclass=file
=============================================




John.

--
John Horne Tel: +44 (0)1752 587287
Plymouth University, UK Fax: +44 (0)1752 587001
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Daniel J Walsh 10-11-2012 03:51 PM

Perl - strict.pm not found
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10/11/2012 11:47 AM, John Horne wrote:
> On Thu, 2012-10-11 at 11:42 -0400, Daniel J Walsh wrote:
>> On 10/11/2012 06:34 AM, John Horne wrote:
>>> 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.
>>>
>> What is the path to strict.pm? Do you see any AVC messages?
>>
> Hello,
>
> The path is '/usr/share/perl5/strict.pm'.
>
> The audit.log shows:
>
> ============================================= type=AVC
> msg=audit(1349922579.929:111741): avc: denied { getattr } for pid=29296
> comm="xymon_event" path="/usr/share/perl5/strict.pm" dev=sda1 ino=922261
> scontext=system_u:system_r:freshclam_t:s0-s0:c0.c1023
> tcontext=system_u:object_r:usr_t:s0 tclass=file
> =============================================
>
>
>
>
> John.
>
Yes this should be allowed.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlB26xUACgkQrlYvE4MpobMaFwCgqIANrNdoPO 4u1CoS6qzQlTGC
4GcAoMfP2Vmz8jyPbeqg42vHNMXt0JCi
=uH3I
-----END PGP SIGNATURE-----
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


All times are GMT. The time now is 12:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.