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 gkittelson 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 1

Status
Not open for further replies.

ejaggers

Programmer
Feb 26, 2005
148
US
I can't run a perl 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. Can anyone help me?

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

>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


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.
 
export PERL5LIB=/home/ejaggers/Perl/Lib

echo $PERL5LIB
/home/ejaggers/Perl/Lib

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
AvayaTier3, thanks for responding.
I also thought about that. I do have export PERL5LIB="$PERL5LIB:/home/ejaggers/Perl/Lib" on the old system(TRU64) and it works, and I have questioned the $PERL5LIB: part. But if I take that off, it still doesn't work:

pentapp2/home/informix>export PERL5LIB=/home/ejaggers/Perl/Lib
pentapp2/home/informix>echo $PERL5LIB
/home/ejaggers/Perl/Lib
pentapp2/home/informix>./mm
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-li
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_pe
l/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl
/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-threa
-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/pe
l5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_per
/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/p
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.
pentapp2/home/informix>
 
The way you were doing it would append your path to the end of an existing path. There is no existing path and that is why your path started with :/home/ejaggers/Perl/Lib


try "which perl" from each user and make sure the users are using the same version of perl. If they are not, you may want to adjust the PATH or point the shared program at the same perl version. Looks like you have 3 version of perl5.
5.8.6
5.8.7
5.8.8

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
AvayaTier3, It's a permissions issue.

user ejaggers:
pentapp2/home/ejaggers>ls -hal /home/ejaggers/Perl/Lib
total 64K
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>


user informix:
pentapp2/home/informix>ls -hal /home/ejaggers/Perl/Lib
ls: /home/ejaggers/Perl/Lib: Permission denied
pentapp2/home/informix>
 
chmod 777 /home/ejaggers/Perl/Lib



A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
Okay, I'll try that. Let me ask this, all of the dot files in /home/"userid" are owner and group root. It's that wrong?

>ls -hal
drwx------ 24 informix informix 4.0K Apr 16 09:49 .
drwxr-xr-x 10 root root 4.0K Apr 9 10:40 ..
drwxrwxr-x 3 informix informix 4.0K Apr 14 10:17 Attendance
-rw------- 1 informix informix 7.2K Apr 16 09:35 .bash_history
-rw-r--r-- 1 root root 33 Mar 9 15:54 .bash_logout
-rw-r--r-- 1 root root 201 Apr 14 12:53 .bash_profile
-rw-r--r-- 1 root root 124 Mar 9 15:54 .bashrc
drwxrwxr-x 3 informix informix 4.0K Apr 14 16:22 Cognos
-rw-rw-r-- 1 informix informix 1.8K Apr 15 14:54 crontab.save
drwxrwxr-x 3 informix informix 4.0K Apr 15 20:30 Edsoft
-rw-r--r-- 1 root root 515 Mar 9 15:54 .emacs
 
that is indeed a problem. The command below from login "root" will rectify this.

chown -R informix.informix /home/informix

Another what to fix the perl issue would be to change the informix and ejaggers to a common group. This way you don't put 777 permission on your files which would allow anyone to remove or modify them.



A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
AvayaTier3,
This is a new box with very few users so far (5 plus informix and root). It's possible that there are problems in the setup, and I'm trying to find them. It seems that only user informix had root dot files, ejaggers had ejaggers ejaggers. I ran the commands you gave me (chown and chmod 777), but informix still can't see my perl lib:

user ejaggers:
pentapp2/home/ejaggers/Perl>ls -hal
total 24K
drwxrwxrwx 3 ejaggers ejaggers 4.0K Apr 13 16:17 .
drwx------ 7 ejaggers ejaggers 4.0K Apr 14 17:13 ..
drwxrwxrwx 5 ejaggers ejaggers 4.0K Apr 14 16:57 Lib
pentapp2/home/ejaggers/Perl>cd Lib
pentapp2/home/ejaggers/Perl/Lib>ls -hal
total 64K
drwxrwxrwx 5 ejaggers ejaggers 4.0K Apr 14 16:57 .
drwxrwxrwx 3 ejaggers ejaggers 4.0K Apr 13 16:17 ..
drwxrwxrwx 2 ejaggers ejaggers 4.0K Apr 13 16:22 PeimsLib
-rwxrwxrwx 1 ejaggers ejaggers 1.5K Apr 13 16:13 PeimsLibrary.pm
drwxrwxrwx 2 ejaggers ejaggers 4.0K Apr 14 16:54 SqlLib
-rwxrwxrwx 1 ejaggers ejaggers 91 Apr 13 16:13 SqlLibrary.pm
drwxrwxrwx 2 ejaggers ejaggers 4.0K Apr 13 16:56 UtilityLib
-rwxrwxrwx 1 ejaggers ejaggers 1.8K Apr 14 16:57 UtilityLibrary.pm
pentapp2/home/ejaggers/Perl/Lib>


user informix:
pentapp2/home/informix>ls /home/ejaggers/Perl/Lib
ls: /home/ejaggers/Perl/Lib: Permissitotal 328K
drwx------ 24 informix informix 4.0K Apr 16 10:20 .
drwxr-xr-x 10 root root 4.0K Apr 9 10:40 ..
drwxrwxr-x 3 informix informix 4.0K Apr 14 10:17 Attendance
-rw------- 1 informix informix 7.7K Apr 16 10:28 .bash_history
-rw-r--r-- 1 informix informix 33 Mar 9 15:54 .bash_logout
-rw-r--r-- 1 informix informix 201 Apr 14 12:53 .bash_profile
-rw-r--r-- 1 informix informix 124 Mar 9 15:54 .bashrc
drwxrwxr-x 3 informix informix 4.0K Apr 14 16:22 Cognos
-rw-rw-r-- 1 informix informix 1.8K Apr 15 14:54 crontab.save
drwxrwxr-x 3 informix informix 4.0K Apr 15 20:30 Edsoft
-rw-r--r-- 1 informix informix 515 Mar 9 15:54 .emacs
drwxrwxr-x 2 informix informix 4.0K Apr 14 11:34 Hayes
-rwxrwxr-x 1 informix informix 208 Apr 15 08:17 k
-rw------- 1 informix informix 35 Apr 14 16:21 .lesshston denied
pentapp2/home/informix>ls -hal | more




 
Please take a look at the permissions on the dot files because I think the owner/group wasn't the only problem.
 
chmod 777 /home/ejaggers/Perl
chmod 777 /home/ejaggers/Perl/Lib

Then using login informix:

ls -l /home/ejaggers/Perl/Lib
cat /home/ejaggers/Perl/Lib/SqlLibrary.pm

Your permissions on the . files look okay

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
This really got me stumped!!!

pentapp2/home/ejaggers>ls /home/informix
Attendance logmgr.cfg primero.cfg rpt TLClib
Cognos lognum PSS SpecEd WebAchiever
crontab.save Medical REGION10 Sync WebAchiever2008
Edsoft mm Registration Tango xx
Hayes NurseAide ReptCards TeacherCat
k Primero Rollover TeleParent
pentapp2/home/ejaggers>

pentapp2/home/ejaggers>ls -hal
total 128K
drwx------ 7 ejaggers ejaggers 4.0K Apr 14 17:13 .
drwxr-xr-x 10 root root 4.0K Apr 9 10:40 ..
-rw------- 1 ejaggers ejaggers 1.8K Apr 16 10:49 .bash_history
-rw-r--r-- 1 ejaggers ejaggers 33 Apr 9 10:40 .bash_logout
-rw-r--r-- 1 ejaggers ejaggers 201 Apr 14 16:59 .bash_profile
-rw-r--r-- 1 ejaggers ejaggers 124 Apr 9 10:40 .bashrc
drwxrwxrwx 3 ejaggers ejaggers 4.0K Apr 13 17:03 bin
-rwxrwxrwx 1 ejaggers ejaggers 8 Apr 14 13:55 ejaggers
-rw-r--r-- 1 ejaggers ejaggers 515 Apr 9 10:40 .emacs
drwxr-xr-x 3 ejaggers ejaggers 4.0K Apr 9 10:40 .kde
-rwxrwxrwx 1 ejaggers ejaggers 76 Apr 14 17:10 mm
drwxr-xr-x 4 ejaggers ejaggers 4.0K Apr 9 10:40 .mozilla
drwxrwxrwx 3 ejaggers ejaggers 4.0K Apr 13 16:17 Perl
drwx------ 2 ejaggers ejaggers 4.0K Apr 14 16:53 .ssh
-rw------- 1 ejaggers ejaggers 3.9K Apr 14 17:13 .viminfo
-rw-r--r-- 1 ejaggers ejaggers 658 Apr 9 10:40 .zshrc

pentapp2/home/informix>ls /home/ejaggers
ls: /home/ejaggers: Permission denied
pentapp2/home/informix>
 
chmod 755 /home/ejaggers

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
with 700, nobody can change to any subdirectories of "/home/ejaggers" except the owner.

A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
pentapp2/home/ejaggers>chmod 775 *
pentapp2/home/ejaggers>ls -hal
total 128K
drwx------ 7 ejaggers ejaggers 4.0K Apr 14 17:13 .
drwxr-xr-x 10 root root 4.0K Apr 9 10:40 ..
-rw------- 1 ejaggers ejaggers 1.8K Apr 16 10:49 .bash_history
-rw-r--r-- 1 ejaggers ejaggers 33 Apr 9 10:40 .bash_logout
-rw-r--r-- 1 ejaggers ejaggers 201 Apr 14 16:59 .bash_profile
-rw-r--r-- 1 ejaggers ejaggers 124 Apr 9 10:40 .bashrc
drwxrwxr-x 3 ejaggers ejaggers 4.0K Apr 13 17:03 bin
-rwxrwxr-x 1 ejaggers ejaggers 8 Apr 14 13:55 ejaggers
-rw-r--r-- 1 ejaggers ejaggers 515 Apr 9 10:40 .emacs
drwxr-xr-x 3 ejaggers ejaggers 4.0K Apr 9 10:40 .kde
-rwxrwxr-x 1 ejaggers ejaggers 76 Apr 14 17:10 mm
drwxr-xr-x 4 ejaggers ejaggers 4.0K Apr 9 10:40 .mozilla
drwxrwxr-x 3 ejaggers ejaggers 4.0K Apr 13 16:17 Perl
drwx------ 2 ejaggers ejaggers 4.0K Apr 14 16:53 .ssh
-rw------- 1 ejaggers ejaggers 3.9K Apr 14 17:13 .viminfo
-rw-r--r-- 1 ejaggers ejaggers 658 Apr 9 10:40 .zshrc
pentapp2/home/ejaggers>


pentapp2/home/informix>ls /home/ejaggers
ls: /home/ejaggers: Permission denied
pentapp2/home/informix>
 
No,

chmod 755 * will change files in the current directory

Yes:

chmod 755 . will change permissions of current directory and not the files

chmod 755 /home/ejaggers with only change permissions for your home directory.

Before:
drwx------ 7 ejaggers ejaggers 4.0K Apr 14 17:13 .
After:
drwxr-xr-x 7 ejaggers ejaggers 4.0K Apr 14 17:13 .


A great teacher, does not provide answers, but methods to teach others "How and where to find the answers"

bsh

35 years Bell, AT&T, Lucent, Avaya
Tier 3 for 25 years and counting
 
I GOT IT!!!

/home/ejaggers> chmod 775 . did the trick!!!

AvayaTier3 (TechnicalUser)... Thanks For You Time And Effort!!!
 
Okay we posted at the same time, but you are correct. That was the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top