Normally on Linux if you hit ⎈ Control+C it sends SIGINT to the program and depending on how the program handles it, they usually terminate.

However, for me no programs terminate. It's not working on anything. All of the places where it normally terminates a program, it just doesn't work. For example, if I'm running a tail -f on a log file.

It seems as though SIGINT isn't being sent. I'm not sure how to adjust that or even to check it.

To terminate a program, I have to ⎈ Control+Z and then manually kill the thread.

I've tried a lot of things to get this working:

  • different terminal programs
  • different users
  • restarting the server
  • different shells (/bin/bash /bin/sh)

Useful Specs:

  • CENTOS 7 (accessed from an osx machine)
  • bash shell
  • using iterm and terminal
  • gcloud vm

I am happy to send logs or any debugging info that anyone requests. But I am super stumped.

Debugging info:

stty -a  

speed 38400 baud; rows 62; columns 270; line = 0;  

intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;  

-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8  
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0  

isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
  • 2
    What does stty -a output? – Kusalananda Aug 4 '18 at 8:25
  • 1
    Is it CentOS or OSX? – Sparhawk Aug 4 '18 at 10:22
  • Hi, thanks for the questions, I provided answers in the original question. It looks like stty -a is showing that intr = ^C which looks right to me, no? – Kevin Major Aug 5 '18 at 11:08
  • @Kusalananda do you have any other debugging ideas? I'm really stuck, it's driving me mad. – Kevin Major Aug 6 '18 at 1:57
  • Did you try stty sane already? – schily Aug 7 '18 at 15:51

OMG, finally after 6 weeks, I found the problem.

I debugged it using trap.

running trap gives you a list of signals that are being trapped

trap -- '' SIGINT  
trap -- '' SIGQUIT  
trap -- '' SIGTSTP  
trap -- '' SIGTTIN  
trap -- '' SIGTTOU  

I found SIGINT in that list, so something was causing SIGINT to be added to the trap list of things that are being ignored essentially. After some digging it appears some ruby libraries that load with rvm in my bash profile, are messing with trapping.

Anyway, to fix it I added:
trap - INT

to the end of my bash profile, after the ruby library stuffs and all's good in the hood.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.