Skip to content

Instantly share code, notes, and snippets.

@DefProc
Created September 23, 2020 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DefProc/2aba79f4cc765ea86809ecd9433d1100 to your computer and use it in GitHub Desktop.
Save DefProc/2aba79f4cc765ea86809ecd9433d1100 to your computer and use it in GitHub Desktop.
node-red service file
# This script work on any system using systemd as the init process.
# To install (assuming root):
# vim /etc/systemd/system/node-red.service
# paste in the file contents
# systemctl daemon-reload
# systemctl enable node-red
# service node-red start
# service node-red status
# To consult the log
# journalctl -u node-red
[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=512"
#Environment="NODE_RED_OPTIONS=-v"
ExecStart=/usr/bin/node-red $NODE_OPTIONS $NODE_RED_OPTIONS
WorkingDirectory=/home/node-red
# User & Group that launches node-RED (it's advised to create a new user for Node-RED)
# eg.
# sudo useradd node-red
User=node-red
Group=node-red
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment