You can also use the status
node to watch the exec
node and then grab the PID from it and store it in a flow variable. Then you can have another flow that gets the PID from the global variable and sends 'kill nnn' where nnn is the PID number. Here is a sample
[{"id":"8ad88889.20b7f","type":"status","z":"79bc540c.0c3a9c","name":"","scope":["1c178d10.4959cb"],"x":160,"y":700,"wires":[["cd2f612f.afab68"]]},{"id":"5321b564.d42b1c","type":"debug","z":"79bc540c.0c3a9c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":750,"y":700,"wires":[]},{"id":"cd2f612f.afab68","type":"change","z":"79bc540c.0c3a9c","name":"store PID in flow.pid","rules":[{"t":"change","p":"status.text","pt":"msg","from":"pid:","fromt":"str","to":"","tot":"str"},{"t":"set","p":"pid","pt":"flow","to":"status.text","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":700,"wires":[["5321b564.d42b1c"]]},{"id":"dc93cf66.62994","type":"inject","z":"79bc540c.0c3a9c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":740,"wires":[["e96b79ce.607078"]]},{"id":"e96b79ce.607078","type":"change","z":"79bc540c.0c3a9c","name":"Build 'kill nnn' where nnn is the PID from flow.pid","rules":[{"t":"set","p":"payload","pt":"msg","to":"kill pid","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"pid","fromt":"str","to":"pid","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":740,"wires":[["9a58e823.68f098"]]},{"id":"9a58e823.68f098","type":"exec","z":"79bc540c.0c3a9c","command":"","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":750,"y":740,"wires":[[],[],[]]}]
The funny thing is I just put this together earlier today.