zeus 4 years ago
parent
commit
d548050905
  1. 15
      startup.sh
  2. 7
      supervisord-iot.conf

15
startup.sh

@ -15,6 +15,7 @@ REPO=${REPO%.git}
read -r -d '' VAR <<EOF read -r -d '' VAR <<EOF
#!/bin/bash #!/bin/bash
export NODE_PATH=/home/$USER/$REPO/swarmlab-app/src/node_modules
pm2-runtime /home/$USER/crond/playground.config.js pm2-runtime /home/$USER/crond/playground.config.js
EOF EOF
@ -80,12 +81,24 @@ read -r -d '' VAR <<EOF
su -c 'cd /home/$USER/$REPO/swarmlab-app/src; npm install; npm install express --save; ' - node su -c 'cd /home/$USER/$REPO/swarmlab-app/src; npm install; npm install express --save; ' - node
#su -c 'cd /home/$USER/$REPO/swarmlab-app/src; npm install; npm install express --save; npm cache clean --force;' - node #su -c 'cd /home/$USER/$REPO/swarmlab-app/src; npm install; npm install express --save; npm cache clean --force;' - node
su -c 'pm2-runtime /home/$USER/crond/playground.config.js' - node #su -c 'pm2-runtime /home/$USER/crond/playground.config.js' - node
EOF EOF
echo "$VAR" > /home/$USER/crond/playground-npm-install.sh echo "$VAR" > /home/$USER/crond/playground-npm-install.sh
# ---------------------------
# run node from supervisor
# --------------------------
read -r -d '' VAR <<EOF
#!/bin/bash
export NODE_PATH=/home/$USER/$REPO/swarmlab-app/src/node_modules
pm2-runtime /home/$USER/crond/playground.config.js
EOF
echo "$VAR" > /home/$USER/crond/playground-npm-run.sh
# ***************************************************** # *****************************************************

7
supervisord-iot.conf

@ -5,10 +5,11 @@ command=bash -c "sleep 5 && cd /home/node && su -c 'ttyd --ssl --ssl-cert /home/
stdout_logfile=/var/log/ttyd.log stdout_logfile=/var/log/ttyd.log
autorestart=true autorestart=true
#[program:pm2] [program:pm2]
#command=bash -c 'sleep 5 && pm2-runtime /home/%(ENV_USER)s/crond/playground.config.js ' #command=bash -c 'sleep 5 && pm2-runtime /home/%(ENV_USER)s/crond/playground.config.js '
#stdout_logfile=/var/log/pm2.log command=bash -c 'sleep 5 && /home/%(ENV_USER)s/crond/playground-npm-run.sh '
#autorestart=true stdout_logfile=/var/log/pm2.log
autorestart=true
[program:nginx] [program:nginx]

Loading…
Cancel
Save