In case you want a flow - this works on a Pi and should work on any modern Linux (that uses systemd which is most of them).
[{"id":"384924bd.c7b6dc","type":"exec","z":"106a5b82.ef95a4","command":"sudo systemctl restart nrlive","addpay":true,"append":"","useSpawn":"","timer":"","name":"","x":873,"y":617,"wires":[["c8f2f6f1.370d08"],["c8f2f6f1.370d08"],["c8f2f6f1.370d08"]]},{"id":"5c9d8978.a36278","type":"inject","z":"106a5b82.ef95a4","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":674,"y":617,"wires":[["384924bd.c7b6dc"]]},{"id":"c8f2f6f1.370d08","type":"debug","z":"106a5b82.ef95a4","name":"","active":true,"console":"false","complete":"false","x":1143,"y":617,"wires":[]},{"id":"46129a4f.b9ed64","type":"comment","z":"106a5b82.ef95a4","name":"** DANGER!: Restart the Node-Red service **","info":"","x":770,"y":580,"wires":[]},{"id":"85941f67.76613","type":"inject","z":"106a5b82.ef95a4","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"x":673,"y":708,"wires":[["f5f9bc5a.5ab3f"]]},{"id":"f5f9bc5a.5ab3f","type":"exec","z":"106a5b82.ef95a4","command":"sudo reboot now","addpay":false,"append":"","useSpawn":"","name":"","x":842,"y":708,"wires":[["e5e0f45f.0287f8"],["e5e0f45f.0287f8"],["e5e0f45f.0287f8"]]},{"id":"e5e0f45f.0287f8","type":"debug","z":"106a5b82.ef95a4","name":"","active":false,"console":"false","complete":"false","x":1142,"y":708,"wires":[]},{"id":"5714af73.78418","type":"comment","z":"106a5b82.ef95a4","name":"** DANGER! Reboots the Pi running Node-Red, InfluxDB and MQTT **","info":"","x":847,"y":672,"wires":[]},{"id":"7e632c5f.0a5944","type":"comment","z":"106a5b82.ef95a4","name":"TODO: Remove service name and pull from settings instead","info":"","x":1160,"y":580,"wires":[]}]
It has a flow for restarting Node-RED and one for rebooting the Pi. Works fine assuming that sudo is configured not to ask for an additional password when running these commands.