I have mosquitto and Node-Red installed on a Windows 10 machine. Mosquitto is running as a service and I’d like to get Node-Red running as a service as well since running Node-Red from a command window is less than optimal; accidentally closing the window means NR is no longer available. And starting it from a scheduled task at windows startup seems to be a bit hit or miss (not to mention that it doesn’t auto-restart if it unexpectedly terminates).
I thought I found an easy solution to this by using NSSM (which I’ve used in the past) and by using these NR specific install instructions.
Getting NR running as a service took all of 5 minutes. But I struggled for the better part of a day trying to get NR exec nodes to work with a Powershell script and a small console application I wrote--the latter so I could try to debug what was happening to the process. The script and console application both ran without error, (the process PID appeared below the NR exec node and in task manager), the attached debug node indicated the process returned a value of 0, but the script did nothing (launching the script from a command prompt worked as expected). Oddly Windows system commands such as ping.exe worked fine using an NR exec node.
I finally decided to try stopping the service and launching NR from a command window. Everything now worked as expected indicating a likely permissions issue with the service. The NSSM created Node-Red service was using the Local System account. So I edited the service to use an admin account, terminated the instance of NR running in a command window, started the service. Same problem.
This should be a trivial thing to solve but I’m at a loss as to what the issue might be.
Anyone run into this before?