proc之sysrq-trigger
一直想花点时间细研究下proc下的各个文件,结果确一直没做,只是零星的在做其他事情是了解到/proc下某个文件的功能,每每了解到都感叹/proc的精妙。sysrq-trgger也一样,这是在研究kdump时的一个副产品。
<br />
<div style="font-family:Arial;font-size:14px;line-height:26px;white-space:normal;background-color:#FFFFFF;">
/proc/sysrq-trigger该文件能做些什么事情呢? <br />
立即重新启动计算机 (Reboots the kernel without first unmounting file systems or syncing disks attached to the system)
echo “b” > /proc/sysrq-trigger
立即关闭计算机(shuts off the system)
echo “o” > /proc/sysrq-trigger
导出内存分配的信息 (可以用/var/log/message 查看)(Outputs memory statistics to the console)
echo “m” > /proc/sysrq-trigger
导出当前CPU寄存器信息和标志位的信息(Outputs all flags and registers to the console)
echo “p” > /proc/sysrq-trigger
导出线程状态信息 (Outputs a list of processes to the console)
echo “t” > /proc/sysrq-trigger
故意让系统崩溃 ( Crashes the system without first unmounting file systems or syncing disks attached to the system)
echo “c” > /proc/sysrq-trigger
立即重新挂载所有的文件系统 (Attempts to sync disks attached to the system)
echo “s” > /proc/sysrq-trigger
立即重新挂载所有的文件系统为只读 (Attempts to unmount and remount all file systems as read-only)
echo “u” > /proc/sysrq-trigger
#启动kgdb调试
echo g > /proc/sysrq-trigger 呵呵,此外还有两个,类似于强制注销的功能
e — Kills all processes except init using SIGTERM
i — Kills all processes except init using SIGKILL
捐赠本站(Donate)
如您感觉文章有用,可扫码捐赠本站!(If the article useful, you can scan the QR code to donate))
- Author: shisekong
- Link: https://blog.361way.com/proc-sysrq-trigger/3776.html
- License: This work is under a 知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议. Kindly fulfill the requirements of the aforementioned License when adapting or creating a derivative of this work.