fix: stop containers on Ctrl-C and add SIGTERM handler#90
Open
Jaro-c wants to merge 1 commit into
Open
Conversation
Closes #79 - attach_logs now installs a SIGTERM handler (unix) alongside the existing SIGINT handler; either signal unblocks the select and returns control to the caller - Up command calls engine.stop() after attach_logs returns so that Ctrl-C / SIGTERM triggers a clean container shutdown rather than leaving orphans running Signed-off-by: Jaro-c <75870284+Jaro-c@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
attach_logsnow installs a SIGTERM handler (unix) alongside the existing SIGINT handler; either signal exits the select and returns to the callerUpcommand callsengine.stop()afterattach_logsreturns so Ctrl-C / SIGTERM triggers a clean container shutdown instead of leaving orphans runningCloses #79
Test plan
cargo testpasses (444 tests)podup upthen Ctrl-C → all containers stop cleanly (no orphans)podup upthenkill -TERM <pid>→ all containers stop cleanly