1
0
mirror of https://github.com/node-red/node-red-nodes.git synced 2023-10-10 13:36:58 +02:00
node-red-nodes/utility/daemon
2016-10-17 21:35:12 +01:00
..
daemon.html add info to daemon node to point out python unbuffered 2016-08-28 11:37:51 +01:00
daemon.js Daemon node. Check payload length rather than trim to handle buffer 2016-10-17 21:35:12 +01:00
LICENSE New Daemon node to call and monitor long running external commands 2014-12-24 21:51:17 +00:00
package.json Daemon node. Check payload length rather than trim to handle buffer 2016-10-17 21:35:12 +01:00
README.md update analysis and utility nodes info style 2016-03-02 13:27:52 +00:00

node-red-node-daemon

A Node-RED node that runs and monitors a long running system command.

Similar to the exec node - but this calls the command at start time and then pipes any input to the node to the STDIN of the running command, and feeds any STDOUT to the first output.

Useful for monitoring command line based processes.

Install

Run the following command in your Node-RED user directory - typically ~/.node-red

npm i node-red-node-daemon

Usage

Calls out to a long running system command. Sends msg.payload to stdin of the process.

Note Only the command itself should be placed in the command field. All parameters must be placed in the arguments field.

The command provides 3 outputs... stdout, stderr, and return code, from the running command.

If the called program stops (i.e. a return code is produced), this node can attempt to restart the command automatically.

Note : when you stop Node-RED running we may not get a chance to kill the called program so it may remain running. You may have to kill it manually.

For example it can be used to run and then monitor the dump1090 plane spotter, and also to interact with various python apps that everyone seem to write these days :-)