coreybutler / coreybutler/node-windows
How to Handle Stopping a Service
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 368
- PR merge metrics
- No merged PRs in 30d
Description
I'm using node-windows and it works great for everything other than stopping and the answer provided in #75 is not what I'm looking for.
If I stop my service using say the Service UI and click "Stop" on my running service, it will shutdown the process but none of my graceful termination code is called. I've tried using the [`death`](https://npmjs.com/package/death) to listen for `SIGINT`, `SIGUP`, `SIGTERM` but no avail (similar to #114). I've also tried listening for the `'stop'` event on my service but that doesn't get fired either, my guess is that it only fires when `svc.stop()` is called from within the app itself.
How can my app know when the service is stopped from outside the current code? What should I be listening for?
Contributor guide
Assessment
This issue has not been assessed yet.