fix: remove Setsid from runWithoutReap to restore TTY#567
Merged
AkihiroSuda merged 1 commit intorootless-containers:masterfrom Apr 1, 2026
Merged
Conversation
AkihiroSuda
reviewed
Mar 31, 2026
AkihiroSuda
reviewed
Mar 31, 2026
| } | ||
|
|
||
| func runWithoutReap(cmd *exec.Cmd) error { | ||
| cmd.SysProcAttr.Setsid = true |
Member
There was a problem hiding this comment.
Would it be possible to have a test?
fa99e86 to
e5b7c66
Compare
Commit 2ca0537 introduced Setsid=true in runWithoutReap(), which creates a new session for the child process and detaches it from the controlling terminal. This causes bash to fail with: bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell Setsid is only needed in runAndReap() where rootlesskit acts as init and needs session isolation for zombie reaping via Wait4(-1, ...). In the non-reaping path, the child should inherit the parent session to retain access to the TTY. Pdeathsig (PR_SET_PDEATHSIG) does not require Setsid. An integration test for runWithoutReap is added to prevent regressions. Fixes rootless-containers#557 Signed-off-by: fahed dorgaa <fahed.dorgaa@gmail.com>
9733b6e to
8b6a623
Compare
ad75008
into
rootless-containers:master
27 of 31 checks passed
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.
Commit 2ca0537 added
Setsid=trueinrunWithoutReap()as part of the Pdeathsig implementation, but Pdeathsig doesn't actually need it.Setsidcreates a new session which detaches the child from the terminal, so bash loses its TTY and prints:This PR simply removes
Setsid=truefrom the non-reaping path. The reaping path (runAndReap) keeps it because it needs session isolation to reap zombie processes.Fixes #557