How to enable Magic sysrq

Just a few words to report that Magic SysRq is working on my F42 installation. After a froze I used it to stop all tasks, sync and reboot. Just like I’ve been doing forever on Debian.

Traditionally, it never worked on fedora, being disabled. I tested this many times since F38.

Somebody knows which package changed which config and when ?

Current config:

$ cat /proc/sys/kernel/sysrq
438
:/boot$ grep sysrq config-6.*
config-6.12.25-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ=y
config-6.12.25-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0
config-6.12.25-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL=y
config-6.12.25-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""
config-6.12.32-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ=y
config-6.12.32-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0
config-6.12.32-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL=y
config-6.12.32-200.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""
config-6.14.11-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ=y
config-6.14.11-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0
config-6.14.11-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL=y
config-6.14.11-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""
config-6.14.5-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ=y
config-6.14.5-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x0
config-6.14.5-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL=y
config-6.14.5-300.fc42.x86_64:CONFIG_MAGIC_SYSRQ_SERIAL_SEQUENCE=""

Did you do something to set that, or did you just notice that Magic Sysrq started working?

On my F42 system (where I don’t think I’ve changed anything relevant) I get

$ cat /proc/sys/kernel/sysrq
16
1 Like

Nothing changed from myself. It just started working when I needed it.

https://grok.com/share/c2hhcmQtMg%3D%3D_449982e6-32b9-4a35-9403-c493c58ce86a

Hi,

I agree it’s right there. Not me changed that though. Must be an undetermined package.

$ grep -r -e kernel.sysrq /{etc,usr/lib}/sysctl.*
/etc/sysctl.d/99-sysreq.conf:kernel.sysrq = 438
/usr/lib/sysctl.d/50-default.conf:# Use kernel.sysrq = 1 to allow all keys.
/usr/lib/sysctl.d/50-default.conf:kernel.sysrq = 16
$  ll /etc/sysctl.d/99-sysreq.conf
-rw-r--r-- 1 root root 19  8 nov  2024 /etc/sysctl.d/99-sysreq.conf

Thanks for the tip!

You can ask rpm to tell you which package that file comes from.

rpm -qf  /etc/sysctl.d/99-sysreq.conf

Hmm,

$ LANG=C rpm -qf  /etc/sysctl.d/99-sysreq.conf
file /etc/sysctl.d/99-sysreq.conf is not owned by any package

Thanks for the hint though. Haven’t used rpm in years. I forgot somehow.

On second though, looks like it’s me who changed that some 8 months ago. I don’t recall doing that still.

$ history|grep 99-sysreq.con
 4513  sudo micro /etc/sysctl.d/99-sysreq.conf 
1 Like