Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix ^C ignored issue on CentOS 6.8. #1012

Merged
merged 1 commit into from
May 24, 2017
Merged

Conversation

russjones
Copy link
Contributor

@russjones russjones commented May 24, 2017

Purpose

On certain operating systems (like CentOS 6.8) when sysvinit launches Teleport it configures it to ignore SIGINT. You can see this behavior by connecting to a Teleport node started by sysvinit typing the following:

$ nc -l localhost 12345
^C^C^C^C

If you strace the process and manually send SIGINT you'll see it receives SIGINT but does nothing:

$ strace -p 32867
Process 32867 attached
accept(3, 0x7ffc24beb650, [128])        = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGINT {si_signo=SIGINT, si_code=SI_USER, si_pid=33049, si_uid=0} ---
accept(3,

To resolve this issue, we need to reset the signal handler to the default signal handler so SIGINT can be processed.

Implementation

Since Go does not allow us to directly reset the signal handler, we have to use cgo to call the following code when a Teleport process starts:

#include <signal.h>
signal(SIGINT, SIG_DFL)

Related Issues

Fixes #981

References

@russjones russjones requested review from kontsevoy and klizhentas May 24, 2017 17:42
@russjones russjones merged commit ce563f3 into master May 24, 2017
@russjones russjones deleted the rjones/signal-handler branch May 24, 2017 17:48
hatched pushed a commit that referenced this pull request Feb 1, 2023
* added a content-security-policy

* added connect-src directive and required form urls

* removed extra script-src directive

* added usage.teleport.dev
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ctrl-C not respected
2 participants