Skip to content

Commit

Permalink
Added SIGKILL to process.kill in force_stop and ensuring the PID is a…
Browse files Browse the repository at this point in the history
… number
  • Loading branch information
davglass committed Feb 25, 2011
1 parent 9ffcbd3 commit 99704e7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/app.js
Expand Up @@ -268,14 +268,17 @@ var force_stop = function(repo_id, callback) {
return;
}
try {
pid = pid.replace('\n', '');
pid = parseInt(pid, 1000);
console.log('PID: "' + pid + '"');
pid = pid.replace(/\n/g, '').replace(/\r/g, '');
pid = parseInt(pid);
if (pid > 0) {
process.kill(pid);
console.log('Sending SIGKILL to ', pid);
process.kill(pid, 'SIGKILL');
callback(true);
} else {
callback(false);
}

} catch (e) {
callback(false);
}
Expand Down

0 comments on commit 99704e7

Please sign in to comment.