-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
process.kill() doesn't kill the real command while using shell option #46865
Comments
I think that this is a duplicate of #37518 |
Yes seems like the same problem. So is it fixed now? What version should I use? And also, is there a way to get the PID of real command running (not |
Also a duplicate of #2098. It is more like a Linux pitfall than a Node.js bug. |
That's fundamentally how Unices work, it's not specific to node. If you use Closing, working as intended (by the inventors of UNIX.) |
Version
16.14.0
Platform
UNIX Ubuntu 20.04.3 TLS
Subsystem
No response
What steps will reproduce the bug?
I'm not sure it could be reproduced in all cases. I'm usin
spawn
withshell: true
to run a command.How often does it reproduce? Is there a required condition?
For me, it's a constant behavior. Always the same.
What is the expected behavior?
Expected behavior is the real process to be killed with
process.kill()
. But onlysh
wrapper is killed. Real command keeps running.What do you see instead?
I monitored my processes. When I run a command using
spawn
andshell: true
, it runs two processes in OS. One is thesh
wrapper, and another one in my real command. With two separate PIDs.When I use
process.kill()
,sh
is killed. But real command keeps running (not killed).Additional information
Anything we get from a
process
instance such asprocess.pid
orprocess.kill()
is related tosh
wrapper. Not real running command.The text was updated successfully, but these errors were encountered: