whatthe
December 17, 2020, 1:01pm
#1
I can’t change the kernel.sysrq
value.
attempt 1)
I tried:
sudo sysctl -w kernel.sysrq=0
no effect.
attempt 2)
when I edit /etc/sysctl.conf
:
and add: kernel.sysrq=0
and then sudo sysctl -p
and reboot
no effect
attempt 3)
# echo kernel.sysrq=0 > /etc/sysctl.d/99-sysctl.conf
reboot
no effect.
attempt 4)
when I do:
sudo -s
sudo echo "0" > /proc/sys/kernel/sysrq
and then check if it worked:
cat /proc/sys/kernel/sysrq
output is still: 1
chomsky
December 17, 2020, 1:05pm
#2
sudo nano /etc/sysctl.d/99-sysctl.conf
and add
kernel.sysrq = 0
whatthe
December 17, 2020, 1:06pm
#3
I already did that, so it already says: kernel.sysrq=0
chomsky
December 17, 2020, 1:08pm
#4
It works for me and it says so here…
https://wiki.archlinux.org/index.php/Sysctl#Configuration
But why do you want to completely disable it anyway?
TriMoon
December 17, 2020, 1:18pm
#5
Do you use sysrq_always_enabled=1
as kernel parameter?
If so remove that…
Would help to provide the current value of /proc/sys/kernel/sysrq
as reference…
1 Like
whatthe
December 17, 2020, 1:36pm
#6
attempt 5)
cat /etc/sysctl.d/sysrq.conf
output: kernel.sysrq=0
unfortunately I could not find this variable in sysctl.conf, I wish and it seems that this is enabled somewhere…
current value of /proc/sys/kernel/sysrq
= 1
When I try:
$ sudo echo “0” >/proc/sys/kernel/sysrq
bash: /proc/sys/kernel/sysrq: Permission denied
chomsky
December 17, 2020, 1:58pm
#7
first do
sudo -i
and then
echo “0” > /proc/sys/kernel/sysrq
Notice the space between > and /proc
What is the output of cat /etc/default/grub
You can find the kernel parameter there if you have it.
TriMoon
December 17, 2020, 2:02pm
#8
It is not a variable, it is a kernel parameter used while providing the kernel to load in your bootloader config.
ex. in your /etc/default/grub
and the like…
whatthe
December 17, 2020, 3:09pm
#10
chomsky:
cat /etc/default/grub
Sorry guys, the fault was in grub.
sysrq_always_enabled=1
was in grub to load at boot. this was the culprit, I’m sorry.
I forgot about it when I put it there when I followed this tutorial:
Difficulty: ★★☆☆☆
This tutorial was created because people are using a hard power off during freezes, so this will teach you how to turn off your computer when everything is frozen using softer means.
So whenever you see someone saying they had to “Power Off” or “Hard Reset” their system without doing a REISUB, please send them here!
If you’re reading this in response to a question, please click the green link above this text to bring you to the full unabridged text of the tutorial…
1 Like
whatthe
December 17, 2020, 5:23pm
#11
The reason was; I am trying to harden my setup with lynis and it gave me a warning that the kernel option kernel.sysrq needed to be 0.
system
Closed
January 1, 2021, 5:23pm
#12
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.