码迷,mamicode.com
首页 > 系统相关 > 详细

类linux系统/proc/sysrq-trigger文件功能作用

时间:2015-04-27 15:11:23      阅读:243      评论:0      收藏:0      [点我收藏+]

标签:

立即重启计算机      echo "b" > /proc/sysrq-trigger

立即关闭计算机      echo "o" > /proc/sysrq-trigger

导出内存分配的信息    echo "m"  > proc/sysrq-trigger        (可以用/var/log/message查看)Outputs memory statistics to the console

导出当前CPU寄存器信息和标志位的信息     echo "p"  > proc/sysrq-trigger       (outputs all flags and registers to the console)

导出线程状态信息        echo "t"  > proc/sysrq-trigger          (outputs a list of processes to the console)

故意让系统崩溃            echo "c"  > proc/sysrq-trigger         (crashes the system without first unmounting file systems or syncing disks attached to the system)

立即重新挂载所有的文件系统               echo "s"  > proc/sysrq-trigger     (attempts to sync disks attached to the system)

立即重新挂载所有的文件系统为只读     echo "u"  > proc/sysrq-trigger     (attempts to unmount and remount all file systems as read-only)

此外,还有两个类似于强制注销的功能

e ---- kills all processes except init using SIGTERM

i ---- kills all processes except init using SIGKILL

/proc/cmdline
dmesg | grep -i crash;
cat /proc/sys/kernel/sysrq
sysctl -w kernel.sysrq = 1;
echo c > /proc/sysrq-trigger

类linux系统/proc/sysrq-trigger文件功能作用

标签:

原文地址:http://www.cnblogs.com/ruiy/p/4460068.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!