title: Killing a Haskell binary
body: <p>If I press Ctrl+C, this throws an exception (always in thread 0?). You can catch this if you want - or, more likely, run some cleanup and then rethrow it. But the usual result is to bring the program to a halt, one way or another.</p>
  
  <p>Now suppose I use the Unix <code>kill</code> command. As I understand it, <code>kill</code> basically sends a (configurable) Unix signal to the specified process.</p>
  
  <p>How does the Haskell RTS respond to this? Is it documented somewhere? I would <em>imagine</em> that sending <code>SIGTERM</code> would have the same effect as pressing Ctrl+C, but I don't know that for a fact...</p>
  
  <p>(And, of course, you can use <code>kill</code> to send signals that have nothing to do with killing at all. Again, I would <em>imagine</em> that the RTS would ignore, say, <code>SIGHUP</code> or <code>SIGPWR</code>, but I don't know for sure.)</p>