-
Notifications
You must be signed in to change notification settings - Fork 3k
lifecycle: propagate SIGTERM to child #10868
Conversation
|
This looks pretty reasonable to me. It does still need a test. |
|
Done. The new test fails and hangs without previous commit, and the commit makes it pass. |
|
Awesome, thank you! |
|
I was considering whether to pull this into the 2.x LTS, and came to the conclusion that while folks may really not want to have orphaned zombies just from a Because of that, and because LTS is supposed to be more careful about stuff like this, I'm not gonna merge this into LTS. If anyone has other thoughts or objections, please feel free to chime in, since it's not set in stone. :) |
Credit: @daniel-pedersen PR-URL: #10868 Reviewed-By: @iarna
|
This landed in 3.8.1! |
package json imporvements
|
Freaking awesome @daniel-pedersen |
|
Hey guys, is this known/expected to work on Linux? I can see that it works on MacOS, but it doesn't seem to be working on our UAT box which is running Ubuntu Server? |
|
Seconding @dchambers on this. Make for quite annoying experience when automating tasks with npm. |
|
I'm using docker with Are you sure this PR is working on Linux? My NPM version is $ npm -v
3.10.10
$ node -v
v7.2.1 |
|
Hey @twang2218, it may be worth creating a new issue specifically for Linux support as this has been closed quite some time now. |
|
Yes, this isn’t working, at least with bash; npm runs its lifecycle processes in a shell, and bash doesn’t forward SIGTERM to its children. |
When one runs for example
npm run-script, any SIGTERM to npm will orphanize the child process. This is a simple fix for this (potential) issue. Now whenever npm launches a child through lifecycle, any SIGTERM signal is simply propagated to the child for the duration of the process.This behavior of npm when getting a SIGTERM seems to be what makes sense to most people (see the discussion in #4603), and makes
npm run-scriptmore friendly in various development scenarios.