Page 1 of 1

[RESOLVED] Perl Issues like I've not seen before

PostPosted: Mar 28th, '16, 19:42
by linuxdad
I am busy installing PSAD from Source, normally, I kick off the ./install.pl script, and I'm done. But not this time.

So the issue really comes up here:

Code: Select all
[root@ns3 ~]# /etc/init.d/psad start
Starting psad: Can't load '/root/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Date/Calc/Calc.so' for module Date::Calc: /root/perl5/lib/perl5/x86_64-linux-thread-multi/auto/Date/Calc/Calc.so: undefined symbol: DateCalc_Day_of_Week_to_Text_ at /usr/lib/perl5/5.20.1/x86_64-linux-thread-multi/DynaLoader.pm line 193.
 at /usr/sbin/psad line 3214.
Compilation failed in require at /usr/sbin/psad line 3214.



Unfortunately, it's taken a few days to identify the issue (even with the original developer contacting me back). What I see it the following:

Code: Select all
PERL5LIB="/root/perl5/lib/perl5${PERL5LIB+:}${PERL5LIB}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/root/perl5${PERL_LOCAL_LIB_ROOT+:}${PERL_LOCAL_LIB_ROOT}";
 export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/root/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/root/perl5"; export PERL_MM_OPT;


In the .bashrc script. This is not expected, or desired, as I am trying to implement the same environment on the server, for anyone with Shell Access.

My Questions (since I have none of this on my other servers), who decided to implement this? Why? How do I go back to the previous method (which worked well for my needs. Just because everyone else jumped off of the bridge, doesn't mean I am going to).

The big concern I have (r I would just remove the entries), is the following:
Code: Select all
[root@ns3 ~]# ls /root/perl5/lib/perl5
5.16.0/  CPAN/      IPTables/  Mail/    Sub/
5.20.1/  Date/      lib/       Module/  Test/
Carp/    ExtUtils/  local/     POD2/    x86_64-linux-thread-multi/


What's the best way not to screw up the server, and maintain peace and harmony?

Thank you.

Re: Perl Issues like I've not seen before

PostPosted: Mar 28th, '16, 21:47
by doktor5000
You probably put it yourself there, or your cpan installation did it. As you don't mention how you added the cpan installation, can't help much. FWIW, I don't have that in my ~/.bashrc in my cauldron installs.
Code: Select all
[root@openqa_mga6 ~]# grep -i perl ~/.bashrc
[root@openqa_mga6 ~]#


And the proper way to build Mageia rpm packages from perl cpan modules would be the following, which creates normal rpm packages, does this as regular user, and not as root:
Code: Select all
urpmi perl-devel perl-CPANPLUS perl-CPANPLUS-Dist-Mageia
cpan2dist --format CPANPLUS::Dist::Mageia Date::Calc

See https://wiki.mageia.org/en/Perl_policy#Tools

Why didn't you just install perl-Date-Calc instead of runnign a cpan installation as root?
Code: Select all
[user@openqa_mga6]─[21:47:05]─[~] urpmq --whatprovides 'perl(Date::Calc)'
perl-Date-Calc|perl-Date-Calc

Re: Perl Issues like I've not seen before

PostPosted: Mar 28th, '16, 21:52
by doktor5000
BTW, you already did the same mistake in the past (cpan root installation): viewtopic.php?f=8&t=6585

Re: Perl Issues like I've not seen before

PostPosted: Mar 29th, '16, 17:00
by linuxdad
Hey Doctor,

Thank you for the reply, it would appear that old habits die hard.

I appreciate the response, time to clean that server up.

Can I just delete the entries from the .bashrc script?

Thank you.

Re: Perl Issues like I've not seen before

PostPosted: Mar 29th, '16, 17:21
by doktor5000
linuxdad wrote:Can I just delete the entries from the .bashrc script?

I don't know if you can :) Just back up that .bashrc and remove that perl stuff. By default the bashrc is basically empty and only sources /etc/bashrc, take a look at /etc/skel/ to see the default one.

Re: Perl Issues like I've not seen before

PostPosted: Mar 31st, '16, 13:35
by linuxdad
Resolved. Now why Can't I reformat the subject line??

Re: [RESOLVED] Perl Issues like I've not seen before

PostPosted: Mar 31st, '16, 19:25
by doktor5000
Erm, you did already? :p