Ubuntu + PrtSc + AltGr = CRASH












2















On Ubuntu 15.10 and 15.04 on Lenovo t440p when I'm writing a code in Netbeans and accidently click button AltGr and PrtSc on same time it's crashed and reboot system. This not take action with fresh installed Ubuntu.



This is backtrace from syslog:



Feb  5 19:47:43 mycomputername kernel: [   15.485327] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:44 mycomputername kernel: [ 16.966879] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:44 mycomputername kernel: [ 17.115697] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:44 mycomputername kernel: [ 17.115844] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:45 mycomputername kernel: [ 17.644247] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:45 mycomputername kernel: [ 17.829425] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:46 mycomputername kernel: [ 18.698713] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:47 mycomputername kernel: [ 20.033534] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
Feb 5 19:47:48 mycomputername kernel: [ 21.061323] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)


How can I disable PrtSc or prevent to accidently clicking PrintScreen on Lenovo keyboard? Or what's problem on this backtrace?



Thanks










share|improve this question





























    2















    On Ubuntu 15.10 and 15.04 on Lenovo t440p when I'm writing a code in Netbeans and accidently click button AltGr and PrtSc on same time it's crashed and reboot system. This not take action with fresh installed Ubuntu.



    This is backtrace from syslog:



    Feb  5 19:47:43 mycomputername kernel: [   15.485327] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:44 mycomputername kernel: [ 16.966879] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:44 mycomputername kernel: [ 17.115697] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:44 mycomputername kernel: [ 17.115844] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:45 mycomputername kernel: [ 17.644247] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:45 mycomputername kernel: [ 17.829425] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:46 mycomputername kernel: [ 18.698713] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:47 mycomputername kernel: [ 20.033534] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
    Feb 5 19:47:48 mycomputername kernel: [ 21.061323] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)


    How can I disable PrtSc or prevent to accidently clicking PrintScreen on Lenovo keyboard? Or what's problem on this backtrace?



    Thanks










    share|improve this question



























      2












      2








      2








      On Ubuntu 15.10 and 15.04 on Lenovo t440p when I'm writing a code in Netbeans and accidently click button AltGr and PrtSc on same time it's crashed and reboot system. This not take action with fresh installed Ubuntu.



      This is backtrace from syslog:



      Feb  5 19:47:43 mycomputername kernel: [   15.485327] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:44 mycomputername kernel: [ 16.966879] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:44 mycomputername kernel: [ 17.115697] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:44 mycomputername kernel: [ 17.115844] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:45 mycomputername kernel: [ 17.644247] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:45 mycomputername kernel: [ 17.829425] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:46 mycomputername kernel: [ 18.698713] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:47 mycomputername kernel: [ 20.033534] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:48 mycomputername kernel: [ 21.061323] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)


      How can I disable PrtSc or prevent to accidently clicking PrintScreen on Lenovo keyboard? Or what's problem on this backtrace?



      Thanks










      share|improve this question
















      On Ubuntu 15.10 and 15.04 on Lenovo t440p when I'm writing a code in Netbeans and accidently click button AltGr and PrtSc on same time it's crashed and reboot system. This not take action with fresh installed Ubuntu.



      This is backtrace from syslog:



      Feb  5 19:47:43 mycomputername kernel: [   15.485327] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:44 mycomputername kernel: [ 16.966879] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:44 mycomputername kernel: [ 17.115697] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:44 mycomputername kernel: [ 17.115844] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:45 mycomputername kernel: [ 17.644247] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:45 mycomputername kernel: [ 17.829425] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:46 mycomputername kernel: [ 18.698713] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:47 mycomputername kernel: [ 20.033534] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)
      Feb 5 19:47:48 mycomputername kernel: [ 21.061323] sysrq: SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) sak(k) show-backtrace-all-active-cpus(l) show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) show-all-timers(q) unraw(r) sync(s) show-task-states(t) unmount(u) force-fb(V) show-blocked-tasks(w) dump-ftrace-buffer(z)


      How can I disable PrtSc or prevent to accidently clicking PrintScreen on Lenovo keyboard? Or what's problem on this backtrace?



      Thanks







      keyboard crash sysrq






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 5 at 2:29









      TDK

      25013




      25013










      asked Feb 5 '16 at 18:54









      phreakboxphreakbox

      1136




      1136






















          1 Answer
          1






          active

          oldest

          votes


















          3














          The problem:



          On your keyboard, the Print Screen (PrtSc) and System Request (SysRq) are on the same physical button, like on most layouts I know.



          The key combinations Alt+SysRq+[SPECIFIC LETTER] are generally known as Magic SysRq Commands which directly send commands to the kernel.



          They're mainly used as a safer alternative to a cold reset if the system is completely crashed, because there are e.g. commands to sync and unmount the file system to prevent damage and data corruption and to reset/reboot (if you press B as 3rd key) or power off (3rd key O). More information and a full list of combinations, even with respect to different keyboard layouts, can be found in the corresponding Wikipedia article Magic SysRq Key.



          So what you're accidentally doing is to directly send the kernel the command to reboot, and that's what it does.





          The solution:



          Depending on how your kernel was compiled, you are however able to specify on which SysRq commands the kernel should listen when the system is running. I just tested this on 15.10 with kernel 4.2.0-27-generic and it worked, but it would be nice to learn since when or for what kernels this is enabled. Please comment if you know.





          • Find out the current SysRq command filter value:



            We can learn which SysRq commands are currently enabled by checking the content of the virtual file /proc/sys/kernel/sysrq:



            cat /proc/sys/kernel/sysrq


            The result will be a number that must be interpreted like this:



            0 - disable SysRq
            1 - enable SysRq completely
            >1 - bitmask of enabled SysRq functions:
            2 - control of console logging level
            4 - control of keyboard (SAK, unraw)
            8 - debugging dumps of processes etc.
            16 - sync command
            32 - remount read-only
            64 - signalling of processes (term, kill, oom-kill)
            128 - reboot/poweroff
            256 - nicing of all RT tasks


            My default value when I'm on the desktop is 176, which is 128+32+16. So according to the table above, I can reboot, poweroff, sync and remount file systems to read-only.




          • Disable all SysRq commands:



            Execute the command below and try whether the SysRq shortcuts still work afterwards (e.g. Alt+SysRq+B to reset/reboot):



            echo 0 | sudo tee /proc/sys/kernel/sysrq


            This should disable all SysRq commands for the current session, until you reboot the next time.




          • Enable all SysRq commands:



            To manually enable all SysRq commands, we write the value 1 to the same virtual file instead:



            echo 1 | sudo tee /proc/sys/kernel/sysrq



          • Enable previous default SysRq command filter:



            You restore your default configuration by either rebooting, or if you checked and remembered the value before tweaking it, you can set that value again instead of 0/1 to enable/disable all commands.



            So in my case where the original value was 176, I would run:



            echo 176 | sudo tee /proc/sys/kernel/sysrq







          share|improve this answer


























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f730153%2fubuntu-prtsc-altgr-crash%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            The problem:



            On your keyboard, the Print Screen (PrtSc) and System Request (SysRq) are on the same physical button, like on most layouts I know.



            The key combinations Alt+SysRq+[SPECIFIC LETTER] are generally known as Magic SysRq Commands which directly send commands to the kernel.



            They're mainly used as a safer alternative to a cold reset if the system is completely crashed, because there are e.g. commands to sync and unmount the file system to prevent damage and data corruption and to reset/reboot (if you press B as 3rd key) or power off (3rd key O). More information and a full list of combinations, even with respect to different keyboard layouts, can be found in the corresponding Wikipedia article Magic SysRq Key.



            So what you're accidentally doing is to directly send the kernel the command to reboot, and that's what it does.





            The solution:



            Depending on how your kernel was compiled, you are however able to specify on which SysRq commands the kernel should listen when the system is running. I just tested this on 15.10 with kernel 4.2.0-27-generic and it worked, but it would be nice to learn since when or for what kernels this is enabled. Please comment if you know.





            • Find out the current SysRq command filter value:



              We can learn which SysRq commands are currently enabled by checking the content of the virtual file /proc/sys/kernel/sysrq:



              cat /proc/sys/kernel/sysrq


              The result will be a number that must be interpreted like this:



              0 - disable SysRq
              1 - enable SysRq completely
              >1 - bitmask of enabled SysRq functions:
              2 - control of console logging level
              4 - control of keyboard (SAK, unraw)
              8 - debugging dumps of processes etc.
              16 - sync command
              32 - remount read-only
              64 - signalling of processes (term, kill, oom-kill)
              128 - reboot/poweroff
              256 - nicing of all RT tasks


              My default value when I'm on the desktop is 176, which is 128+32+16. So according to the table above, I can reboot, poweroff, sync and remount file systems to read-only.




            • Disable all SysRq commands:



              Execute the command below and try whether the SysRq shortcuts still work afterwards (e.g. Alt+SysRq+B to reset/reboot):



              echo 0 | sudo tee /proc/sys/kernel/sysrq


              This should disable all SysRq commands for the current session, until you reboot the next time.




            • Enable all SysRq commands:



              To manually enable all SysRq commands, we write the value 1 to the same virtual file instead:



              echo 1 | sudo tee /proc/sys/kernel/sysrq



            • Enable previous default SysRq command filter:



              You restore your default configuration by either rebooting, or if you checked and remembered the value before tweaking it, you can set that value again instead of 0/1 to enable/disable all commands.



              So in my case where the original value was 176, I would run:



              echo 176 | sudo tee /proc/sys/kernel/sysrq







            share|improve this answer






























              3














              The problem:



              On your keyboard, the Print Screen (PrtSc) and System Request (SysRq) are on the same physical button, like on most layouts I know.



              The key combinations Alt+SysRq+[SPECIFIC LETTER] are generally known as Magic SysRq Commands which directly send commands to the kernel.



              They're mainly used as a safer alternative to a cold reset if the system is completely crashed, because there are e.g. commands to sync and unmount the file system to prevent damage and data corruption and to reset/reboot (if you press B as 3rd key) or power off (3rd key O). More information and a full list of combinations, even with respect to different keyboard layouts, can be found in the corresponding Wikipedia article Magic SysRq Key.



              So what you're accidentally doing is to directly send the kernel the command to reboot, and that's what it does.





              The solution:



              Depending on how your kernel was compiled, you are however able to specify on which SysRq commands the kernel should listen when the system is running. I just tested this on 15.10 with kernel 4.2.0-27-generic and it worked, but it would be nice to learn since when or for what kernels this is enabled. Please comment if you know.





              • Find out the current SysRq command filter value:



                We can learn which SysRq commands are currently enabled by checking the content of the virtual file /proc/sys/kernel/sysrq:



                cat /proc/sys/kernel/sysrq


                The result will be a number that must be interpreted like this:



                0 - disable SysRq
                1 - enable SysRq completely
                >1 - bitmask of enabled SysRq functions:
                2 - control of console logging level
                4 - control of keyboard (SAK, unraw)
                8 - debugging dumps of processes etc.
                16 - sync command
                32 - remount read-only
                64 - signalling of processes (term, kill, oom-kill)
                128 - reboot/poweroff
                256 - nicing of all RT tasks


                My default value when I'm on the desktop is 176, which is 128+32+16. So according to the table above, I can reboot, poweroff, sync and remount file systems to read-only.




              • Disable all SysRq commands:



                Execute the command below and try whether the SysRq shortcuts still work afterwards (e.g. Alt+SysRq+B to reset/reboot):



                echo 0 | sudo tee /proc/sys/kernel/sysrq


                This should disable all SysRq commands for the current session, until you reboot the next time.




              • Enable all SysRq commands:



                To manually enable all SysRq commands, we write the value 1 to the same virtual file instead:



                echo 1 | sudo tee /proc/sys/kernel/sysrq



              • Enable previous default SysRq command filter:



                You restore your default configuration by either rebooting, or if you checked and remembered the value before tweaking it, you can set that value again instead of 0/1 to enable/disable all commands.



                So in my case where the original value was 176, I would run:



                echo 176 | sudo tee /proc/sys/kernel/sysrq







              share|improve this answer




























                3












                3








                3







                The problem:



                On your keyboard, the Print Screen (PrtSc) and System Request (SysRq) are on the same physical button, like on most layouts I know.



                The key combinations Alt+SysRq+[SPECIFIC LETTER] are generally known as Magic SysRq Commands which directly send commands to the kernel.



                They're mainly used as a safer alternative to a cold reset if the system is completely crashed, because there are e.g. commands to sync and unmount the file system to prevent damage and data corruption and to reset/reboot (if you press B as 3rd key) or power off (3rd key O). More information and a full list of combinations, even with respect to different keyboard layouts, can be found in the corresponding Wikipedia article Magic SysRq Key.



                So what you're accidentally doing is to directly send the kernel the command to reboot, and that's what it does.





                The solution:



                Depending on how your kernel was compiled, you are however able to specify on which SysRq commands the kernel should listen when the system is running. I just tested this on 15.10 with kernel 4.2.0-27-generic and it worked, but it would be nice to learn since when or for what kernels this is enabled. Please comment if you know.





                • Find out the current SysRq command filter value:



                  We can learn which SysRq commands are currently enabled by checking the content of the virtual file /proc/sys/kernel/sysrq:



                  cat /proc/sys/kernel/sysrq


                  The result will be a number that must be interpreted like this:



                  0 - disable SysRq
                  1 - enable SysRq completely
                  >1 - bitmask of enabled SysRq functions:
                  2 - control of console logging level
                  4 - control of keyboard (SAK, unraw)
                  8 - debugging dumps of processes etc.
                  16 - sync command
                  32 - remount read-only
                  64 - signalling of processes (term, kill, oom-kill)
                  128 - reboot/poweroff
                  256 - nicing of all RT tasks


                  My default value when I'm on the desktop is 176, which is 128+32+16. So according to the table above, I can reboot, poweroff, sync and remount file systems to read-only.




                • Disable all SysRq commands:



                  Execute the command below and try whether the SysRq shortcuts still work afterwards (e.g. Alt+SysRq+B to reset/reboot):



                  echo 0 | sudo tee /proc/sys/kernel/sysrq


                  This should disable all SysRq commands for the current session, until you reboot the next time.




                • Enable all SysRq commands:



                  To manually enable all SysRq commands, we write the value 1 to the same virtual file instead:



                  echo 1 | sudo tee /proc/sys/kernel/sysrq



                • Enable previous default SysRq command filter:



                  You restore your default configuration by either rebooting, or if you checked and remembered the value before tweaking it, you can set that value again instead of 0/1 to enable/disable all commands.



                  So in my case where the original value was 176, I would run:



                  echo 176 | sudo tee /proc/sys/kernel/sysrq







                share|improve this answer















                The problem:



                On your keyboard, the Print Screen (PrtSc) and System Request (SysRq) are on the same physical button, like on most layouts I know.



                The key combinations Alt+SysRq+[SPECIFIC LETTER] are generally known as Magic SysRq Commands which directly send commands to the kernel.



                They're mainly used as a safer alternative to a cold reset if the system is completely crashed, because there are e.g. commands to sync and unmount the file system to prevent damage and data corruption and to reset/reboot (if you press B as 3rd key) or power off (3rd key O). More information and a full list of combinations, even with respect to different keyboard layouts, can be found in the corresponding Wikipedia article Magic SysRq Key.



                So what you're accidentally doing is to directly send the kernel the command to reboot, and that's what it does.





                The solution:



                Depending on how your kernel was compiled, you are however able to specify on which SysRq commands the kernel should listen when the system is running. I just tested this on 15.10 with kernel 4.2.0-27-generic and it worked, but it would be nice to learn since when or for what kernels this is enabled. Please comment if you know.





                • Find out the current SysRq command filter value:



                  We can learn which SysRq commands are currently enabled by checking the content of the virtual file /proc/sys/kernel/sysrq:



                  cat /proc/sys/kernel/sysrq


                  The result will be a number that must be interpreted like this:



                  0 - disable SysRq
                  1 - enable SysRq completely
                  >1 - bitmask of enabled SysRq functions:
                  2 - control of console logging level
                  4 - control of keyboard (SAK, unraw)
                  8 - debugging dumps of processes etc.
                  16 - sync command
                  32 - remount read-only
                  64 - signalling of processes (term, kill, oom-kill)
                  128 - reboot/poweroff
                  256 - nicing of all RT tasks


                  My default value when I'm on the desktop is 176, which is 128+32+16. So according to the table above, I can reboot, poweroff, sync and remount file systems to read-only.




                • Disable all SysRq commands:



                  Execute the command below and try whether the SysRq shortcuts still work afterwards (e.g. Alt+SysRq+B to reset/reboot):



                  echo 0 | sudo tee /proc/sys/kernel/sysrq


                  This should disable all SysRq commands for the current session, until you reboot the next time.




                • Enable all SysRq commands:



                  To manually enable all SysRq commands, we write the value 1 to the same virtual file instead:



                  echo 1 | sudo tee /proc/sys/kernel/sysrq



                • Enable previous default SysRq command filter:



                  You restore your default configuration by either rebooting, or if you checked and remembered the value before tweaking it, you can set that value again instead of 0/1 to enable/disable all commands.



                  So in my case where the original value was 176, I would run:



                  echo 176 | sudo tee /proc/sys/kernel/sysrq








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Feb 6 '16 at 15:20

























                answered Feb 5 '16 at 21:57









                Byte CommanderByte Commander

                66.2k27181309




                66.2k27181309






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f730153%2fubuntu-prtsc-altgr-crash%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to change which sound is reproduced for terminal bell?

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents