From 11d4a7f8d3194333f3acf925f140bc5b45786f8f Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 21 Dec 2015 10:22:07 -0800 Subject: [PATCH] Fix shutdown of ac monitor on Windows --- console/src/modules/hf-process.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/console/src/modules/hf-process.js b/console/src/modules/hf-process.js index 76d0aaff2e..4bb28470da 100755 --- a/console/src/modules/hf-process.js +++ b/console/src/modules/hf-process.js @@ -5,6 +5,7 @@ var util = require('util'); var events = require('events'); var childProcess = require('child_process'); var fs = require('fs'); +var os = require('os'); const ProcessGroupStates = { STOPPED: 'stopped', @@ -176,7 +177,11 @@ Process.prototype = extend(Process.prototype, { console.warn("Can't stop process that is not started."); return; } - this.child.kill(); + if (os.type() == "Windows_NT") { + childProcess.spawn("taskkill", ["/pid", this.child.pid, '/f', '/t']); + } else { + this.child.kill(); + } this.state = ProcessStates.STOPPING; },