Properly shutdown the installer's child process #3260
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the proper solution for #3251. Without this change, shutting down the server only works by pressing ctrl-c while having a terminal open with the stdin of the child process (actual MC server), since the child is started with
inheritIO()
. When the stdin is not kept open, which would be normal for a swarm deployment, before this commit there was actually no way of cleanly shutting down the server, because PID1 received the INT/TERM signal, started its shutdown hook which then waits forever for the child to exit, since the child does not know it's supposed to exit. Now it does, I tested this in a few scenarios.Again a tiny change to work better in container environments.