-
Notifications
You must be signed in to change notification settings - Fork 66
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
Graceful Shutdown | Best Practices | PM2 Documentation #182
Comments
When running via |
I believe OS should only send signal to the main process (in your case |
What's that suppose to means of this sentence, does it mean that in cluster mode, I don't have to write my graceful reboot logic at all? What if the default system does't suit my needs, can I rewrite it? |
The documentation is nice and clear about the graceful shutdown setup, though, process.on() seems unable to intercept the exit signals of the node process in order to have a graceful shutdown. The events my app listens to are: SIGINT, SIGTERM, uncaughtException. This happens only when running node through pm2. Any solution? |
Do you have a version of the above examples that handles if a prerequisite service (like mongo) fails to initialise and gracefully shut down any other connections that have been made? In my use case, I'm connecting to MongoDB and RabbitMQ, if their fails, I'd like it to gracefully shut down any other connections after logging to console |
The original url is 404. Maybe update to https://doc.pm2.io/en/runtime/best-practices/graceful-shutdown/#graceful-shutdown |
https://pm2.io/doc/en/runtime/best-practices/graceful-shutdown/
PM2 - Guide, References, Tutorials and Best Practices about PM2 and Node.js.
The text was updated successfully, but these errors were encountered: