droe / sslsplit

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

Improve exit status #253

Closed droe closed 4 years ago

droe commented 4 years ago

This pull request is meant to address #252 in the following ways:

Signals that are non-fatal, such as SIGUSR1, will not lead to a shutdown. Some signals not handled by sslsplit, such as SIGKILL or SIGSEGV, will lead to a termination by the kernel, meaning that the process interested in the exit status will use wait(2) to acquire the signal. In the special case of sslsplit running directly from a shell, most shells will translate the signal number to an exit status using the same scheme of 128 + signal number.

All of this is only relevant when not running sslsplit as a daemon.

sonertari commented 4 years ago

If I kill sslsplit with SIGINT or SIGTERM signals, it exits with status 1 (e.g. echo $?). But the second bullet claims that 0 should be returned. Is this expected? I guess I am missing something.

droe commented 4 years ago

You're not missing anything, I broke my change during refactoring. Fixed.

sonertari commented 4 years ago

Appendix E. Exit Codes With Special Meanings reads "Control-C is fatal error signal 2", so I guess they expect us to return 130 upon SIGINT. But I like it this way. As you wish.

droe commented 4 years ago

Thank you, Soner!