From ff6af40097beeb60452d8cf9f922c6903db36a18 Mon Sep 17 00:00:00 2001 From: gmarzot Date: Thu, 20 Jul 2023 17:37:53 -0400 Subject: [PATCH] remove extra debug, make start only start and change doc to match --- utility/daemon/README.md | 2 +- utility/daemon/daemon.js | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/utility/daemon/README.md b/utility/daemon/README.md index 52b61eff..fbc1736e 100644 --- a/utility/daemon/README.md +++ b/utility/daemon/README.md @@ -34,7 +34,7 @@ to restart the command automatically. Setting `msg.kill` to a signal name (e.g. SIGINT, SIGHUP) will stop the process - but if the restart flag is set it will then auto restart. -Sending `msg.start` will also re-start the process. Additional arguments can be specified in `msg.args`. +Sending `msg.start` will start the process, if not already running. Additional arguments can be specified in `msg.args`. Sending `msg.stop` will stop the process and prevent automatic re-start until reset with `msg.start`. diff --git a/utility/daemon/daemon.js b/utility/daemon/daemon.js index ce9dd8f4..7a1e011b 100644 --- a/utility/daemon/daemon.js +++ b/utility/daemon/daemon.js @@ -38,7 +38,6 @@ module.exports = function(RED) { if (node.running) { node.child.kill(node.closer); } - node.debug(node.cmd+" stopped by msg"); node.status({fill:"grey",shape:"ring",text:RED._("daemon.status.stopped")}); } else if (msg.hasOwnProperty("kill") && node.running) { @@ -46,17 +45,14 @@ module.exports = function(RED) { node.child.kill(msg.kill.toUpperCase()); } else if (msg.hasOwnProperty("start")) { - node.stopped = false; if (!node.running) { let args = ""; if (msg.hasOwnProperty("args") && msg.args.length > 0) { args = parseArgs(msg.args.trim()); } runit(args); - } else { - node.child.kill(node.closer); - // should this also re-start the process incase redo is not set XXX } + node.stopped = false; } else { if (!Buffer.isBuffer(msg.payload)) {