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

linux下/proc/sysrq-trigger文件的功能

时间:2015-10-12 19:19:34      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:

/proc/sysrq-trigger该文件能做些什么事情呢? 

# 立即重新启动计算机 (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

呵呵,此外还有两个,类似于强制注销的功能
e
 — Kills all processes except init using SIGTERM

i
 — Kills all processes except init using SIGKILL

linux下/proc/sysrq-trigger文件的功能

标签:

原文地址:http://www.cnblogs.com/playboysnow/p/4872415.html

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