Update recommended Dockerfile
instructions to run as PID 1
#151
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 simple changeset updates the recommended
Dockerfile
instructions to run X as PID 1 without an implicit wrapping shell. In particular, by avoiding an additionalsh
process, we can ensure any signals sent always target thephp
process directly.Note that PID 1 has special semantics on Unix-based systems. In particular, it does not have any default signal handling (which is why this builds on top of #150 first) and has additional responsibilities to reap zombie child processes. Child processes spawned directly using the ChildProcess component should be reaped just fine, but orphaned processes from deeper process trees may require special care. If in doubt, using a small init process like
tini
ordump-init
inside your Docker container may be a good idea. In the long run, X should get additional features to handle theSIGCHLD
signal to take care of any orphaned processes itself, but this is currently out of scope for this PR and should be addressed in a follow-up PR in the future.Link dump for further details:
Builds on top of #136, #149 and #150