feat: add upgrade script (for major releases), node log script
refactor: better run scriptmaster
parent
e4d19d0e09
commit
3acf88c918
|
@ -0,0 +1 @@
|
|||
/node_modules/
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
sudo rm /etc/systemd/system/node-red@.service
|
||||
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
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
journalctl -f -u node-red
|
|
@ -3,9 +3,8 @@ 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
|
||||
# uncomment environment and set for alternative user directory, default is /data/node-red
|
||||
# Environment=NODE_RED_USER_DIR=
|
||||
ExecStart=/bin/bash /opt/node-red-run/run ${NODE_RED_USER_DIR}
|
||||
Restart=on-failure
|
||||
KillSignal=SIGINT
|
||||
|
@ -15,7 +14,7 @@ SyslogIdentifier=node-red
|
|||
StandardOutput=syslog
|
||||
|
||||
# non-root user to run as
|
||||
WorkingDirectory=/opt/node-red
|
||||
# WorkingDirectory=${NODE_RED_USER_DIR}
|
||||
User=sysadmin
|
||||
Group=sysadmin
|
||||
|
||||
|
|
10
run
10
run
|
@ -1,8 +1,6 @@
|
|||
#!/bin/bash
|
||||
GDIR="/usr/lib/node_modules" # global install
|
||||
GDIR="/usr/lib/node_modules" # global install, default global install directory
|
||||
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
|
||||
[[ !$DIR ]] && echo using default user directory /data/node-red && DIR=/data/node-red
|
||||
echo Starting Node Red with user instance directory $DIR
|
||||
/usr/bin/node $GDIR/node-red/red.js --userDir $DIR
|
6
update
6
update
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
# run global update on node-red and esm
|
||||
sudo npm install -g --unsafe-perm node-red
|
||||
sudo npm install -g esm
|
||||
# run global update on node-red
|
||||
sudo systemctl stop nodered
|
||||
sudo npm install -g --unsafe-perm --prefix /usr node-red
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart node-red
|
||||
|
|
Loading…
Reference in New Issue