New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pm2 does not restart app when Centos server reboot #1521
Comments
👍 same here |
Using Ubuntu 14.04.1 got similar behaviour for
Using A note of worth is that reading https://www.digitalocean.com/community/tutorials/how-to-use-pm2-to-setup-a-node-js-production-environment-on-an-ubuntu-vps it points to use |
I'm running into the same thing. I did come across this article, but it didn't really seem to help much. I did however get it to startup once on reboot but not since.
I'm not sure if it makes a difference, but just so you have more info; I am starting this from a config (JSON) file. {
"apps": [
{
"name": "express-app-production",
"script": "bin/www",
"env": {
"NODE_ENV": "production",
"PORT": "3000"
}
}
]
} |
I ran into this issue, and found a solution that works for me. Let's assume I've created a user named 'node' to run pm2. All of the commands below should be run by the node user, in the node user's home directory (/home/node)
I found the issue was, the user was being set appropriately in the pm2-init.sh file, but the PM2_HOME directory was set to ==UPDATE== For centos, I was able to replace step 2 above with the following: |
@dibari thank you! it worked out for me too! Update: while it worked at the first time, it stopped working right after. The issue is that |
@dibari |
Same problem here. To me it seems like dumpfile gets emptied on reboot. If I run resurrect manually as proper user, it all works. I'm using pm2-generated init file, with non-root user who has all node tools and pm2 installed under his account. |
@mikalai-silivonik thanks should go to you here, on CentOS7
|
@ghartsho your |
@thanhthang20 I try success by this step pm2 start start.js
pm2 save
pm2 startup centos |
@meteormatt
Any ideas? |
@ubiko Maybe no enough memory? |
@meteormatt that must be it! I'm on a VPS with no control over the swap. |
Closing in favor of #2559 To try the new startup system: $ npm install Unitech/pm2#development -g
$ pm2 update $ pm2 startup # Then copy / paste the command displayed
$ pm2 unstartup |
The text was updated successfully, but these errors were encountered: