Saturday, May 4, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1891  / 3 Years ago, thu, november 18, 2021, 2:43:18

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.


More From » shortcut-keys

 Answers
2

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.


[#37039] Friday, November 19, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
egantfis

Total Points: 406
Total Questions: 108
Total Answers: 108

Location: Austria
Member since Thu, Jan 7, 2021
3 Years ago
egantfis questions
Mon, Nov 1, 21, 03:37, 3 Years ago
Fri, Mar 18, 22, 23:26, 2 Years ago
Mon, Mar 6, 23, 05:03, 1 Year ago
Sun, Oct 3, 21, 23:30, 3 Years ago
Thu, Mar 10, 22, 12:28, 2 Years ago
;