Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't execute a script from a diffent userid

Status
Not open for further replies.

ejaggers

Programmer
Feb 26, 2005
148
US
I can't run a script from user informix but can from user ejagger. All permissions on all files and directories in ../Lib/... are chmod 775 *. I'm running on Linux 5.3.


Perl Script mm.pl:
#!/usr/bin/perl
use UtilityLibrary;
$x = $Today();
print "today is $x\n";

Script etc/profile.d/perl5lib.sh:
>export PERL5LIB="$PERL5LIB:/home/ejaggers/Perl/Lib"

user ejaggers:
>echo $PERL5LIB
>:/home/ejaggers/Perl/Lib
>mm.pl
>today is 04/14/2009

BUT....

user informix:
>echo $PERL5LIB
>:/home/ejaggers/Perl/Lib
>mm.pl
Can't locate UtilityLibrary.pm in @INC (@INC contains: /home/ejaggers/Perl/Lib /
usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_
perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-lin
ux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/
lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_per
l/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5
/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/
x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread
-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/per
l5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl
/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/pe
rl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./mm line 2.
BEGIN failed--compilation aborted at ./mm line 2.


 
As informix can you do this:

Code:
> cd /home/ejaggers/Perl/Lib
> ls -hal

Might be that you don't have read access to /home/ejaggers or some other directory somewhere along the path to your lib folder.

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Kirsle, thanks for responding:

ls -hal /home/ejaggers/Perl/Lib
drwxrwxr-x 5 ejaggers ejaggers 4.0K Apr 14 16:57 .
drwxrwxr-x 3 ejaggers ejaggers 4.0K Apr 13 16:17 ..
drwxrwxr-x 2 ejaggers ejaggers 4.0K Apr 13 16:22 PeimsLib
-rwxrwxr-x 1 ejaggers ejaggers 1.5K Apr 13 16:13 PeimsLibrary.pm
drwxrwxr-x 2 ejaggers ejaggers 4.0K Apr 14 16:54 SqlLib
-rwxrwxr-x 1 ejaggers ejaggers 91 Apr 13 16:13 SqlLibrary.pm
drwxrwxr-x 2 ejaggers ejaggers 4.0K Apr 13 16:56 UtilityLib
-rwxrwxr-x 1 ejaggers ejaggers 1.8K Apr 14 16:57 UtilityLibrary.pm
pentapp2/home/ejaggers/Perl/Lib>

 
A couple things to try:

* Run the script like:

Code:
perl -I "/home/ejaggers/Perl/Lib" mm.pl

* Inside the script, do

Code:
use lib "/home/ejaggers/Perl/Lib";
use UtilityLibrary;

The first one adds a search path to @INC before running mm.pl, the second one uses the lib module to add the path to @INC when it runs. If these work, then it looks like the problem is somehow due to your environment.

Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top