mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
debugger: exit and kill child on SIGTERM or SIGHUP
This commit is contained in:
committed by
Ben Noordhuis
parent
83e5e20c2c
commit
05882668f9
@@ -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',
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user