# Don't hit the power button if Linux freezes up!



## lotuseclat79 (Sep 12, 2003)

For most all Linux except Slackware (as I understand it). It depends on options the kernel is compiled with to implement the functionality in the kernel.

Fix a Frozen System with the Magic SysRq Keys.

More info: Magic SysRq key.

Remember the key sequence: REISUB [what each keystroke does]:
1. Alt + SysRq + R - takes the keyboard out of raw mode.
2. Alt + SysRq + E - terminates all processes (except init).
3. Alt + SysRq + I - kills all processes (except init).
4. Alt + SysRq + S - synchronizes the disk.
5. Alt + SysRq + U - remounts all filesystems read-only.
6. Alt + SysRq + B - reboots the machine.

in other words:

R gives back control of the keyboard
E sends all processes but init the term singal
I sends all processes but init the kill signal
S issues a sync
U mounts all filesystem ro to prevent a fsck at reboot
B reboots the system

Note: REISUB is the word busier in reverse.

Mnemonics to remember the key sequence: REISUB
1) Raising Elephants Is So Utterly Boring, or
2) Raping Elephants Is So Utterly Bonkers

-- Tom

P.S. Depending on keyboard layout, some are easier to do than others.


----------



## lotuseclat79 (Sep 12, 2003)

If you don't have a '1' in the file /proc/sys/kernel/sysrq then the magic functions will not be Enabled! If it has 0, Alt-SysRq just returns you to the previous console you were using.

Ref: Magic Sysrq.

-- Tom

P.S. My file (from Ubuntu 8.04 LTS (Hardy Heron) was empty (0 length).


----------



## namenotfound (Apr 30, 2005)

I usually just click the "force quite" button, and use it to close whatever program is making it freeze :-D


----------



## lotuseclat79 (Sep 12, 2003)

Hi namenotfound,

Ok, so you are running a MacBook Pro - what OS? Note: this is a Unix/Linux forum, so, even though OS X is derived from Unix, a force quit button is usually not available on either Unix or Linux afaik.

It is easy to force a quit with either Unix or Linux if you know the process id associated with an application: just key in: kill -9 <pid>

This thread is not about application freeze up - it is about safely rebooting a system that otherwise freezes up, and there is a safer way to reboot the system other than the tried and true: Cntrl-Alt-Del key sequence.

-- Tom


----------



## namenotfound (Apr 30, 2005)

Yes I know what forum this is (and I own more than 1 computer).

I run Ubuntu Linux on a Gateway notebook computer. On Ubuntu, there is a "force quit" button that you can add to the panel.

I click on the button, then click on a program window, then confirm.

And usually, just quitting the program that's causing the computer to freeze, solves the problem. Before I discovered the button in my "add to panel" options, I did this with command line in the Terminal. But having the button makes it easier.

Besides Ubuntu, I've also used Xubuntu, Kubuntu, Puppy, Fedora, and Solaris which are all UNIX based Operating Systems, and all (except for Solaris, I think) are a distribution of Linux


----------



## lotuseclat79 (Sep 12, 2003)

Hi namenotfound,

Does the force-quit button yield a list of process-ids similar to Windows task manager that lists programs running? How do you know which application is freezing up when everything goes South, and thus which application to select to force the quit from?

-- Tom

P.S. I did not know about this feature - I'll look into it now that you mention it.

P.P.S. This thread is still about system level freeze ups which may have nothing to do with application freeze ups.


----------



## namenotfound (Apr 30, 2005)

In the first screen shot, notice the black rectangle next to the trash at the top? That lists all the processes, and you can "end process" from there. It also provides other information about the computer. (it's called the "system monitor")

When you have the visual effects set to "normal" or better (as opposed to "none"), the program that is causing the freeze will turn gray. You can tell which program is causing the freeze because it's a different color from the other windows.


----------



## phatfred (Oct 6, 2007)

namenotfound said:


> I run Ubuntu Linux on a Gateway notebook computer. On Ubuntu, there is a "force quit" button that you can add to the panel.


I've seen that button available for the pannel before but had no idea what it did. That's great. I used to open a terminal and type 'ps aux | grep <appname>' to get the PID and then kill it from the terminal.

I think it may be available in any distro that is using Gnome as I'm running Mandriva and it too is available for me.


----------



## lotuseclat79 (Sep 12, 2003)

Hi namenotfound & phatfred,

You might just run into a situation when Force Quit is not enough to help you out of your quandry - that is when you should use the techniques about which this thread is all about.

To help yourselves in such a situation, you should save and print out the information about the Magic SysRq Keys. Failing that, you could always push the power button on your computer, but not be able to guarantee that your system is safe.

-- Tom


----------

