The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Exit status MartyIX Shell Programming and Scripting 9 09-09-2008 05:47 AM
How to get the exit status yhacks Shell Programming and Scripting 1 05-19-2008 08:06 AM
exit status moxxx68 Shell Programming and Scripting 1 12-04-2004 07:27 PM
tar exit status thorndike UNIX for Dummies Questions & Answers 3 01-22-2002 04:39 PM
ftp exit status. oracle8 UNIX for Advanced & Expert Users 1 10-21-2001 11:34 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 09-18-2009
glamo_2312 glamo_2312 is offline
Registered User
  
 

Join Date: Sep 2008
Location: INDIA
Posts: 19
Question Exit Status 126 - how to get rid of it

Hi All,

I have a small application hosted on apache-tomcat 5. Basically its a html page which in turn calls a perl script residing on unix server. Through this perl script i am calling a shell script using system command , like

system('scriptname.sh',arg1,arg2,arg3);

Now in the script 'scriptname.sh' i am try to run a c-program executable which is compiled on unix itself.

The problem is that except that command[c-executable] all other statements gets executed.

On further investigation i found that , it is giving 126 as exit status which means "Command was found but could not be executed".

Can any of you experts please help me to come out of this problem

Thanks in advance.
  #2 (permalink)  
Old 09-18-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,839
Since every process hands down its permissions to its children (UID/GID/...), the script effectively gets called as the user running Tomcat. If that user doesn't have execute permissions on the script, it can't be run.
  #3 (permalink)  
Old 09-18-2009
glamo_2312 glamo_2312 is offline
Registered User
  
 

Join Date: Sep 2008
Location: INDIA
Posts: 19
does not seems to be a permission problem

Hi

It does not seems to be a performance problem as i have given 755 permission to all the scripts.

Can there by anything else which restricting it to execute the command
  #4 (permalink)  
Old 09-18-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,839
Maybe one of the commands called by the script doesn't have the correct permissions. Other than that the only thing I can think of is scattering some debugging print/echo statements in the Perl or shell script, in order to pinpoint the problem.
  #5 (permalink)  
Old 09-18-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,913
You should also give the full path to your shell script when invoking the system() call - not just the name of your shell script.
  #6 (permalink)  
Old 09-23-2009
glamo_2312 glamo_2312 is offline
Registered User
  
 

Join Date: Sep 2008
Location: INDIA
Posts: 19
Question further info..

@pludi..

I have various echo commands in my script and those got printed and the only thing that remains un-touched is the line which calls the executable..

@fmurphy

other commands in the script are getting executed without mentioning the full path. So i am just guessing that giving full path will make any difference or not.

Still need your help
thanks in advance..
Reply

Bookmarks

Tags
apache-tomcat, exit status, perl, shell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0