1

In my Ubuntu 12.04, in keyboard settings, I didn't find a shortcut for restarting X, so in "Custom Shortcut", I set up Ctrl + Alt + Backspace for the command sudo restart lightdm. But the shortcut doesn't work. Is it because it requires root privilege?

Also I have a SysRq key on my keyboard, which I think is the "Magic SysReq Key". My SysRq key is shared with PrtSc key (for screen shot), and is in blue which means I have to press Fn key at the same time to invoke SysRq instead of PrtSC.

But every time I press Fn + SysRq, it always produces a screenshot, just as when I hit PrtSc without hitting Fn. I wonder how to use the Magic SysReq Key? Does it mean the shortcut has not been linked to any command that is defined for Magic SysReq Key yet?

PS: My laptop is Lenovo T400 and OS is Ubuntu 12.04.

2 Answers 2

1

Answer for the 1st question.

In order to restart your X server with "Ctrl + alt + Backspace",

  1. Open "System Setting > Keyboard Layout".

  2. On Keyboard Layout, click the option button in bottom right corner.

  3. Expand “Key Squence to kill the X server” and then check "Ctrl + alt + Backspace"

enter image description here

Answer for the 2nd question.

Magic SysRq keys active by default in Ubuntu 12.04 LTS.

You can check to execute this command:

sudo cat /proc/sys/kernel/sysrq

Then, you can see "1" in terminal, this means "enable all functions of sysrq".

To perform a safe reboot, use REISUB SysRq Magic combination key:

Hold Alt + Fn + SysRq then type R+E+I+S+U+B , you need to press each key for 2-3 seconds.

Caution: Don't release Alt + Fn + SysRq, when you type R+E+I+S+U+B. And, after you type "E", black screen comes out. But you have to continue typing "I+S+U+B".

So, you can reboot your PC safely.

Safely shutting down Ubuntu when it is frozen, use "R+S+E+I+U+O" keys instead of "R+E+I+S+U+B".

Meaning of each keys:

  • B: Will immediately reboot the system without syncing or unmounting your disks.

  • O: Will shut your system off (if configured and supported).

  • R: Will switch the keyboard from raw mode, the mode used by programs.

  • S: Will attempt to sync all mounted filesystems.

  • U: Will attempt to remount all mounted filesystems read-only.

  • P: Will dump the current registers and flags to your console.

  • T: Will dump a list of current tasks and their information to your console.

  • M: Will dump current memory info to your console.

  • E: Send a SIGTERM to all processes, except for init.

  • I: Send a SIGKILL to all processes, except for init.

  • L: Shows a stack backtrace for all active CPUs.

I think that you may arrange the combination of these keys (after considering the meaning of the keys) , since this is an example.

You can reboot system using only B command key, or shutdown using only O command key. But, especially , it may be important to remount a file system safely by "read-only" using U key, to protect that a file breaks in the case of forced termination.

6
  • Thanks! (1) I wonder what differences are between the purposes of "R+S+E+I+U+O" and of "R+E+I+S+U+B"? (2) Can I just use part of the commands, such as just "R+S", or "R", without using "R+S+E+I+U+O" or "R+E+I+S+U+B"?
    – Tim
    Jul 6, 2012 at 23:05
  • Thanks! (1) Why it is important to remount a file system safely using U key, given that the system is shutting down? (2) Why "Safely shutting down Ubuntu when it is frozen, use "R+S+E+I+U+O" keys instead of "R+E+I+S+U+B""?
    – Tim
    Jul 7, 2012 at 1:35
  • (1) Why is it not good that "the important files will be rewritten"? Isn't it good to save any unsaved work, so we won't risk losing our previous work? (2) So the difference between "R+E+I+S+U+B" and "R+S+E+I+U+O" is the former reboot the OS and the latter shut down the OS?
    – Tim
    Jul 7, 2012 at 1:55
  • If the earlier S has already saved all unsaved work, who will rewrite important files, which must be avoided by using U after S?
    – Tim
    Jul 7, 2012 at 2:32
  • It means as protecting that a file breaks in the case of forced termination. It seems that there are too many comments...
    – vine_user
    Jul 7, 2012 at 2:40
1
  1. Use gksudo instead of sudo , because your are in graphic interface, so you can type the password.
  2. Here you can see something about SysRq: Link

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .