Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Rebooting Via 'REISUB' Doesn't Work

  1. #1
    Join Date
    Mar 2018
    Beans
    28

    Rebooting Via 'REISUB' Doesn't Work

    I was previously able to use the magic SysRq key (see <https://en.wikipedia.org/wiki/Magic_SysRq_key>) to do a graceful reboot of my Ubuntu computer by pressing Alt-PrtScr and then, in order, R, E, I, S, U, and B. That was with a Lenovo X270. When I tried it today with a Dell Latitude 3590, however, it did not work. Same version of Ubuntu (20.04 LTS), same instructions followed, but the computer just continued to hang until I held down the power button.

    According to a blog post (see <https://www.binarytides.com/linux-co...estart-system/>), I can check if sysrq is enabled on the system by running
    Code:
    $ cat /proc/sys/kernel/sysrq
    . I did that, and it returned 176 (nonzero), so I take it that means sysrq is enabled.

    Does anyone have any idea why "REISUB" doesn't work on this computer? I have also tried it when the computer is running normally, and it still doesn't work. Also, does anyone know any other method of doing a graceful reboot when the computer hangs?

  2. #2
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,362
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Rebooting Via 'REISUB' Doesn't Work

    According to the article you link, any value greater than 1 is a bit-mask of which functions are enabled. The article doesn't say what the different bits enable. Try writing a "1" to /proc/sys/kernel/sysrq first, to enable all functions. This should help: https://linuxconfig.org/how-to-enabl...tions-on-linux

  3. #3
    Join Date
    Aug 2021
    Beans
    131
    Distro
    Xubuntu

    Re: Rebooting Via 'REISUB' Doesn't Work

    As The Cog said, you need to set it to 1. Open /etc/sysctl.d/10-magic-sysrq.conf (with sudoedit) and change this value from 176 to 1:
    Code:
    kernel.sysrq = 1

  4. #4
    Join Date
    Mar 2018
    Beans
    28

    Re: Rebooting Via 'REISUB' Doesn't Work

    Thanks for the replies. But 176 was the value returned in the example I linked to in my OP. When I used "REISUB" on my Lenovo, I did not have to change any of the configurations for it to work. Are you sure "REISUB" doesn't work when the value is 176?

    Quote Originally Posted by The Cog View Post
    According to the article you link, any value greater than 1 is a bit-mask of which functions are enabled. The article doesn't say what the different bits enable. Try writing a "1" to /proc/sys/kernel/sysrq first, to enable all functions. This should help: https://linuxconfig.org/how-to-enabl...tions-on-linux
    Except, according to that link you provided, I would want to write "1" to /etc/sysctl.d/99-sysctl.conf, not /proc/sys/kernel/sysrq, right? It sounds like this way the configuration will survive a reboot.

    So how do I make this change? According to the link you provided, I should run:
    Code:
    # echo "kernel.sysrq = 1" >> /etc/sysctl.d/99-sysctl.conf
    . Does this look right? What if my command prompt is $, not #? Aren't I supposed to type "sudo" or something?

    Quote Originally Posted by kbar View Post
    As The Cog said, you need to set it to 1. Open /etc/sysctl.d/10-magic-sysrq.conf (with sudoedit) and change this value from 176 to 1:
    Code:
    kernel.sysrq = 1
    It looks like you are editing a different file than the one mentioned above. Do you think I should instead edit the one above? Regarding sudoedit, according to this blog post <http://www.wingtiplabs.com/blog/post...3/13/sudoedit/>: "If you’re not using a least privilege model for your users, or if you don’t customize your editor, sudoedit is probably not right for you. But if you’re like me, this is gonna make your day." I'm not sure if I'm using a "least privilege model for [my] users," as I am the only user, and I didn't customize my editor. Therefore, do you think, if following these instructions, it would be better for me to run:
    Code:
    sudo vi /etc/sysctl.d/10-magic-sysrq.conf
    ?




  5. #5
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Rebooting Via 'REISUB' Doesn't Work

    They changed the default.
    I believe only R & B work with default.

    https://digitalfortress.tech/debug/w...buntu-freezes/
    Here is a method to enable the process by editing a file:-
    sudo nano /etc/sysctl.d/10-magic-sysrq.conf
    Then change the number in line 26 from 176 to 244 i.e. kernel.sysrq = 244
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  6. #6
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,362
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Rebooting Via 'REISUB' Doesn't Work

    Interesting. My installer script writes kernel.sysrq=1 to /etc/sysctl.conf, not /etc/sysctl.d/10-magic-sysrq.conf (which still contains kernel.sysrq = 176). /proc/sys/kernel/sysrq shows 1, so I guess sysctl.conf has priority.

  7. #7
    Join Date
    Aug 2021
    Beans
    131
    Distro
    Xubuntu

    Post Re: Rebooting Via 'REISUB' Doesn't Work

    Quote Originally Posted by scribner View Post
    It looks like you are editing a different file than the one mentioned above. Do you think I should instead edit the one above? Regarding sudoedit, according to this blog post <http://www.wingtiplabs.com/blog/post...3/13/sudoedit/>: "If you’re not using a least privilege model for your users, or if you don’t customize your editor, sudoedit is probably not right for you. But if you’re like me, this is gonna make your day." I'm not sure if I'm using a "least privilege model for [my] users," as I am the only user, and I didn't customize my editor. Therefore, do you think, if following these instructions, it would be better for me to run:
    Code:
    sudo vi /etc/sysctl.d/10-magic-sysrq.conf
    ?
    You're just changing one line, you don't have to customize your editor, which is by default nano for sudoers. You can do whatever you want provided that you know about consequences, but it's a good practice to always use sudoedit (or sudo -e). It's also a good practice to read manuals installed on your system or at least refer to official documentation online, instead of resorting to some questionable guides and how-tos.

    sudoedit(8)

    Quote Originally Posted by The Cog View Post
    Interesting. My installer script writes kernel.sysrq=1 to /etc/sysctl.conf, not /etc/sysctl.d/10-magic-sysrq.conf (which still contains kernel.sysrq = 176). /proc/sys/kernel/sysrq shows 1, so I guess sysctl.conf has priority.
    The procps utility installs binaries like ps and kill, the sysctl tool, and configuration files in /etc/sysctl.d. Here's the order of precedence of configuration files that sysctl reads:

    • /run/sysctl.d/*.conf
    • /etc/sysctl.d/*.conf
    • /usr/local/lib/sysctl.d/*.conf
    • /usr/lib/sysctl.d/*.conf
    • /lib/sysctl.d/*.conf
    • /etc/sysctl.conf


    You probably set the --load=/etc/sysctl.conf option to sysctl, or left it empty, which will also load /etc/sysctl.conf.

    sysctl(8), sysctl.conf(5), sysctl.d(5)

  8. #8
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,362
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Rebooting Via 'REISUB' Doesn't Work

    The procps utility installs binaries like ps and kill, the sysctl tool, and configuration files in /etc/sysctl.d. Here's the order of precedence of configuration files that sysctl reads:

    /run/sysctl.d/*.conf
    /etc/sysctl.d/*.conf
    /usr/local/lib/sysctl.d/*.conf
    /usr/lib/sysctl.d/*.conf
    /lib/sysctl.d/*.conf
    /etc/sysctl.conf


    You probably set the --load=/etc/sysctl.conf option to sysctl, or left it empty, which will also load /etc/sysctl.conf.

    sysctl(8), sysctl.conf(5), sysctl.d(5)
    Good references, thanks. My "installer" script is a playbook that I run post-install, a collection of tweaks I have accumulated over time. That one line in /etc/sysctl.conf is the only change I make in that area, found it with an internet search after Ubuntu changes its settings.

  9. #9
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    6,120
    Distro
    Xubuntu

    Re: Rebooting Via 'REISUB' Doesn't Work

    You can edit /etc/sysctl.d/10-magic-sysrq.conf or /etc/sysctl.conf or add an extra file to /etc/sysctl.d/. It all works.

    My /etc/sysctl.d/10-magic-sysrq.conf tells how it works:
    Code:
    # Here is the list of possible values:
    #   0 - disable sysrq completely
    #   1 - enable all functions of sysrq
    #  >1 - enable certain functions by adding up the following values:
    #          2 - enable control of console logging level
    #          4 - enable control of keyboard (SAK, unraw)
    #          8 - enable debugging dumps of processes etc.
    #         16 - enable sync command
    #         32 - enable remount read-only
    #         64 - enable signalling of processes (term, kill, oom-kill)
    #        128 - allow reboot/poweroff
    #        256 - allow nicing of all RT tasks
    #
    So, the default of 176 = 128+32+16 allows rebooting.

    If set to 176 and you still can't reboot, it may be that you have to hold fn too or your SysRq key is somewhere else. It isn't always the same as the PrintScreen key. On my HP laptop, it's the delete key, so I have to hit fn+alt+delete+{REISUB}.

  10. #10
    Join Date
    Mar 2018
    Beans
    28

    Re: Rebooting Via 'REISUB' Doesn't Work

    Quote Originally Posted by Impavidus View Post
    If set to 176 and you still can't reboot, it may be that you have to hold fn too or your SysRq key is somewhere else. It isn't always the same as the PrintScreen key. On my HP laptop, it's the delete key, so I have to hit fn+alt+delete+{REISUB}.
    This.

    I tried a few methods online, but none worked. Then I found a method posted at Ask Ubuntu that says to press Fn-R-Alt, then release Fn while holding the others to trigger a command key. This worked, but I'm not sure I'm doing it right. I pressed Fn-R-Alt, released Fn while holding the other two keys, then pressed E, I, S, U, and B. So R was pressed down the entire time and I counted that as the R in "REISUB." Does this sound right? Also, I didn't wait a full second between pressing each of the letters in EISUB -- could this have done any damage?

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •