sxiii icon

Node-RED SystemD Unit

sxiii | PRO | 03/09/23 08:54:24 AM UTC (Edited) | 0 ⭐ | 1485 👁️ | Never ⏰ | [nodered, systemd]
Bash |

1.14 KB

|

None

|

0 👍

/

0 👎

# This script work on any system using systemd as the init process.
 
# To easily download, install and set at startup:
# wget https://pastebin.com/raw/yMbPkcSG -O /etc/systemd/system/nodered.service && sudo systemctl --reload-daemon && sudo systemctl enable nodered
 
# To consult the log : journalctl -u nodered
[Unit]
Description=Node-RED is a tool for wiring together hardware devices, APIs and online services in new and interesting ways.
After=syslog.target network.target
Documentation=http://nodered.org/
 
[Service]
Environment="NODE_OPTIONS=--max-old-space-size=128"
Environment="NODE_RED_OPTIONS=-v"
#Full Path to Node.js
ExecStart=/usr/bin/node-red $NODE_OPTIONS flows.js $NODE_RED_OPTIONS
WorkingDirectory=/home/dvb/node-red/
# User/Group that launches node-RED (it's advised to create a new user for Node-RED)
# You can do : sudo useradd node-red
# then change the User=root by User=node-red
User=user
Group=user
Nice=10
SyslogIdentifier=Node-RED
StandardOutput=syslog
# Make Node-RED restart if it fails
Restart=on-failure
# Node-RED need a SIGINT to be notified to stop
KillSignal=SIGINT
 
[Install]
WantedBy=multi-user.target

Comments