-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shell gets killed by the kernel #20
Comments
Yep, that's... well maybe expected is the wrong term. But it makes sense that it's happening. Here's my transcript:
Notice that I was able to use the bash command This has to do with job control. Normally shells create a "process group" and execute their children within those groups. They also send signals to their child tasks to stop them and resume them. I'd recommend doing some googling about "job control" and "process groups" related to linux/unix shells. |
Well first of all, I'm glad you are recognizing this behavior as expected ! Because I've create a stackoverflow post about this issue and nearly every one got confused. Except one comment that said : "When a background process reads from the terminal it gets a SIGTTIN signal. Normally, that will stop it, the job control shell notices and tells the user, who can say fg to continue this background process as a foreground process, and then this process can read from the terminal." This was the precise moment I knew I was in trouble and I won't be able to continue if I don't understand this part... We have to play with pipes, dup2 function, etc.. Now, I'm not exactly sure why it behaves like that and sure enough it has to do with job control. But since I'm looking for a concrete answer and I've spend my whole day trying to understand the issue, you seems to be the only guy who can explain this to me like a little child. A little update on this subject on your blog would help many people out here :) |
Interestingly, the echo command doesn't cause the job to be stopped:
I thought maybe it was a built-in command, but it's not: I'm none the wiser why date behaves one way, echo the other. |
Out of interest, what's the link @Bodanor ? |
Hi,
If you run the command
bash -ic <some_command>
the shell gets stopped. Not sure why though, I'm running in the same issue with mine ;(The text was updated successfully, but these errors were encountered: