Skip to content

Commit

Permalink
Fix issues with server start/stop via Ctrl+c
Browse files Browse the repository at this point in the history
  • Loading branch information
mde committed Nov 11, 2010
1 parent cdcf7f1 commit ec1adc9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions geddy-core/scripts/startserv.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ var startServ = function (restart) {
});

child.addListener('exit', function (code, signal) {
process.kill(child.pid);
process.exit();
process.exit();
});

pids.push(child.pid);
Expand All @@ -170,9 +169,13 @@ var startServ = function (restart) {
};

process.on('SIGINT',function(){
for (var i = 0, ii = pids.length; i < ii; i++) {
process.kill(pids[i]);
for (var i = 0, ii = pids.length; i < ii; i++) {
try {
process.kill(pids[i]);
}
// Don't complain if children no longer exist
catch (e) {}
}
process.exit();
});

Expand Down

0 comments on commit ec1adc9

Please sign in to comment.