Closed eproxus closed 9 years ago
You need to use the exec:status/1 call to interpret the exit code reported by exec
, which could be either a signal or status, depending on the termination cause:
2> exec:status(256).
{status,1}
3> exec:status(1).
{signal,sighup,false}
Excuse my lack of knowledge, on the subject, but why? :smile: What's the difference between status
and status
in these contexts?
The exit code returned by Linux and other OS's that support signals contains information on how the process was terminated (normally or by signal), so the value returned in {exit_status, N}
needs to be interpreted by the exec:status/1
call to get the "real" exit status.
I see, thanks!
Running erlexec with
monitor
as an option, I receive{'DOWN', #Ref<0.0.0.3303>, process, <0.207.0>, {exit_status, 256}}
, however running the command in the shell returns the error code1
.The command is started with:
The output and message received is:
However, running the command in the shell shows the error code is actually
1
: