I have an application with cluster and Forever. I want to save information from workers before shutdown or restart of the app. So I use process.on('SIGINT') and that works fine for CTRL+C.
But I have stuck with Forever. Is it possible to detect somehow the app was restarted by Forever? Is there any signal about that?
This issue is quite old, but for those who did not saw it, the lastest forever versions support --killSignal (this has been added in dec 2013) so you can use by example --killSignal=SIGUSR2
and catch this signal with process.on('SIGUSR2', func)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With