From bb70911dd9566bcb574e2122072a1d78cb69b99f Mon Sep 17 00:00:00 2001 From: ftrastour Date: Mon, 14 Dec 2015 16:03:58 +0100 Subject: [PATCH 1/3] Add kill function. --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index a632b6a..4623e4b 100644 --- a/index.js +++ b/index.js @@ -235,4 +235,11 @@ PythonShell.prototype.end = function (callback) { return this; }; +/** + * Kill the process (send SIGUP). + */ +PythonShell.prototype.kill = function () { + this.childProcess.kill('SIGUP') ; +}; + module.exports = PythonShell; From 6908ab81a54805f53b6a472acbf3b94d7fecd25e Mon Sep 17 00:00:00 2001 From: ftrastour Date: Mon, 14 Dec 2015 16:33:52 +0100 Subject: [PATCH 2/3] Fix typo in signal name --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 4623e4b..67b8a40 100644 --- a/index.js +++ b/index.js @@ -239,7 +239,7 @@ PythonShell.prototype.end = function (callback) { * Kill the process (send SIGUP). */ PythonShell.prototype.kill = function () { - this.childProcess.kill('SIGUP') ; + this.childProcess.kill('SIGHUP') ; }; module.exports = PythonShell; From 758ef6a6e5dd5622a500ae5c847ed2144041a547 Mon Sep 17 00:00:00 2001 From: ftrastour Date: Tue, 15 Dec 2015 09:44:52 +0100 Subject: [PATCH 3/3] use default signal SIGTERM instead of SIGHUP --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 67b8a40..5aff7d2 100644 --- a/index.js +++ b/index.js @@ -236,10 +236,10 @@ PythonShell.prototype.end = function (callback) { }; /** - * Kill the process (send SIGUP). + * Kill the process (send SIGTERM signal). */ PythonShell.prototype.kill = function () { - this.childProcess.kill('SIGHUP') ; + this.childProcess.kill() ; }; module.exports = PythonShell;