Tuesday, July 12, 2011

/proc/sysrq-trigger the file can do things?

# Restart the computer (Reboots the kernel without first unmounting file systems or syncing disks attached to the system) 
echo "b"> / proc / sysrq-trigger
# Immediately shut down the computer (shuts off the system) 
echo "o"> / proc / sysrq-trigger
# Export the memory allocation information (you can use / var / log / message view) (Outputs memory statistics to the console) 
echo "m"> / proc / sysrq-trigger
# Export the current CPU registers and flag bits of information (Outputs all flags and registers to the console) 
echo "p"> / proc / sysrq-trigger
# Export the thread state information (Outputs a list of processes to the console) 
echo "t"> / proc / sysrq-trigger
# Deliberately crash (Crashes the system without first unmounting file systems or syncing disks attached to the system) 
echo "c"> / proc / sysrq-trigger
# Immediately re-mount all file systems (Attempts to sync disks attached to the system) 
echo "s"> / proc / sysrq-trigger
# Immediately re-mount all the file system is read-only (Attempts to unmount and remount all file systems as read-only) 
echo "u"> / proc / sysrq-trigger
Oh, in addition to two, similar to the forced cancellation feature e - Kills all processes except init using SIGTERM i - Kills all processes except init using SIGKILL