LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-18-2003, 09:05 PM   #1
ryancw
LQ Newbie
 
Registered: Aug 2003
Distribution: Red Hat 9
Posts: 25

Rep: Reputation: 15
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.
 
Old 12-18-2003, 09:06 PM   #2
Brother Michael
Member
 
Registered: Aug 2003
Location: Columbus, Ohio
Distribution: Debian
Posts: 284

Rep: Reputation: 30
I know all to well of what you are refering too.

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

Mike
 
Old 12-18-2003, 09:15 PM   #3
ryancw
LQ Newbie
 
Registered: Aug 2003
Distribution: Red Hat 9
Posts: 25

Original Poster
Rep: Reputation: 15
Well, it appears I am using some version of IceWM, I think with slight Libranet-specific modifications.
 
Old 12-18-2003, 09:21 PM   #4
Brother Michael
Member
 
Registered: Aug 2003
Location: Columbus, Ohio
Distribution: Debian
Posts: 284

Rep: Reputation: 30
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
 
Old 12-18-2003, 09:31 PM   #5
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
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*.
 
Old 12-18-2003, 09:34 PM   #6
koyi
Member
 
Registered: Jul 2003
Location: Osaka, Japan
Distribution: Arch, Ubuntu
Posts: 421

Rep: Reputation: 31
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.
 
Old 12-18-2003, 09:52 PM   #7
ryancw
LQ Newbie
 
Registered: Aug 2003
Distribution: Red Hat 9
Posts: 25

Original Poster
Rep: Reputation: 15
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)?
 
Old 12-18-2003, 10:58 PM   #8
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
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.

Last edited by Kristijan; 12-18-2003 at 11:01 PM.
 
Old 12-18-2003, 11:00 PM   #9
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
try /sbin/poweroff
or /sbin/shutdown -h

/sbin/reboot to reboot
 
Old 12-19-2003, 05:52 AM   #10
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
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!
 
Old 12-19-2003, 05:55 AM   #11
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
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.
 
Old 02-19-2004, 08:42 PM   #12
ryancw
LQ Newbie
 
Registered: Aug 2003
Distribution: Red Hat 9
Posts: 25

Original Poster
Rep: Reputation: 15
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.
 
Old 02-19-2004, 09:09 PM   #13
Rick485
Member
 
Registered: Sep 2003
Location: Arizona
Distribution: Kubuntu 8.04
Posts: 202

Rep: Reputation: 30
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.
 
Old 02-19-2004, 09:13 PM   #14
globeTrotter
Member
 
Registered: Feb 2004
Location: Townsville, Queensland, Oz
Distribution: Red Hat 9
Posts: 107

Rep: Reputation: 15
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
 
Old 02-19-2004, 09:25 PM   #15
Rick485
Member
 
Registered: Sep 2003
Location: Arizona
Distribution: Kubuntu 8.04
Posts: 202

Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CTRL+ALT+DEL Equivalent? m3s3lf Linux - Newbie 15 11-06-2004 10:31 PM
How to make Alt+Ctrl+DEL work in linux Boffy Linux - General 6 08-15-2004 06:32 AM
ctrl+alt+del for linux? webazoid Linux - Software 9 06-30-2004 11:19 PM
Sending CTRL-ALT-DEL to a Windows 2000 box using VNC from Linux scottpioso Linux - Newbie 1 03-04-2003 03:27 PM
ctrl, alt, del in Linux psyklops Linux - General 5 04-23-2002 06:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration