-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Description
I have a service that should do some cleanup before stopping.
This way runs successful:
- pm2 is running as service
- in an admin console I start the service with
pm2 start service.js --kill-timeout 10000 --shutdown-with-message
- in the admin console I enter manually
pm2 stop all
- the service received successfully the shutdown message
But if instead of point 4 I stop the service with net stop pm2.exe
, no message is sent to my service.
In the service I use this to catch the message:
process.on('message', msg => {
if (msg === 'shutdown') {
console.log('shutdown');
}
});
Is there another way to do this?
Metadata
Metadata
Assignees
Labels
No labels