Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Software] Magic SysRq keys disabled after reboot

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
User avatar
pizzafractal
Posts: 3
Joined: 2022-11-07 11:10
Location: Phoenix, Arizona
Has thanked: 1 time
Contact:

[Software] Magic SysRq keys disabled after reboot

#1 Post by pizzafractal »

I can get the Magic SysRq keys to work by running the following as root in terminal:

Code: Select all

echo "1" > /proc/sys/kernel/sysrq
However, after reboot, the system reverts back to disabled:

Code: Select all

cat /proc/sys/kernel/sysrq
0
I have added this line ...

Code: Select all

kernel.sysrq = 1
... to "/etc/sysctl.conf", "/etc/sysctl.d/60-fix-sysrq.conf", "/etc/sysctl.d/51-alt-sysrq.conf" and "/etc/sysctl.d/99-sysctl.conf". This is a desktop computer for (nearly always) live music performance.

I have verified these kernel config. lines for the kernel in-use which is 6.0.0-7.1-liquorix-amd64:

Code: Select all

CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1

Code: Select all

uname -a
Linux [username] 6.0.0-7.1-liquorix-amd64 #1 ZEN SMP PREEMPT_DYNAMIC liquorix 6.0-2.1~bullseye (2022-11-03 x86_64 GNU/Linux
What am I missing to get this working? Thank you!! :)

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: [Software] Magic SysRq keys disabled after reboot

#2 Post by canci »

You could also have a look at the Liquorix kernel changes. It's not a standard kernel after all.
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

User avatar
pizzafractal
Posts: 3
Joined: 2022-11-07 11:10
Location: Phoenix, Arizona
Has thanked: 1 time
Contact:

Re: [Software] Magic SysRq keys disabled after reboot

#3 Post by pizzafractal »

Thank you, it's working now. I don't know if this makes any sense but for what it's worth: The only thing I did differently after adding all those lines and rebooting a bunch of times back into the Liquorix kernel is boot into the standard 5.19.0-0.deb11.2-amd64 kernel where the keys were enabled as expected. Then, I rebooted back to the Liquorix kernel and the Magic SysRq keys are keeping enabled.

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: [Software] Magic SysRq keys disabled after reboot

#4 Post by canci »

Strange.
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

User avatar
sunrat
Administrator
Administrator
Posts: 6561
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 498 times

Re: [Software] Magic SysRq keys disabled after reboot

#5 Post by sunrat »

Not strange at all. /proc/ is a virtual filesystem in which files are created dynamically by the kernel and don't persist across reboot. The only way for a user to persist MagicSysreq Keys is to make an entry in sysctl.conf or in a file in /etc/sysctl.d/ . Only one of those files is needed, certainly not four.

What is strange is that I use Liquorix (5.18 currently) and don't have anything in those files, but it seems to be default :

Code: Select all

cat /proc/sys/kernel/sysrq
1
Kernel config here shows:

Code: Select all

CONFIG_MAGIC_SYSRQ=y
CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1
CONFIG_MAGIC_SYSRQ_SERIAL=y
CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE="m"
so I would have thought that sets it to "1" by default.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
pizzafractal
Posts: 3
Joined: 2022-11-07 11:10
Location: Phoenix, Arizona
Has thanked: 1 time
Contact:

Re: [Software] Magic SysRq keys disabled after reboot

#6 Post by pizzafractal »

One more "for what it's worth": I'm 100% on Debian repositories but it is a SpiralLinux configuration. Maybe there was something unexpected from that -- couldn't find any log entry about "sysrq" that seemed interesting. Thank you everyone!

User avatar
sunrat
Administrator
Administrator
Posts: 6561
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 498 times

Re: [Software] Magic SysRq keys disabled after reboot

#7 Post by sunrat »

pizzafractal wrote: 2022-11-08 00:39 One more "for what it's worth": I'm 100% on Debian repositories but it is a SpiralLinux configuration. Maybe there was something unexpected from that -- couldn't find any log entry about "sysrq" that seemed interesting. Thank you everyone!
You should have mentioned that in your first post. This forum is for Debian. How are we to know what SpiralLinux configuration is? You should ask questions at SpiralLinux forums.
Moving topic to Offtopic.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Post Reply