debugger: exit and kill child on SIGTERM or SIGHUP

This commit is contained in:
Fedor Indutny
2012-10-18 00:06:37 +07:00
committed by Ben Noordhuis
parent 83e5e20c2c
commit 05882668f9
3 changed files with 8 additions and 5 deletions

View File

@@ -782,9 +782,10 @@ function Interface(stdin, stdout, args) {
process.exit(0);
});
process.on('exit', function() {
self.killChild();
});
// Handle all possible exits
process.on('exit', this.killChild.bind(this));
process.once('SIGTERM', process.exit.bind(process, 0));
process.once('SIGHUP', process.exit.bind(process, 0));
var proto = Interface.prototype,
ignored = ['pause', 'resume', 'exitRepl', 'handleBreak',

View File

@@ -155,7 +155,8 @@ setTimeout(function() {
err = err + '. Expected: ' + expected[0].lines.shift();
}
quit();
child.kill('SIGKILL');
child.kill('SIGINT');
child.kill('SIGTERM');
// give the sigkill time to work.
setTimeout(function() {

View File

@@ -192,7 +192,8 @@ setTimeout(function() {
err = err + '. Expected: ' + expected[0].lines.shift();
}
quit();
child.kill('SIGKILL');
child.kill('SIGINT');
child.kill('SIGTERM');
// give the sigkill time to work.
setTimeout(function() {