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. :confused:

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.

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

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.

You should also give the full path to your shell script when invoking the system() call - not just the name of your shell script.

@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..