Skip to content

Resurrect Starts all Apps Regardless of Whether they were Running at Shutdown #1090

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

Closed
btleffler opened this issue Mar 13, 2015 · 3 comments
Closed

Comments

@btleffler
Copy link

I'm currently testing PM2 locally. My machine is running Ubuntu 14.10, Node.js 0.10.36, and PM2 0.12.7.

I'm seeing behavior that is unexpected (at least to me) when PM2 is killed and the resurrect command is called.

$ pm2 list
┌──────────────┬────┬──────┬──────┬────────┬─────────┬────────┬─────────────┬──────────┐
│ App name     │ id │ mode │ pid  │ status │ restart │ uptime │ memory      │ watching │
├──────────────┼────┼──────┼──────┼────────┼─────────┼────────┼─────────────┼──────────┤
│ test-service │ 0  │ fork │ 4222 │ online │ 2       │ 20s    │ 31.984 MB   │ disabled │
└──────────────┴────┴──────┴──────┴────────┴─────────┴────────┴─────────────┴──────────┘
 Use `pm2 show <id|name>` to get more details about an app

$ pm2 stop 0
[PM2] Stopping 0
[PM2] stopProcessId process id 0
┌──────────────┬────┬──────┬─────┬─────────┬─────────┬────────┬────────┬──────────┐
│ App name     │ id │ mode │ pid │ status  │ restart │ uptime │ memory │ watching │
├──────────────┼────┼──────┼─────┼─────────┼─────────┼────────┼────────┼──────────┤
│ test-service │ 0  │ fork │ 0   │ stopped │ 8       │ 0      │ 0 B    │ disabled │
└──────────────┴────┴──────┴─────┴─────────┴─────────┴────────┴────────┴──────────┘
 Use `pm2 show <id|name>` to get more details about an app

$ pm2 dump
[PM2] Dumping processes

$ pm2 kill
[PM2] Stopping PM2...
[PM2] deleteProcessId process id 0
[PM2] All processes has been stopped and deleted
[PM2] PM2 stopped

$ pm2 resurrect
[PM2] Spawning PM2 daemon
[PM2] PM2 Successfully daemonized
[PM2] Resurrecting
Process /home/bleffler/projects/test-service/index.js launched
┌──────────────┬────┬──────┬──────┬────────┬─────────┬────────┬─────────────┬──────────┐
│ App name     │ id │ mode │ pid  │ status │ restart │ uptime │ memory      │ watching │
├──────────────┼────┼──────┼──────┼────────┼─────────┼────────┼─────────────┼──────────┤
│ test-service │ 0  │ fork │ 4380 │ online │ 0       │ 0s     │ 14.023 MB   │ disabled │
└──────────────┴────┴──────┴──────┴────────┴─────────┴────────┴─────────────┴──────────┘
 Use `pm2 show <id|name>` to get more details about an app

It seems to me that if a process is stopped and the dump is saved, when PM2 is resurrected the process should be in the list, but still stopped.

Does anyone know if there's a way to make sure stopped processes stay that way after resurrect is called? It's also possible that I may be missing something about they way dump and resurrect work.

Thanks!

@jshkurti
Copy link
Contributor

Okay, we are going to implement this on the next release :)
I'll post here when it is done ;)

@btleffler
Copy link
Author

@jshkurti - Great news! Thanks!

@Unitech
Copy link
Owner

Unitech commented Dec 12, 2016

$ npm install pm2@next -g
$ pm2 update

@Unitech Unitech closed this as completed Dec 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants