From 99704e75227891501374ff7db9b1be4bf44fc000 Mon Sep 17 00:00:00 2001 From: Dav Glass Date: Thu, 24 Feb 2011 21:51:24 -0600 Subject: [PATCH] Added SIGKILL to process.kill in force_stop and ensuring the PID is a number --- lib/app.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/app.js b/lib/app.js index 8ba56b39..7685c8d5 100644 --- a/lib/app.js +++ b/lib/app.js @@ -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); }