linux - Perl modules not loading correctly when running as non-root user -


i'm running issue perl on linux system.

when installing new modules (as root), have issues running scripts regular user, not able access new module without manually going in , chmod 775'ing module related files , directories.

i performed cpan upgrade, installing several modules new project. now, perl has become unusable regular user, because of errors don't appear permissions related.

for example, following simple script runs fine root, returns error run regular user:

#!/usr/bin/perl use strict; use warnings; use scalar::util; 

as can see, script literally nothing except attempt load scalar::util module. regular user, returns error:

**list::util object version 1.21 not match bootstrap parameter 1.42 @ /usr/lib64/perl5/dynaloader.pm line 223. compilation failed in require @ /usr/local/lib64/perl5/scalar/util.pm line 22. compilation failed in require @ ./scalar-test.pl line 4. begin failed--compilation aborted @ ./scalar-test.pl line 4** 

when sudo cpan , try install list::util, back: list::util date (1.42).

clarification: this happening several modules, not 1 example. not appear affect every module upgraded though; it's several though.

the fact root can run scripts says me either there another, underlying permissions issue i'm not seeing, or perl configured different in way root regular account causing not find module.

a search list.pm file returning:

 » sudo find / -name list.pm   /usr/share/perl5/i18n/langtags/list.pm /opt/ov/nonov/perl/a/lib/5.8.8/i18n/langtags/list.pm /root/.cpan/build/perl-5.22.1-d0_efo/dist/i18n-langtags/lib/i18n/langtags/list.pm   » ls -l /usr/share/perl5/i18n/langtags/list.pm -rw-r--r-- 1 root root 28826 nov  6  2014 /usr/share/perl5/i18n/langtags/list.pm   » ls -l /opt/ov/nonov/perl/a/lib/5.8.8/i18n/langtags/list.pm -r--r--r-- 1 bin bin 28826 nov 30  2012 /opt/ov/nonov/perl/a/lib/5.8.8/i18n/langtags/list.pm   » sudo ls -l /root/.cpan/build/perl-5.22.1-d0_efo/dist/i18n-langtags/lib/i18n/langtags/list.pm -r--r--r-- 1 1018 513 28826 oct 17 08:32 /root/.cpan/build/perl-5.22.1-d0_efo/dist/i18n-langtags/lib/i18n/langtags/list.pm 

system rhel 6.6 x64, perl v5.10.1


**» type perl** perl hashed (/usr/bin/perl)  **» perl** /usr/bin/perl   **» sudo type perl** sudo: type: command not found   **» sudo perl** /usr/bin/perl  **» echo ${!perl*}** [nothing returned]   **» sudo echo ${!perl*}** [nothing returned]  **» perl -wle 'print join("\n", @inc)'** /usr/local/lib64/perl5  /usr/local/share/perl5  /usr/lib64/perl5/vendor_perl  /usr/share/perl5/vendor_perl  /usr/lib64/perl5  /usr/share/perl5  [run sudo returns identical list]  [edited brevity]  cpan[1]> o conf  $cpan::config options /usr/share/perl5/cpan/config.pm:  build_dir [/root/.cpan/build]  build_dir_reuse [0]  build_requires_install_policy [ask/yes]  connect_to_internet_ok [1]  cpan_home [/root/.cpan]  keep_source_where [/root/.cpan/sources]  make [/usr/bin/make]  make_install_make_command [/usr/bin/make]  makepl_arg [installdirs=site]  prefer_installer [mb]  prefs_dir [/root/.cpan/prefs]  

i redacted few lines here other user's folders

 » sudo find / -name util.pm | grep "list/util.pm" /usr/lib64/perl5/list/util.pm /usr/local/lib64/perl5/list/util.pm /home/{username redacted}/.cpanm/work/1448660183.31550/extutils-makemaker-7.10/bundled/scalar-list-utils/list/util.pm /root/.cpan/build/scalar-list-utils-1.42-2c3onp/lib/list/util.pm /root/.cpan/build/scalar-list-utils-1.42-2c3onp/blib/lib/list/util.pm /root/.cpan/build/scalar-list-utils-1.42-nowu0a/lib/list/util.pm /root/.cpan/build/scalar-list-utils-1.42-nowu0a/blib/lib/list/util.pm /root/.cpan/build/perl-5.22.1-d0_efo/cpan/scalar-list-utils/lib/list/util.pm 

per request of brian d foy, installed new module. module config::onion not installed, nothing old conflict. module installs ok, created onion-test.pl script, same above, , has same issue loads module root.

 » sudo perl -mconfig::onion -e 'print "module: " . $argv[0] . "\nversion: " . $argv[0]->version . "\n\n"' config::onion can't locate config/onion.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 .). begin failed--compilation aborted.   » sudo cpan terminal not support addhistory.  cpan shell -- cpan exploration , modules installation (v2.10) enter 'h' help.  cpan[1]> install config::onion  [redacted brevity. no errors noted during process.]  result: pass   dsheroh/config-onion-1.004.tar.gz   /usr/bin/make test -- ok running make install prepending /root/.cpan/build/config-onion-1.004-tigyut/blib/arch /root/.cpan/build/config-onion-1.004-tigyut/blib/lib perl5lib 'install' manifying 2 pod documents installing /usr/local/share/perl5/config/onion.pm installing /usr/local/share/perl5/config/onion/simple.pm installing /usr/local/share/man/man3/config::onion.3pm installing /usr/local/share/man/man3/config::onion::simple.3pm appending installation info /usr/lib64/perl5/perllocal.pod   dsheroh/config-onion-1.004.tar.gz   /usr/bin/make install  -- ok   » cd /usr/local/share/perl5/config  » sudo ls -l  onion total 4 -r--r--r-- 1 root root 1856 may  9  2014 simple.pm   » sudo find / -name onion.pm /usr/local/share/perl5/config/onion.pm /root/.cpan/build/config-onion-1.004-tigyut/lib/config/onion.pm /root/.cpan/build/config-onion-1.004-tigyut/blib/lib/config/onion.pm   onion-test.pl:  #!/usr/bin/perl use strict; use warnings;  use config::onion;     » ./onion-test.pl can't locate hash/merge/simple.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 .) @ /usr/local/share/perl5/config/onion.pm line 9. begin failed--compilation aborted @ /usr/local/share/perl5/config/onion.pm line 9. compilation failed in require @ ./onion-test.pl line 29. begin failed--compilation aborted @ ./onion-test.pl line 29.    » sudo ./onion-test.pl [no errors] 

per ikegami, ran command:

sudo chmod -r go+rx                   \    /usr/local/lib64/perl5        \    /usr/local/share/perl5        \    /usr/lib64/perl5/vendor_perl  \    /usr/share/perl5/vendor_perl  \    /usr/lib64/perl5              \    /usr/share/perl5  

both of test scripts, scalar::util , config::onion loading modules without error. think solution right 1 issue having, , i've marked accordingly. research, , ikegami hitting on solution.

list/util/util.so exists twice in

/usr/local/lib64/perl5  /usr/local/share/perl5  /usr/lib64/perl5/vendor_perl  /usr/share/perl5/vendor_perl  /usr/lib64/perl5  /usr/share/perl5  

they different versions. newer 1 can accessed root. if problem solved using

chmod -r go+rx                   \    /usr/local/lib64/perl5        \    /usr/local/share/perl5        \    /usr/lib64/perl5/vendor_perl  \    /usr/share/perl5/vendor_perl  \    /usr/lib64/perl5              \    /usr/share/perl5  

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -