initial commit
commit
e69e6fb2db
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
sudo rm /etc/systemd/system/node-red@.service
|
||||
sudo ln -s /opt/node-red-run/node-red.service /etc/systemd/system/
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable node-red
|
||||
sudo systemctl restart node-red
|
||||
sleep 5
|
||||
sudo journalctl --unit=node-red -n 50 --no-pager
|
||||
exit 1
|
|
@ -0,0 +1,23 @@
|
|||
[Unit]
|
||||
Description=Node-RED
|
||||
After=syslog.target network.target
|
||||
|
||||
[Service]
|
||||
# uncomment environment and set for alternative user directory, default is /opt/node-red
|
||||
# run > sudo systemctl daemon-reload
|
||||
# Environment=NODE_RED_USER_DIR=/opt/node-red
|
||||
ExecStart=/bin/bash /opt/node-red-run/run ${NODE_RED_USER_DIR}
|
||||
Restart=on-failure
|
||||
KillSignal=SIGINT
|
||||
|
||||
# log output to syslog as 'node-red'
|
||||
SyslogIdentifier=node-red
|
||||
StandardOutput=syslog
|
||||
|
||||
# non-root user to run as
|
||||
WorkingDirectory=/opt/node-red
|
||||
User=sysadmin
|
||||
Group=sysadmin
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,11 @@
|
|||
# Node Red - Runner
|
||||
|
||||
This repo aids in keeping node-red up to date and running via a systemd Service
|
||||
|
||||
install nodered and esm globally
|
||||
|
||||
sudo npm install -g --unsafe-perm node-red && sudo npm install -g esm
|
||||
|
||||
Just clone repo to `/opt`
|
||||
|
||||
you can run the /.start script
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
GDIR="/usr/lib/node_modules" # global install
|
||||
DIR=${1:-$NODE_RED_USER_DIR}
|
||||
echo any dir set? $DIR
|
||||
DIR=${DIR:-/opt/node-red}
|
||||
echo any dir set? $DIR
|
||||
echo Starting Node Red with instance directory $DIR
|
||||
/usr/bin/node -r $GDIR/esm $GDIR/node-red/red.js --userDir $DIR
|
Loading…
Reference in New Issue