1833059 Members
2494 Online
110049 Solutions
New Discussion

Re: Exec format error

 
hmorrison
Advisor

Exec format error

Using HPUX11.11, and created a regular user. The startup program was changed from executing /usr/bin/ksh, to running a shell script. When an attempt is made to login as the user the following error appears "Exec format error". Can anybody help?
7 REPLIES 7
Mel Burslan
Honored Contributor

Re: Exec format error

things come to mind right away are:

1. is the script executable ?
2. is the ownership right (i.e. is this user able to read and execute this script depending on its permissions and ownership) ?
________________________________
UNIX because I majored in cryptology...
hmorrison
Advisor

Re: Exec format error

The user is able to run the program, if given a shell prompt, but not able to run if it is made to be the startup program
Mel Burslan
Honored Contributor

Re: Exec format error

if you have an /etc/shells, you may try putting your script into this file as a new line. If you do not have an /etc/shells file, create and add this script with the full path name into the file.
________________________________
UNIX because I majored in cryptology...
Tim Nelson
Honored Contributor

Re: Exec format error

did you include #!/usr/bin/ksh or sh on the first line of the script ?
hmorrison
Advisor

Re: Exec format error

Thanks for your responses. I however created the /etc/shells and put the script and its path in it. This however did not solve the problem
Mel Burslan
Honored Contributor

Re: Exec format error

is this a strictly shell script that you are running or is it calling some other scripts like perl scripts and/or other executables ? If there are external calls being made from this script, can you absolutely say that the error is coming from your script ?

just for kick, as the first executable command in your shell script, put this line

set -x

and see what happens when you login to this user's acct next time. If the shell script portion is running correctly, you should see a boat load of tracing information, with lines starting with "+" signs. And if you can copy those here, maybe someone can tell what is going on
________________________________
UNIX because I majored in cryptology...
hmorrison
Advisor

Re: Exec format error

Thanks again, the #!/usr/bin/ksh worked, however I found it strange,because in my troubleshooting, I tried to execute a script that another user executed, and the script did not have #!/usr/bin/ksh in it. I have actually removed the /etc/shells file that I had created, thanks to you both