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
|
#!/bin/bash
|
||||||
sudo rm /etc/systemd/system/node-red@.service
|
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 ln -s /opt/node-red-run/node-red.service /etc/systemd/system/
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl enable node-red
|
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
|
After=syslog.target network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
# uncomment environment and set for alternative user directory, default is /opt/node-red
|
# uncomment environment and set for alternative user directory, default is /data/node-red
|
||||||
# run > sudo systemctl daemon-reload
|
# Environment=NODE_RED_USER_DIR=
|
||||||
# Environment=NODE_RED_USER_DIR=/opt/node-red
|
|
||||||
ExecStart=/bin/bash /opt/node-red-run/run ${NODE_RED_USER_DIR}
|
ExecStart=/bin/bash /opt/node-red-run/run ${NODE_RED_USER_DIR}
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
KillSignal=SIGINT
|
KillSignal=SIGINT
|
||||||
|
@ -15,7 +14,7 @@ SyslogIdentifier=node-red
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
|
|
||||||
# non-root user to run as
|
# non-root user to run as
|
||||||
WorkingDirectory=/opt/node-red
|
# WorkingDirectory=${NODE_RED_USER_DIR}
|
||||||
User=sysadmin
|
User=sysadmin
|
||||||
Group=sysadmin
|
Group=sysadmin
|
||||||
|
|
||||||
|
|
10
run
10
run
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/bash
|
#!/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}
|
DIR=${1:-$NODE_RED_USER_DIR}
|
||||||
echo any dir set? $DIR
|
[[ !$DIR ]] && echo using default user directory /data/node-red && DIR=/data/node-red
|
||||||
DIR=${DIR:-/opt/node-red}
|
echo Starting Node Red with user instance directory $DIR
|
||||||
echo any dir set? $DIR
|
/usr/bin/node $GDIR/node-red/red.js --userDir $DIR
|
||||||
echo Starting Node Red with instance directory $DIR
|
|
||||||
/usr/bin/node -r $GDIR/esm $GDIR/node-red/red.js --userDir $DIR
|
|
6
update
6
update
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# run global update on node-red and esm
|
# run global update on node-red
|
||||||
sudo npm install -g --unsafe-perm node-red
|
sudo systemctl stop nodered
|
||||||
sudo npm install -g esm
|
sudo npm install -g --unsafe-perm --prefix /usr node-red
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
sudo systemctl restart node-red
|
sudo systemctl restart node-red
|
||||||
|
|
Loading…
Reference in New Issue