原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。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详解的更多相关文章

  1. Atitit.设计模式-----触发器模式 trigger  详解

    Atitit.设计模式-----触发器模式 trigger  详解 1. 触发器概念1 1.1. 触发器位置 after|before|instead of1 2. 数据库里面的触发器1 2.1. o ...

  2. 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. ...

  3. Android中proc/meminfo的详解(原)

    今天在写到获取手机可用内存空间的总大小的时候,通过下面的方法去获取的时候,发现该方法最低支持的版本是16,这显然是不可取的. public static long getTotalSpace(Cont ...

  4. /proc/stat文件详解(翻译)

    原文地址:http://www.linuxhowtos.org/System/procstat.htm 各种关于系统内核的活动信息都可以在/proc/stat文件中找到,该文件记录了自系统第一次启动以 ...

  5. mysql之触发器trigger 详解

    为了梦想,努力奋斗! 追求卓越,成功就会在不经意间追上你 mysql之触发器trigger 触发器(trigger):监视某种情况,并触发某种操作. 触发器创建语法四要素:1.监视地点(table)  ...

  6. Linux中目录proc/net/dev详解【转】

    转自:https://blog.csdn.net/yzy1103203312/article/details/77848192 版权声明:本文为博主原创文章,未经博主允许不得转载. https://b ...

  7. linux下/proc/diskstats文件详解

    每一列的含义分别为: 第一列为 设备号 (number of issued reads. This is the total number of reads completed successfull ...

  8. Linux中目录proc/net/dev详解

    在Linux系统中,系统调用是操作系统提供给应用程序使用操作系统服务的重要接口,但同时也正是通过系统调用机制,操作系统屏蔽了用户直接访问系统内核的可能性.幸运的是Linux提供了LKM机制可以使我们在 ...

  9. /proc详解

    内容摘要:Linux系统上的/proc目录是一种文件系统,即proc文件系统. Linux系统上的/proc目录是一种文件系统,即proc文件系统.与其它常见的文件系统不同的是,/proc是一种伪文件 ...

  10. 内存proc详解

    Linux系统上的/proc目录是一种文件系统,即proc文件系统.与其它常见的文件系统不同的是,/proc是一种伪文件系统(也即虚拟文件系统),存储的是当前内核运行状态的一系列特殊文件,用户可以通过 ...

随机推荐

  1. Launcher2编译

    Android的源码包,压缩文件大概有3个G左右,要使用其中自带的一些源码需要很多技巧,否则会提示找不到一些库,大量的报错让人心神不定,不知所从. 我拿桌面代码举个例子吧. 桌面代码在源码包的pack ...

  2. 学习Python编程的11个资源

    用 Python 写代码并不难,事实上,它一直以来都是被声称为最容易学习的编程语言.如果你正打算学习 web 开发,Python 是一个不错的选择,甚至你想学游戏开发也可 以从 Python 开始,因 ...

  3. CSS基础(背景、文本、列表、表格、轮廓)

    CSS 背景属性 属性 描述 background 简写属性,作用是将背景属性设置在一个声明中. background-attachment 背景图像是否固定或者随着页面的其余部分滚动. backgr ...

  4. 新建虚拟目录使用UNC共享文件夹(即:虚拟目录使用UNC共享文件夹)的方法 -摘自网络

    新建虚拟目录使用UNC共享文件夹(即:虚拟目录使用UNC共享文件夹)的方法1.UNC路径:\\192.168.1.2\test\,假设连接该UNC路径的用户名为:web,密码为:123 2.在原web ...

  5. sonar 代码质量管理平台

    1) 下载    从sonar官网http://www.sonarsource.org/下载 (版本当然是最新的了)   在官网上是不分系统的,一个zip包,下下来之后,包里包含 windows .l ...

  6. Nginx 工作原理和优化、漏洞

    1.  Nginx的模块与工作原理 Nginx由内核和模块组成,其中,内核的设计非常微小和简洁,完成的工作也非常简单,仅仅通过查找配置文件将客户端请求映射到一个location block(locat ...

  7. 第二百四十天 how can I 坚持

    在家待了一天,晚上出去买了个帽子,还有买了点排骨炖着吃了... 玩了好多局游戏. 想搞个直播,不知道能不能玩的起来. 水平太菜了,明天去小米之家玩玩. 睡觉.

  8. java多线程中的volatile和synchronized

    package com.chzhao; public class Volatiletest extends Thread { private static int count = 0; public ...

  9. sql 调用函数的方法

    USE [ChangHong_612]GO/****** Object: StoredProcedure [dbo].[st_MES_RptInspectWeight] Script Date: 09 ...

  10. 基于linux 的2048

    在 debian 下写了一个 2048, 效果如下: 感兴趣的朋友可以在这里(http://download.csdn.net/download/kamsau/7330933)下载. 版权声明:本文为 ...