strace: exec: Exec format error
search cancel

strace: exec: Exec format error

book

Article ID: 240126

calendar_today

Updated On:

Products

SITEMINDER

Issue/Introduction

While trying to troubleshoot an Access Gateway issue using strace we ran into an error.

strace -f -t -i -v -o strace.log -s 16384 ./sps-ctl startssl

strace: exec: Exec format error

Cause

Typically this means the script is missing a shell reference at the start, such as 

#!/bin/ksh or #!/bin/sh

There might also be an issue if the path used on the system doesn't match, so if ksh is not actually located in /bin for example.

 

Resolution

But by adding $SHELL to the command, we tell the command to use the default user shell and it will eliminate the exec error.

strace -f -t -i -v -o strace.log -s 16384 $SHELL  ./sps-ctl startssl