pm2 Startup not starting up on Ubuntu -
i having difficulty getting pm2 restart (itself , 2 node/express files, app.js
& app2.js
) on server re-boot.
below processes have tried:
pm2 startup pm2 start app.js pm2 start app2.js pm2 startup ubuntu (also tried systemd , with/without -u username) pm2 save
i ran above commands in every possible combination , nothing worked. tried running root , did not work either.
my ~/.pm2/dump.pm2
file contains information not sure else look.
i have attempted modify /etc/init.d/pm2-init.sh
file according this issue did not help.
my setup:
digital ocean server
ubuntu 15.10
node v5.4.1
pm2 v 1.0.0
other references tried..
http://pm2.keymetrics.io/docs/usage/startup/
https://www.digitalocean.com/community/tutorials/how-to-use-pm2-to-setup-a-node-js-production-environment-on-an-ubuntu-vps
https://gist.github.com/leommoore/5998406
https://www.terlici.com/2015/06/20/running-node-forever.html
https://serversforhackers.com/node-process-management-with-pm2 http://nodered.org/docs/getting-started/running.html#starting-node-red-on-boot
https://github.com/unitech/pm2/issues/1316
so far, each time reboot server, pm2 fails startup automatically (unless need wait few minutes? - nginx restarts instantly).
can me out this? order in commands should run? need modify additional files?
i think solved problem
i played pm2, , found 2 working way centos 7 (in project folder index.js - main file):
1
sudo pm2 start index.js sudo pm2 save sudo pm2 startup centos2
pm2 start index.js pm2 save pm2 startup centos '# , run script generated in previous code under sudo
Comments
Post a Comment