title: Nodejs - process hangs on exit (Ctrl+C)
body: <p>I have a node.js project which does many things, it spawns child processes, it opens an http and socket.io server, etc..</p>
  
  <p>When I run it from the console, closing it with <code>Ctrl+C</code>, it just hangs.
  From webstorm, stopping the process is a two-step process, first I hit stop, then I need to hit the button again, only the second time the button is a skull icon.</p>
  
  <p>Now, I understand it leaves something open or hanging, but I just can't figure out what, I tried to track all the places where I start a process and made sure I'm killing them properly.</p>
  
  <p>Is there a way to debug this and find out what's making my process hang? Could it be logging that open a write stream and never closes? I'm not even sure what kind of things will make a process hang on SIGINT.</p>
  
  <p>EDIT: I've downloaded <code>pstree</code> to see if any of the child processes that the main process spawns stay alive. It looks like they all terminate properly - the main node process is the only one left.</p>