Different operating systems handle child processes differently. I usually add in handler like this:
['SIGINT', 'SIGHUP', 'SIGTERM'].forEach(function(signal) {
process.addListener(signal, gracefulShutdown);
});
gracefulShutdown
should do things like close sockets and quit processes (process.stop()
)
OH... And I just reread your question. ctrl-z pauses a process, it doesn't kill it. If you use fg
or bg
, it will bring the process back into the foreground/background. To quick the REPL, use ctrl-c twice.