Skip to content

Commit

Permalink
fix: killing all sub processes
Browse files Browse the repository at this point in the history
Fixes #1463
Fixes #1469
Fixes #1464
  • Loading branch information
remy committed Nov 27, 2018
1 parent 1f01d20 commit c05d2d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/monitor/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,11 @@ function kill(child, signal, callback) {
const sig = signal.replace('SIG', '');
psTree(child.pid, function (err, kids) {
if (psTree.hasPS) {
spawn('kill', ['-s', sig, child.pid].concat(kids.map(p => p.PID)))
spawn('kill', ['-s', sig, child.pid].concat(kids))
.on('close', callback);
} else {
// make sure we kill from smallest to largest
const pids = kids.map(p => p.PID).concat(child.pid).sort();
const pids = kids.concat(child.pid).sort();
pids.forEach(pid => {
exec('kill -' + signals[signal] + ' ' + pid, () => { });
});
Expand Down

0 comments on commit c05d2d1

Please sign in to comment.