# systemd service file to start Node-RED
[Unit]Description=Node-RED graphical event wiring tool.Wants=network.targetDocumentation=http://nodered.org/docs/hardware/raspberrypi.html
[Service]Type=simple# Run as normal pi user - feel free to change...User=piGroup=piNice=5Environment="NODE_OPTIONS=--max-old-space-size=128"#Environment="NODE_RED_OPTIONS=-v"#WorkingDirectory=/usr/lib/node_modules/node-red/#ExecStart=/usr/bin/env node $NODE_OPTIONS red.js $NODE_RED_OPTIONSExecStart=/usr/bin/env node-red-pi $NODE_OPTIONS $NODE_RED_OPTIONS# Use SIGINT to stopKillSignal=SIGINT# Auto restart on crashRestart=on-failure# Tag things in the logSyslogIdentifier=Node-RED#StandardOutput=syslog
[Install]WantedBy=multi-user.target
--
http://nodered.org
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
For more options, visit https://groups.google.com/d/optout.
# See https://gist.github.com/Belphemur/3f6d3bf211b0e8a18d93
# http://www.freedesktop.org/wiki/Software/systemd/
[Unit]
Description=Node-Red Live2 Instance for Home Automation
Documentation=http://nodered.org/docs
After=syslog.target network.target mongodb.service mosquitto.service
[Service]
Environment="NODE_OPTIONS=--max-old-space-size=128"
#Environment="NODE_RED_OPTIONS=-v"
#Full Path to Node.js
ExecStart=/usr/local/bin/node $NODE_OPTIONS server.js
$NODE_RED_OPTIONS
#ExecStart=/usr/local/bin/node server.js
WorkingDirectory=/home/pi/node/nr-live2
# 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=pi
Group=pi
Nice=10
SyslogIdentifier=NR-Live2
StandardOutput=syslog
# Make Node-RED restart if it fails
Restart=on-failure
#Restart=always
#RestartSec=100
# Node-RED need a SIGINT to be notified to stop
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target