ctrl+z causes hang?
Whenever i start my computer up, the first program that i run hangs when i try to suspend it with ctrl+z.
So, for example: i boot up, log in, run the "yes" command, hit ctrl+z, and "yes" hangs, i have to go to tty2 and do a kill -9 on yes. after that i can suspend a job with no problem, but its really annoying if i forget because i'll start up X and run something like firefox from a terminal, then try to ctrl+z out of it(after a little browsing), and hang firefox. a fix would be nice, but i'm also just plain interested in finding out what's causing it. i think it may be something involving the kernel or sighup or something, but i really have no clue. i'm running a very fresh install of slackware 10.2 with the slackware bare.i kernel. any ideas? |
Hi,
ctrl-z is used to suspend programs, not to stop them. To resume the program after a ctrl-z use: fg ctrl-d can be used to stop programs (not all). man bash for details (Job Control section). Hope this clears things up. |
Ctrl-C is used to stop many programs. Ctrl-D is the end-of-file character, which tells things like the shell that it's done.
|
Shell job control 101. See man bash for details.
Sending Ctrl-Z suspends a job, "fg" continues it in foreground as posted already. "bg" continues it in the background (useful to keep firefox open while continuing typing commands in your terminal). Launching jobs with "&" afterwards should launch them directly in the background. ie try: firefox & instead of just firefox and you'll be able to continue working in your terminal (command line) and firefox is still started. I'd go with spooon's suggestions. Ctrl-D is typically used to close off input streams too. Try using: mail -s some_subject some_destination => this will start mail and allow you to type in the mail's body. => End the e-mail content with Ctrl-D. and voilą, the mail gets sent out... Similarly, try doing just: cat and stopping that with Ctrl-D, Ctrl-Z, etc and see what the difference really is. |
sorry about that, i mixed up stop and suspend. any ideas why the first program i run hangs when i try to suspend it?
|
Quote:
When you ctl-z a program, it suspends. It doesn't die, just sits around waiting for you to do something while you have a command prompt back. Are you getting the prompt, or does output of 'yes' stop and you get no prompt? If you have the prompt, does doing a 'bg' continue the process? Thx |
i don't get the prompt back. the program stops(in the case of "yes" it stops printing y), but i don't get the prompt back. thats why i have to switch to another tty in order to kill it.
|
All times are GMT -5. The time now is 04:15 AM. |