[wishlist] sysrq enhancements (more actions)

Bug #118882 reported by RichardNeill
2
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Confirmed
Wishlist
Unassigned

Bug Description

Summary:

Alt-SysRQ-[X] functions are extremely useful, however they are sometimes insufficient. I'd like to add a few more options, either pre-defined, or user-configurable.

Motivation:

I have several times encountered serious problems that could be repaired, without serious dataloss, but where I ended up having to reset the computer, because there was no way to get an emergency root login. This enhancement would solve that problem; it might also be rather useful for getting / saving diagnostics. Examples where this would be useful:

 * Xserver crash (eg the wretched fglrx) going to 100% CPU. We could then a)do some diagnostics on the hung process. b)shut down relatively gracefully c)try to save data where possible, for example killing emacs would make it autosave, and cat /dev/mem > memdump.dat would give us some hope later of retrieving the long email we were in the middle of writing.

* Runaway processes eg a "fork bomb" or something which is rapidly leaking memory could be terminated. Likewise, anything that is using up so much I/O that it takes ages to actually start the root shell.

* Failing disk: one part of the drive becomes inaccessible because it is failing; but because you can't kill the process accessing that bit, the disk effectively blocks. And there's no way to take control of the system, and attempt a (partial) recovery, even though this is usually possible in principle.

Details:

I propose patching the kernel sysrq function to add some extra keys (in addition to the rather useful RSEIUB etc). These would be bound to user-definable actions. The one I really want to see is:
   killall -STOP <all userspace processes, including the X-server>
   chvt 1 (and clear the screen)
   prompt for root password
   start bash, at nice -10.

What I suggest is similar in principle to Alt-SysRQ-K, but less destructive. There are some potential security risks here, but nothing that can't be fixed.
If people think this is a good idea, I'll write a detailed proposal sadly kernel hacking is beyond me!

Tags: wishlist
Revision history for this message
Brian Murray (brian-murray) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in recently. We were wondering if this is still an issue for you? Thanks in advance.

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

Yes - still relevant. Looking at /usr/src/linux*/Documentation/sysrq.txt suggests this might be relatively easy to do. There are a lot of useful things present already; unfortunately not the one I want though!

Revision history for this message
Andy Whitcroft (apw) wrote :

This is not a bug in the linux-meta package, moving to the linux package.

affects: linux-meta (Ubuntu) → linux (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.