https://discourse.nodered.org/t/auto-start-node-red-in-ubuntu/17627/6
Autostart Node-RED on Boot
To make Node-RED autostart when you boot or restart your Virtual Machine, you need to create a new systemd file for the nodered.service:
sudo nano /etc/systemd/system/nodered.service
Then, add the following (if you’re using root, you can leave the file as it is – otherwise comment the root and configure the non-root user option):
[Unit]
Description=Node-RED
After=syslog.target network.target
[Service]
ExecStart=/usr/local/bin/node-red --max-old-space-size=128 -v
Restart=on-failure
KillSignal=SIGINT
# log output to syslog as 'node-red'
SyslogIdentifier=node-red
StandardOutput=syslog
# non-root user to run as
#WorkingDirectory=/home/rui/
#User=rui
#Group=rui
# if using a root user
WorkingDirectory=/root/
User=root
Group=root
[Install]
WantedBy=multi-user.target
Your file should look like this, save it and exit (Ctrl+X, Y, Enter key).
No hay comentarios:
Publicar un comentario