getting the error--Couldn't execute command (8 / Exec format error)

1,568 views
Skip to first unread message

Soumen Sarkar

unread,
Sep 1, 2017, 7:40:40 AM9/1/17
to schedulix
Hi Ronald /Dieter

Need a quick help please..I have shell script when I am running it from unix commandline...its executing fine...But when posting the script through schedulix
getting the error "Couldn't execute command (8 / Exec format error) "..not getting any clue..the same scrip was running successfully through schedulix day before
yesterday also...not getting any clue..why this is happening...



Best Regards
Soumen

Ronald Jeninga

unread,
Sep 1, 2017, 8:21:54 AM9/1/17
to schedulix
Hi Soumen,

this sounds complex. One day it works and without any change it ceases working the next day....

To be honest, something must have changed.


The errno 8 is the ENOEXEC errno and the execve(2) man page states

> An executable is not in a recognized format, is for the wrong architecture, or has some other format error that means it cannot be executed.

It looks like your command interpreter is corrupt somehow.
Since it is a script as you say, have a closer look at the executable called in the hashbang.
I mean, if your script starts with

#!/my/very/important/command/interpreter

You'll have to investigate the executable "/my/very/important/command/interpreter"
Look at the size, find out what "file /my/very/important/command/interpreter" says.

If this doesn't give a satisfying theory about what's going wrong, you can try to restart the jobserver that executes the script.
If you set an environment variable called 

JOBEXECUTORLOG

to a full qualified path and prefix, like "/tmp/jsdebug-", the jobexecutor writes some information in case something goes wrong.

If that doesn't give enough information, try to save the taskfile.
To do so, you probably need to write a simple wrapper script, because a failing execv() won't give you enough time to copy it manually.

So you do

mv jobexecutor jobexecutor.orig



and you write a script called jobexecutor that does

#!/bin/bash


ln $2 $2
.save  # hard link here; argv[2] is the taskfilename


exec jobexecutor.orig $*


Please tell what you've found out.

Regards,

Ronald



Soumen Sarkar

unread,
Sep 4, 2017, 8:04:57 AM9/4/17
to schedulix
My Bad i added a comment before the hashbang.thats what I was getting the format error exit code 8.

The script should always start with #!<commanditerpreter>

e.g. #!/bin/bash or #!/bin/ksh or #!/bin/sh


Thanks

Reply all
Reply to author
Forward
0 new messages