Is it possible to intercept the default signal killand use it as a command to gracefully disconnect? This is for Solaris SMF. The easiest way to find a stopped service that I found is to set the :killscript as a shutdown, and then add a trailing hook to it. In this case, I want to do this for Node.JS. How should I do it?
Edit: The goal is to
- Stop receiving new requests.
- Provide existing callbacks for a few seconds.
- Enter some information in stderr.
@alienhard the first sentence was to use process.on('exit'..., but it seems like I could not execute number 2 with this method.
source
share