Conversation
Required otherwise a new login shell won't get controlling TTY and thus signals don't work.
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.
Fixes various problems with the ELKS kernel and
sashnot working when a process is stopped via the terminal using ^Z (SIGTSTP).Discovered in #2506 (comment).
Previously, when the VSUSP character was typed (default ^Z), the process was stopped but any waiting processes (e.g. the shell) weren't awakened, so the system appeared hung.
It was also found that
sashwas hanging in awaitpidloop waiting for the last job to complete which looped forever when a process was stopped, a separate problem. Thewaitpidsyscall was waiting for stopped jobs, which is only supposed to happen when the WUNTRACED option is passed, so this was fixed too.Finally, when a stopped job's parent died (e.g. the shell was exited after stopping a process), the stopped child process was not releasing its TTY group or session. This prevented the new shell from becoming a process group leader, which led to ^C or ^Z signals not working when typed.
This took awhile to get right, and I'm still wondering what the difference between a process session and a process group is.
It was also learned that one can't
killa stopped job with anything other than SIGCONT (8, to continue), or SIGKILL (9, to force exit). Since theashshell is not currently configured for jobs support (for size reasons), andsashdoesn't support them, usingkill -8is the only way to continue a stopped job, for now.