[{"id":"e16d1138.45111","type":"exec","z":"396e6d9.614e192","command":"sudo systemctl restart nrlive","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":300,"y":1520,"wires":[["7ba7c71a.091228"],["7ba7c71a.091228"],["7ba7c71a.091228"]]},{"id":"f213d338.4b65e","type":"inject","z":"396e6d9.614e192","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":1520,"wires":[["e16d1138.45111"]]},{"id":"7ba7c71a.091228","type":"debug","z":"396e6d9.614e192","name":"","active":true,"console":"false","complete":"false","x":530,"y":1520,"wires":[]},{"id":"b0a625b0.f18088","type":"comment","z":"396e6d9.614e192","name":"** DANGER!: Restart the Node-Red service **","info":"","x":230,"y":1480,"wires":[]},{"id":"54e7a83f.4bc0d8","type":"inject","z":"396e6d9.614e192","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":110,"y":1620,"wires":[["11b3275a.b67c59"]]},{"id":"11b3275a.b67c59","type":"exec","z":"396e6d9.614e192","command":"sudo reboot now","addpay":false,"append":"","useSpawn":"","name":"","x":260,"y":1620,"wires":[["4a31df27.3e00b"],["4a31df27.3e00b"],["4a31df27.3e00b"]]},{"id":"4a31df27.3e00b","type":"debug","z":"396e6d9.614e192","name":"","active":false,"console":"false","complete":"false","x":530,"y":1620,"wires":[]},{"id":"a8091459.9fa1d8","type":"comment","z":"396e6d9.614e192","name":"** DANGER! Reboots the Pi running Node-Red, InfluxDB and MQTT **","info":"","x":310,"y":1580,"wires":[]},{"id":"4589dfca.bf6b7","type":"comment","z":"396e6d9.614e192","name":"TODO: Remove service name and pull from settings instead","info":"","x":640,"y":1480,"wires":[]}]
Not clever but it works fine on any Linux system using systemd. You do need to make sure that the user id running Node-RED has sudo without password rights to run the systemctrl command.
If you are not using systemd, you need to record the PID when starting so that you can kill the current process. But then it is hard to get something to restart Node-RED without a tool like PM2.