O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



Kernel sys requests
Send commands to the kernel when the kernel panics or other desperate situations

Contributed by:
dom2319
[01/07/05 | Discuss (0) | Link to this hack]

OK I know this is near common knowlegde but given their usefullness, I felt that those hacks should be included in the book "linux server hacks" As well given that I saw that on: http://www-106.ibm.com/developerworks/linux/library/l-magic.html Full credit ought to go to Tom Gall. If you are working with the development kernel or device drivers, or running code that could cause your machine to kernel panic, you'll want this tip. This tip works on Linux with x86, PowerPC, or SPARC processors, and you need to be at least in the 2.2.x or above series of kernels. If your machine should panic, or seem suddenly to turn into a molten heap of parts, you can, via a key combination, sync your file system and remount your file systems to read-only. On the following reboot, you'll avoid a potentially lengthy fsck. The key combinations are a little different from platform to platform: x86 ALT-SYSRQ-[command key] SPARC ALT-STOP-[command key] PowerPC ALT-Print Screen-[command key] The command keys are as follows: s Attempts to sync all mounted file systems u Attempts to remount all mounted file systems to read-only b Attempts to immediately reboot your system (This is effectively like hitting the reset switch or power button on your box; processes will not be given the chance to shut down.) p Prints the current set of registers and flags to the console t Prints the list of current tasks and related information to the console e Sends a SIGTERM to all processes, with the exception of init i Sends a SIGKILL to all processes, with the exception of init l Sends a SIGKILL to all processes


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.