Can anyone explain what is going on here?
If, in a terminal, I run sleep 10
and then hit Ctrl-C it interrupts the sleep. However, if I use an exec node to run the sleep and kill it with msg.kill
set to SIGINT then the exec node shows killed immediately, but the sleep does not complete until it has reached its time, at which point the exec node outputs the error message saying that it has been killed. In fact even SIGKILL does not terminate it immediately.
[{"id":"1676120a.9e7bd6","type":"debug","z":"8c99ec05.74e658","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":617,"y":351,"wires":[]},{"id":"7ec4abd2.2fbbb4","type":"debug","z":"8c99ec05.74e658","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":634,"y":427,"wires":[]},{"id":"4121e880.40bb18","type":"debug","z":"8c99ec05.74e658","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":634,"y":487,"wires":[]},{"id":"e60d0906.e92e8","type":"inject","z":"8c99ec05.74e658","name":"kill","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"payload":"","payloadType":"date","x":105,"y":346,"wires":[["4f93c8c1.57e2b"]]},{"id":"30e1839a.cade6c","type":"exec","z":"8c99ec05.74e658","command":"sleep 10","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":420,"y":423,"wires":[["1676120a.9e7bd6"],["7ec4abd2.2fbbb4"],["4121e880.40bb18"]]},{"id":"127167a5.30506","type":"inject","z":"8c99ec05.74e658","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":123,"y":426,"wires":[["30e1839a.cade6c","1676120a.9e7bd6"]]},{"id":"4f93c8c1.57e2b","type":"change","z":"8c99ec05.74e658","name":"","rules":[{"t":"set","p":"kill","pt":"msg","to":"SIGINT","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":249,"y":345,"wires":[["30e1839a.cade6c"]]}]