-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
Kill child when exiting #51
Comments
This is how the native |
Yes, sadly :( That's why I thought this might be a good place to improve on it :)
What I currently do is keep track of the processes I spawn and attach handlers to
The thing is that |
|
Right..silly me. But I encounter the same issue with that, the process is spawned but not terminated when the parent exits. |
Hmm. I assumed Node.js would clean up direct child processes when exiting. Sounds like something it should do. Can you try opening an issue on Node.js first? And comment the link here. Would be better to try to fix it for everyone, not just this module. If they decline, we can add it here. |
Sure, I will do that later tonight |
Just filed an issue with a minimal example: nodejs/node#7951 |
So as you can see from the issue this is the expected unixy behaviour. I still think it would be a great addition to optionally destroy the spawned process in this module. To catch that as referenced in the issue we could use https://www.npmjs.com/package/signal-exit. Let me know if you are interested and I can work on a PR for adding this tracking behaviour. |
I'm not surprised. Unexpected behavior usually is expected UNIX behavior... Sure, PR welcome :) |
As spawned processes are not cleaned up when the main process dies this option adds the abilitiy to kill those when the spawning process dies. Closes sindresorhus#51
As spawned processes are not cleaned up when the main process dies this option adds the abilitiy to kill those when the spawning process dies. Closes sindresorhus#51
As spawned processes are not cleaned up when the main process dies this option adds the abilitiy to kill those when the spawning process dies. Closes sindresorhus#51
As spawned processes are not cleaned up when the main process dies this option adds the abilitiy to kill those when the spawning process dies. Closes sindresorhus#51
If I use
execa.shell
to spawn a long running process, but the original process dies for some reason it would be great if the spawned process gets terminated automatically.A small example
Running this will print
exiting
after10s
and exit but when I grep foripfs dameon
the process is still running.The text was updated successfully, but these errors were encountered: