LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux equivalent of CTRL-ALT-DEL in Windows? (http://www.linuxquestions.org/questions/linux-newbie-8/linux-equivalent-of-ctrl-alt-del-in-windows-127111/)

ryancw 12-18-2003 10:05 PM

Linux equivalent of CTRL-ALT-DEL in Windows?
 
When in Win98 on my Dell Dimension, I have become all too familiar with the CTRL-ALT-DEL key combination as the last refuge of scoundrels. When everything going to pieces and all is frozen, one can (most times) bail out with CTRL-ALT-DEL, bringing up a dialog box to shut down applications, or to reboot the computer. Rarely, even that doesn't work and I just have to turn off the power, then turn it back on again, and wait for scandisk to do its thing.

Now I have a dual-boot system, Libranet linux 2.8.1 on the linux partition. I know linux is legendary for its stability and lack of need for reboots. But I'm curious: if one *really* gets into trouble on Linux and needs to "bail out," what are the options? In other words, what is the equivalent of CTRL-ALT-DEL? And the equivalent of turning off the power? (I assume just turning off the power switch is a bad idea, but what would happen if you did?)

Thanks.

Brother Michael 12-18-2003 10:06 PM

I know all to well of what you are refering too.

What window manager are you using? KDE? Gnome? other?

Mike

ryancw 12-18-2003 10:15 PM

Well, it appears I am using some version of IceWM, I think with slight Libranet-specific modifications.

Brother Michael 12-18-2003 10:21 PM

Crap, I am not fimilar with Libranet or IceWM...umm someone else want to take this with IceWM? Look through help files, look in find files search the forum do something but look for something like "Force Quit"

Mike

Demonbane 12-18-2003 10:31 PM

In most cases, even if your X session is totally screwed you should still be able to go in one of the virtual consoles (CTRL+F1-6 by default) and kill the offending process, or CTRL+BACKSPACE to force X to shutdown. Unlike Windows, it is very unlikely that a crash in user space application can bring down the whole system along with it *cough* explorer *cough*.

koyi 12-18-2003 10:34 PM

I think when a single program hangs in linux, the system is most probably still running stablely in the background, so what u need to do is just to open another terminal window, i.e. xterm, and type in the command "$ ps -aux" to list the names of all running programs...

if you know the name of the program, type "$ps -aux | grep program-name" instead to ease the hassle of looking for the hanged program. When you found the name of the hanged program, there is a process id associated with it. Just type "$ kill process-id" to stop the hanged program. But be aware not to kill certain important programs.

If the window manager itself hangs(I havent met this before...), press "Ctrl-Alt-F<n>" where <n> is a number from 1 to 6 usually to bring out the text-based login prompt. Log in and do the above.

ryancw 12-18-2003 10:52 PM

OK, I think that bit about how to get a terminal window no matter what else is happening is very useful. Didn't know that. As a corollary: once I have the terminal window, what command will shut down the entire computer and turn it off (gracefully)?

Kristijan 12-18-2003 11:58 PM

Code:

man shutdown
Code:

shutdown -h now
will halt the PC after shutdown

Code:

shutdown -r now
will reboot the PC after shutdown

As above, man shutdown for more detailed options.

Demonbane 12-19-2003 12:00 AM

try /sbin/poweroff
or /sbin/shutdown -h

/sbin/reboot to reboot

LinuxLala 12-19-2003 06:52 AM

In most distros and window managers, Cntrl+Escape is the equivalent of Alt+cntrl+del in windows.

Select the process or program you want to kill and that's it!

LinuxLala 12-19-2003 06:55 AM

What actually happens when you type shutdown -h now is that yor runlevel changes to init 6.

Similarly when you type shutdown -r now, your runlevel changes to init 6.

So you can simply type init 0 or init 6 as per ur need.

ryancw 02-19-2004 09:42 PM

OK, I'm getting some more experience with this "mayday" shutdown stuff.

Running Libranet 2.8.1.

I created user accounts for all my kids, and now they like to play with Tuxpaint (a drawing program), and they have all put images on their desktop backgrounds, and they like to run xpenguins, which makes little penguins roam all over the screen, no matter what else you are doing. I don't know if these are standard Linux things, or if they are unique to Libranet. (Libranet is Debian-based, as I understand it.)

Anyway, if all those things are running, and they go to logout, the whole system hangs. Logout does not progress to conclusion. No buttons respond to mouse clicks. CPU load monitor goes basically to zero. But tuxpaint and the little penguins keep right on going. CTRL-F1 (or -F2, or F-anything) does not open up a terminal window. CTRL-backspace and CTRL-escape do nothing.

I can right-click on the desktop and get a popup menu, that lets me open a terminal window. I can kill some processes, but others seem to survive the kill command and reappear with my next ps command. When I type shutdown now, or shutdown -h now, in that terminal, I am told that shutdown command does not exist. If I type /sbin/shutdown now, I am told I must be root to do that. Switching to root and then doing /sbin/shutdown now gets me logged out, but I can't be letting all the kids have the root password.

So my two questions: Why does my system hang/freeze like that? And I still need a foolproof, reliable way of extricating myself, as a simple user (not root) from this situation.

I will post this to Libranet forum too, of course.

Thanks.

Rick485 02-19-2004 10:09 PM

I also use Red Hat 9 although I use Gnome instead. On both of my computers, X-Windows can be shut down by pressing <CTRL><ALT><BACKSPACE>. I hold down <CTRL><ALT> simultaneously and then at the same time I press the <BACKSPACE> key once. Gnome and X-Windows will then be shut down in a rather forefull manner. At that point I find myself in the text mode and am still able to use command line commands. If that works you will most likely find that Linux is still working fine but that your problem had only been a problem with running something under X-Windows.

At that point you can restart X-Windows and your window manager by typeing startx. It will most likely be working OK at that point. I should add that I have very rarely found it necessary to do that.

globeTrotter 02-19-2004 10:13 PM

hi

i can't answer all your questions, but i hope this helps. if you lock up the keystrokes are
<Ctrl>+<Alt>+<F1> . you can use F1, etc to F6, you have 6 virtual terminals at your disposal. all can be in use at the same time doing diffrent stuff, by different peole, if you like the command line that much, most don't. i'm half and half. anyway to get back, press <Alt>+<F7>. if
kill processnumber
doesnt work, try
kill -9 processnumber
this should kill it outright, as a last resort, use
kill -KILL processnumber
because the -KILL option is fairly destructive, as in, it doesn't give a process any chance to close open files or network connections, as it closes them forcefully. you should use it sparingly, but effectively.

the issue of why
shutdown - h now
doesnt work sometimes is because you logged on as a normal user, then presumably used su to become root. this only opens a sub-shell within the normal user shell. so you have to give the
/sbin/shutdown -h now
command instead. if you log on as root initially,
shutdown - h now
will suffice. i hope this was of help
regards
GT

Rick485 02-19-2004 10:25 PM

I misread which distro you were using, although most of these kinds are not disto specific. Two of the commands that you mentioned can only be run when logged in as root. GlobeTrotter makes a good point about needing to use the su commnand to temporarily gain root priveledges.

Do all keyboard commands still work in that situation? If so then knowing all the keyboard shortcuts might be helpfull. Your window manager can probably be run without the help of a mouse. A couple of weeks ago I had an occasional, hard to track down hardware problem with my mouse (it was half unplugged). I had to figure out how to run nearly everything in Gnome without the help of a mouse. The mouse problem is now fixed.


All times are GMT -5. The time now is 08:08 PM.