/proc/sysrq-trigger详解
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://itnihao.blog.51cto.com/1741976/830374
https://www.kernel.org/doc/Documentation/sysrq.txt
# 立即重新启动计算机
echo "b" > /proc/sysrq-trigger # 立即关闭计算机
echo "o" > /proc/sysrq-trigger # 导出内存分配的信息 (可以用/var/log/message 查看)
echo "m" > /proc/sysrq-trigger # 导出当前CPU寄存器信息和标志位的信息
echo "p" > /proc/sysrq-trigger # 导出线程状态信息
echo "t" > /proc/sysrq-trigger # 故意让系统崩溃
echo "c" > /proc/sysrq-trigger # 立即重新挂载所有的文件系统
echo "s" > /proc/sysrq-trigger # 立即重新挂载所有的文件系统为只读
echo "u" > /proc/sysrq-trigger Documentation for sysrq.c Based on kernel version 2.6.. Page generated on -- : EST. Linux Magic System Request Key Hacks
Documentation for sysrq.c * What is the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It is a 'magical' key combo you can hit which the kernel will respond to
regardless of whatever else it is doing, unless it is completely locked up. * How do I enable the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when
configuring the kernel. When running a kernel with SysRq compiled in,
/proc/sys/kernel/sysrq controls the functions allowed to be invoked via
the SysRq key. By default the file contains which means that every
possible SysRq request is allowed (in older versions SysRq was disabled
by default, and you were required to specifically enable it at run-time
but this is not the case any more). Here is the list of possible values
in /proc/sys/kernel/sysrq:
- disable sysrq completely
- enable all functions of sysrq
> - bitmask of allowed sysrq functions (see below for detailed function
description):
- enable control of console logging level
- enable control of keyboard (SAK, unraw)
- enable debugging dumps of processes etc.
- enable sync command
- enable remount read-only
- enable signalling of processes (term, kill, oom-kill)
- allow reboot/poweroff
- allow nicing of all RT tasks You can set the value in the file by the following command:
echo "number" >/proc/sys/kernel/sysrq Note that the value of /proc/sys/kernel/sysrq influences only the invocation
via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
allowed (by a user with admin privileges). * How do I use the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On x86 - You press the key combo 'ALT-SysRq-<command key>'. Note - Some
keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is
also known as the 'Print Screen' key. Also some keyboards cannot
handle so many keys being pressed at the same time, so you might
have better luck with "press Alt", "press SysRq", "release SysRq",
"press <command key>", release everything. On SPARC - You press 'ALT-STOP-<command key>', I believe. On the serial console (PC style standard serial ports only) -
You send a BREAK, then within seconds a command key. Sending
BREAK twice is interpreted as a normal BREAK. On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,
Print Screen (or F13) - <command key> may suffice. On other - If you know of the key combos for other architectures, please
let me know so I can add them to this section. On all - write a character to /proc/sysrq-trigger. e.g.: echo t > /proc/sysrq-trigger * What are the 'command' keys?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'b' - Will immediately reboot the system without syncing or unmounting
your disks. 'c' - Will perform a system crash by a NULL pointer dereference. # 立即重新启动计算机
echo "b" > /proc/sysrq-trigger
# 立即关闭计算机
echo "o" > /proc/sysrq-trigger
# 导出内存分配的信息 (可以用/var/log/message 查看)
echo "m" > /proc/sysrq-trigger
# 导出当前CPU寄存器信息和标志位的信息
echo "p" > /proc/sysrq-trigger
# 导出线程状态信息
echo "t" > /proc/sysrq-trigger
# 故意让系统崩溃
echo "c" > /proc/sysrq-trigger
# 立即重新挂载所有的文件系统
echo "s" > /proc/sysrq-trigger
# 立即重新挂载所有的文件系统为只读
echo "u" > /proc/sysrq-trigger
/proc/sysrq-trigger详解的更多相关文章
- Atitit.设计模式-----触发器模式 trigger 详解
Atitit.设计模式-----触发器模式 trigger 详解 1. 触发器概念1 1.1. 触发器位置 after|before|instead of1 2. 数据库里面的触发器1 2.1. o ...
- ORACLE DB TRIGGER详解
本篇主要内容如下: 8.1 触发器类型 8.1.1 DML触发器 8.1.2 替代触发器 8.1.3 系统触发器 8.2 创建触发器 8.2.1 触发器触发次序 8.2.2 创建DML触发器 8.2. ...
- Android中proc/meminfo的详解(原)
今天在写到获取手机可用内存空间的总大小的时候,通过下面的方法去获取的时候,发现该方法最低支持的版本是16,这显然是不可取的. public static long getTotalSpace(Cont ...
- /proc/stat文件详解(翻译)
原文地址:http://www.linuxhowtos.org/System/procstat.htm 各种关于系统内核的活动信息都可以在/proc/stat文件中找到,该文件记录了自系统第一次启动以 ...
- mysql之触发器trigger 详解
为了梦想,努力奋斗! 追求卓越,成功就会在不经意间追上你 mysql之触发器trigger 触发器(trigger):监视某种情况,并触发某种操作. 触发器创建语法四要素:1.监视地点(table) ...
- Linux中目录proc/net/dev详解【转】
转自:https://blog.csdn.net/yzy1103203312/article/details/77848192 版权声明:本文为博主原创文章,未经博主允许不得转载. https://b ...
- linux下/proc/diskstats文件详解
每一列的含义分别为: 第一列为 设备号 (number of issued reads. This is the total number of reads completed successfull ...
- Linux中目录proc/net/dev详解
在Linux系统中,系统调用是操作系统提供给应用程序使用操作系统服务的重要接口,但同时也正是通过系统调用机制,操作系统屏蔽了用户直接访问系统内核的可能性.幸运的是Linux提供了LKM机制可以使我们在 ...
- /proc详解
内容摘要:Linux系统上的/proc目录是一种文件系统,即proc文件系统. Linux系统上的/proc目录是一种文件系统,即proc文件系统.与其它常见的文件系统不同的是,/proc是一种伪文件 ...
- 内存proc详解
Linux系统上的/proc目录是一种文件系统,即proc文件系统.与其它常见的文件系统不同的是,/proc是一种伪文件系统(也即虚拟文件系统),存储的是当前内核运行状态的一系列特殊文件,用户可以通过 ...
随机推荐
- 在Ubuntu下安装Apache
在Ubuntu下安装软件其实非常方便,Ubuntu提供了apt-get工具,可以使用该工具直接下载安装软件. 在Linux里,系统最高权限账户为root账户,而默认登录的账户并非root账户,例如不具 ...
- Fitnesse-20140630与RestFixture-3.1编译与运行步骤
为了能使RestFixture-3.1在Fitnesse-20140630中正确打印测试结果,准备修改RestFixture. 1.下载并编译Fitnesse-20140630 以下步骤以在64位Wi ...
- Visual Assist X 破解步骤
1. 下载VA安装包,并点击exe文件安装(附下载地址:http://down.51cto.com/data/766817) 2. 将Visual Assist X Patch文件复制到C:\User ...
- Hello, Github Blog
hello, I am using github to write a post, I am so exciting- 原文地址: http://vblog.vell001.ml/2014/03/08 ...
- 在WinForm编程中犯的一些错误
1.一直以为,MouseClick事件在鼠标点击时发生,MouseDoubleClick事件在鼠标双击时发生.那么在单击鼠标时会调用MouseClick事件处理程序,双击鼠标时会调用MouseDoub ...
- 【移动开发】安卓Lab2(01)
本次Lab需要用到Google Map的API,分享学习一下Google Map的知识 需求: 界面: 1. 主界面(map界面): 提供了指定的学校校园地图图片,不能用Google的API生成图片 ...
- Codeforces 380 简要题解
ABC见上一篇. 感觉这场比赛很有数学气息. D: 显然必须要贴着之前的人坐下. 首先考虑没有限制的方案数.就是2n - 1(我们把1固定,其他的都只有两种方案,放完后长度为n) 我们发现对于一个限制 ...
- caldera
Caldera International星期一宣布将公司名称变更为SCO Group,交易代码则改为SCOX,希望SCO可以在客户群当中建立更好的品牌认同. Caldera除了有自己的Linux版本 ...
- LNMP最新源码安装脚本(定期更新)
Linux+Nginx+MySQL+PHP+Pureftpd+User manager for PureFTPd,脚本中用到的软件包大多最新版本,修复了User manager for PureFTP ...
- HDU1973 http://acm.hdu.edu.cn/showproblem.php?pid=1973
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<queue> #inc ...