-
Notifications
You must be signed in to change notification settings - Fork 37
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" process killing on Windows (something akin to SIGINT) #13
Comments
I looked into supporting a CTRL_C "signal" for Windows platforms, but it looks like existing solutions are hacky at best. Source: http://stanislavs.org/stopping-command-line-applications-programatically-with-ctrl-c-events-from-net/ If there is a universal way to gracefully shutdown windows processes, I'm not aware of it. For your particular case though, if the process you are trying to kill is also a Node program and you can edit the source, it should be easy to use process.send() or some other mechanism to communicate with the process and tell it to stop. I don't think that's within the scope of tree-kill though. |
Yes, from my findings, it's pretty much impossible to gracefully kill in windows from a separate process, at least for the time being. Unless node implements a way to hook into its own processes like how some IDEs work when debugging node.js applications, we're stuck with hacky methods that don't fully work. |
I'm going to officially move this into the "Features I would like tree-kill to support, but would need a volunteer to actually figure out how" category. |
hey, I've update graceful to support windows. please see https://github.com/feifeipan/childprocess-exit for details. |
I get that Windows doesn't handle POSIX signals like Linux, but seems like the process just gets killed so you can't do a graceful shutdown.
Any way to do this? Let's say I have a process that's doing it's own thing and want to kill it, but before it does, I want it to do something:
The text was updated successfully, but these errors were encountered: