I have used many times a change node setting a "msg.kill" to the value of "kill -2" to stop an exec node running a python script (python -u /../..something.py).
But I just experienced that, for some reason I don't understand, this may not work all the times.
I have tried using an exact copy of the flow with the same exec running the same script. The one on the top stops with the msg.kill as above.
The one at the bottom doesn't. Even if I disconnect the wires and deploy, it doesn't stop. I have to stop it from terminal using the pid.
I am not sure about what is going on!
Any hint?
Thanks
[
{
"id": "a10ded18eb7571d8",
"type": "inject",
"z": "faef46163bd149ff",
"name": "Start",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "10101",
"payloadType": "num",
"x": 850,
"y": 360,
"wires": [
[
"2f2ae80f72d3f3db"
]
]
},
{
"id": "2f2ae80f72d3f3db",
"type": "exec",
"z": "faef46163bd149ff",
"command": "python -u /home/bms/Dev/APItest/APItest.py",
"addpay": "",
"append": "",
"useSpawn": "true",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Exec",
"x": 1130,
"y": 360,
"wires": [
[],
[],
[]
]
},
{
"id": "11967cc303a2c401",
"type": "inject",
"z": "faef46163bd149ff",
"name": "Stop",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "0",
"payloadType": "num",
"x": 850,
"y": 400,
"wires": [
[
"5f3e9c4c97e16aaf"
]
]
},
{
"id": "5f3e9c4c97e16aaf",
"type": "change",
"z": "faef46163bd149ff",
"name": "Kill",
"rules": [
{
"t": "set",
"p": "kill",
"pt": "msg",
"to": "Kill -2",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 970,
"y": 400,
"wires": [
[
"2f2ae80f72d3f3db"
]
]
},
{
"id": "94b24c088a74dd06",
"type": "inject",
"z": "faef46163bd149ff",
"name": "Start",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1",
"payloadType": "num",
"x": 850,
"y": 480,
"wires": [
[
"130ea29504cc69f4"
]
]
},
{
"id": "130ea29504cc69f4",
"type": "exec",
"z": "faef46163bd149ff",
"command": "python -u /home/bms/Dev/APItest/APItest.py",
"addpay": "",
"append": "",
"useSpawn": "true",
"timer": "",
"winHide": false,
"oldrc": false,
"name": "Exec",
"x": 1130,
"y": 480,
"wires": [
[],
[],
[]
]
},
{
"id": "7ee6296a0187bd67",
"type": "inject",
"z": "faef46163bd149ff",
"name": "Stop",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "0",
"payloadType": "num",
"x": 850,
"y": 540,
"wires": [
[
"5cd4fb73d7364806"
]
]
},
{
"id": "5cd4fb73d7364806",
"type": "change",
"z": "faef46163bd149ff",
"name": "Kill",
"rules": [
{
"t": "set",
"p": "kill",
"pt": "msg",
"to": "kill -2",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 990,
"y": 540,
"wires": [
[
"130ea29504cc69f4"
]
]
}
]