droe / sslsplit

Transparent SSL/TLS interception
https://www.roe.ch/SSLsplit
BSD 2-Clause "Simplified" License
1.73k stars 327 forks source link

Exit code is 1 whatever signal sent to terminate process #252

Closed tomlabaude closed 4 years ago

tomlabaude commented 5 years ago

On Mac, exit code is most of time 1, even if stopping with CTRL+C, or terminating (SIGTERM) or killing it (SIGKILL), which makes it hard to catch errors for embedding scripts or programs.

Standard Error output sometimes mentions the signal received, but exit code was most of time observed being 1.

Ex 1 - Killed by Signal 2 - SIGINT - CTRL+C:

Child proc 86866 killed by signal 2
$ echo $?
1

Ex 2 - Killed by Signal 9 - SIGKILL:

Child proc 94363 killed by signal 9
$ echo $?
1

Ex 3 - Killed by Signal 15 - SIGTERM:

Child proc 13789 killed by signal 15
$ echo $?
1

Some articles suggests to increment exit code of 128+Signal: https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html http://tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF


For bug reports, please supply:

droe commented 4 years ago

This feature was merged to develop with #253 - feel free to comment in case that does not address your needs. See the new section EXIT STATUS in the manual page for details.