Linux 卡死的正确解决方式

19 views
Skip to first unread message

Chase Zhang

unread,
Mar 14, 2014, 2:10:09 PM3/14/14
to xidian_linux
如果是Windows用的熟练的同学可能会下意识地ctrl + shift + delete。这在 Linux下面显然是无效的咯。那么除了强制关闭电源,一般的正确解决方案是什么呢?




说实在的。。。确实是麻烦了点。。。。

刘雨齐

unread,
Mar 14, 2014, 2:53:49 PM3/14/14
to xidian...@googlegroups.com
歪个楼,在键盘中断handler程序里加入类似这种功能的语句:

            /* Reboot if Ctrl+Alt+Del pressed. */
          if (c == 0177 && ctrl && alt)
            shutdown_reboot ();

编译然后重启,然后ctrl+alt+del,结果要么是喜剧,要么是悲剧,要么是之前的几个小时什么也没有发生过。。。


--
您收到此邮件是因为您订阅了“西电开源社区”邮件列表。
要向此邮件列表发帖,请发送电子邮件至 xidian...@googlegroups.com
要取消订阅,请发送电子邮件至 xidian_linux...@googlegroups.com
请通过 https://groups.google.com/group/xidian_linux?hl=zh-CN 访问此网上论坛。
通过 [ipv6 enabled] http://xdlinux.info/http://xdl.in/
[ipv4 only] http://linux.xidian.edu.cn/
[手机]:http://m.xdlinux.info/
访问西电开源社区。
---
您收到此邮件是因为您订阅了Google网上论坛中的“西电开源社区邮件列表”论坛。
要取消订阅此论坛,并停止接收其发来的电子邮件,请发送电子邮件至xidian_linux...@googlegroups.com
如需了解更多选项,请访问https://groups.google.com/d/optout



--
Best Regards!
Yuqi Liu (刘雨齐),
M.S. Student in Computer Science,
University of Delaware.

xidian lz

unread,
Mar 14, 2014, 3:16:02 PM3/14/14
to xidian...@googlegroups.com
一般可以按crtl+shift+f1进到终端去,之后kill掉让你假死的程序就好 =-=
之后ctrl + shift + f7回来就好
Best regards,
xidianlz

Wisatbff Li

unread,
Mar 14, 2014, 9:41:14 PM3/14/14
to xidian...@googlegroups.com
以前好像出现过锁屏回来之后内存占用特别高的情况,swap也是满的。后来刻意锁屏想看看是哪个进程的问题,再没出现过。。

在 14/3/15,xidian lz<xidi...@gmail.com> 写道:
> 您收到此邮件是因为您订阅了 Google 网上论坛的“西电开源社区邮件列表”论坛。
> 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到 xidian_linux...@googlegroups.com
> 要查看更多选项,请访问 https://groups.google.com/d/optout
>

lzt

unread,
Mar 14, 2014, 11:19:28 PM3/14/14
to xidian...@googlegroups.com
楼主所指的可是 Ctrl+Alt+SysRq + reisub 大法?
>>> 要取消订阅此论坛,并停止接收其发来的电子邮件,请发送电子邮件至xidian_linux+unsub...@googlegroups.com
>>> 如需了解更多选项,请访问https://groups.google.com/d/optout
>>>
>>
>>
>>
>> --
>> Best Regards!
>> Yuqi Liu (刘雨齐),
>> M.S. Student in Computer Science,
>> University of Delaware.
>>
>> --
>> 您收到此邮件是因为您订阅了“西电开源社区”邮件列表。
>> 要向此邮件列表发帖,请发送电子邮件至 xidian...@googlegroups.com
>> 要取消订阅,请发送电子邮件至 xidian_linux...@googlegroups.com
>> 请通过 https://groups.google.com/group/xidian_linux?hl=zh-CN 访问此网上论坛。
>> 通过 [ipv6 enabled] http://xdlinux.info/http://xdl.in/
>> [ipv4 only] http://linux.xidian.edu.cn/
>> [手机]:http://m.xdlinux.info/
>> 访问西电开源社区。
>> ---
>> 您收到此邮件是因为您订阅了Google网上论坛中的“西电开源社区邮件列表”论坛。
>> 要取消订阅此论坛,并停止接收其发来的电子邮件,请发送电子邮件至xidian_linux+unsub...@googlegroups.com
>> 如需了解更多选项,请访问https://groups.google.com/d/optout
>>
>
>
>
> --
> Best regards,
> xidianlz

lzt

unread,
Mar 14, 2014, 11:27:03 PM3/14/14
to xidian...@googlegroups.com

在比较早期,linux还很保守的时候,很多发行版都不会把这个功能编译到内核中。

后来一些比较激进的发行版的出现,以及大家都开始和chrome彪版本号以后,这个功能已经默认在内核里面了。

这个功能是linux系统以稳健著称的一个原因。只要内核不跑飞了,整个系统就还能回来。某些系统只要一个小程序挂掉了,就有可能把图画界面甚至整个系统挂掉。

转自wiki

Uses

A common use of the magic SysRq key is to perform a safe reboot of a Linux computer which has otherwise locked up. This can prevent a fsck being required on reboot and gives some programs a chance to save emergency backups of unsaved work.[4] The QWERTY (or AZERTY) mnemonics: "Raising Elephants Is So Utterly Boring", "Reboot Even If System Utterly Broken" or simply the word "BUSIER" read backwards, are often used to remember the following Sysrq-keys sequence:

unRaw      (take control of keyboard back from X),
 tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
 kIll      (send SIGKILL to all processes, forcing them to terminate immediately),
  Sync     (flush data to disk),
  Unmount  (remount all filesystems read-only),
reBoot.
  1. Hold down the Alt and SysRq (Print Screen) keys.
  2. While holding those down, type the following keys in order, several seconds apart: REISUB
  3. Computer should reboot.

In practice, each command may require a few seconds to complete, especially if feedback is unavailable from the screen due to a freeze or display corruption.

When magic SysRq keys are used to kill a frozen graphical program, the program has no chance to restore text mode. This can make everything unreadable. The commands textmode (part of SVGAlib) and reset can restore text mode and make the console readable again.

On distributions that do not include a textmode executable, the key command 'Ctrl'+'Alt'+'F1' may sometimes to force a return to a text console. (Use 'F1', 'F2', 'F3', ..., 'F(n)', where 'n' is the highest number of text consoles set up by the distribution. 'Ctrl'+'Alt'+ 'F(n+1)' would normally be used to reenter GUI mode on a system on which the X server has not crashed.)

使用的时候要激活这个按键

echo 1 > /proc/sys/kernel/sysrq

具体内容可以参考wiki:http://en.wikipedia.org/wiki/Magic_SysRq_key
Reply all
Reply to author
Forward
0 new messages