Reading the output of a script

Hi! :slight_smile:
So I'm successfully (to my surprise as I'm such a noob) reading the output of a PHP script and doing different things with the output depending on the content. I'm very happy. It's working. But the script is told to initialise by a timestamp which is set to only run once and then not repeat.

Somewhere down the line obviously something is going to go wrong and the 'link' between node-red and that script running will be broken.

How do I go about checking for that and engineering in restarting the script as and when needed?

many thanks! :slight_smile: :slight_smile:

Look at the node-red-node-daemon node. Which is similar to exec but meant for long running processes, and does restarts.

Thanks dceejay - I have tried the daemon node but weirdly it refuses to work, occasionally it will spit out some genuine output from the PHP script but mostly it just says "Command not found" which is odd because it's the exact same command which works a treat from the 'exec' node? Odd. Shame because I'd love its restarting/monitoring abilities...

Have you tried to only put php in the command part and everything else in the argument field. That made me struggle with the daemon node when I first used it. So like this:

It's really strange. What works as an exec node does not work for a daemon node even if I do as you suggest and put php in the command field and the path in the argument field.


what does the error on pin2 and / or pin 3 say ?

Also asked in Exec node seems to fail, go to Rc:1
so closing this one