-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle SIGTERM as SIGINT and ignore SIGHUP #134
Conversation
In macOS, I got your branch and tested after remove #132 but.. And... |
@Mabin-J Unfortunately I cannot test on MacOS, however:
So unless I am mistaken this patch shouldn't change |
@Mabin-J About
|
@DimitriPapadopoulos, and... when openfortivpn connect normally, |
This PR is not about changing handling of This PR is for consistent handling of SIGTERM and SIGINT, and for ignoring SIGHUP. |
@DimitriPapadopoulos Before this PR, openfortivpn connected normally and run It works correctly in macOS. :) |
@Mabin-J Thanks for testing this PR on MacOS. I'm still not sure why we avoid calling pthread_sigmask() on MacOS X to disable signal handling in future threads, but that's probably best dealt with in a different issue. |
On MacOS X we have not been disabling SIGINT for future spawned threads. This commit does not disable SIGTERM either. Is that the right thing to do? What was the matter in the first place with blocking SIGINT for future threads with pthread_sigmask()?
@Mabin-J Indeed this PR should allow for consistent and proper clean-up after Proper clean-up depends on the signal handler and the related logic of the application. We might need to review and change the current code in openfortivpn, especially for MacOS, but that's a different issue and at least |
@DimitriPapadopoulos, I understood. |
Sorry if I repeat things that have already been said... @DimitriPapadopoulos to your question "Why do we avoid calling pthread_sigmask() on MacOS X to disable signal handling in future threads?" I just can say that this was part of the initial MacOS X port fretn@382fefd to which @fretn had added the documentation and which I rebased and squashed end of last year. If this part of the MacOS X code can be improved, please go ahead. Maybe the We have seen yesterday in #132, that openfortivpn works on MacOS X with this part of the signal handling, but it could not be canceled with |
@mrbaseman, Sorry. I forgot to test that your request. I'll test it tomorrow. |
I tested some case.
|
Not sure about this one:
See for example:
Fixes #78.