# After issuing the command "echo c > /proc/sysrq-trigger " system hangs

I am using GigaByte Brix platform(Model : GB-BSi7H-6500 having x86_64 architecture) having 4.0.4-301.fc22.x86_64 (fedora core 22 OS) Trying to enable kdump feature on it. After issuing the command "echo c > /proc/sysrq-trigger " system gets hanged. It never comes of it and there is no crash dump in /var/crash folder.

output of uname -r:- Linux dhcp-blr-20-48.ban.broadcom.com 4.0.4-301.fc22.x86_64 #1 SMP Thu May 21 13:10:33 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

the command echo c > /proc/sysrq-trigger works fine in 4.4.12-200.fc22.x86_64. I want to know the two things:- 1. Which commit fixed the issue in 4.4.12-200.fc22.x86_64 so that I can pull it in 4.0.4-301.fc22.x86_64 ? 2. After giving the command echo c > /proc/sysrq-trigger in 4.0.4-301.fc22.x86_64, system gets freezed. Is there any way to know the exact reason of the system freeze i.e logs , etc ?

Note:- When system gets freezed , I am not able to do anything. I am left with only one option, just to reboot the system.

edit retag close merge delete

Sort by » oldest newest most voted

Welcome to ask.fedora. I'm not sure why your system hung, but it may be because you put the wrong value in that file. As you can see here, the correct values are 0 and 1. Try again, using 1 instead of c and it should work until you reboot. If you want it active at all times, follow these instructions:

As root create /etc/sysctl.d/99-custom.conf and put this in it:

kernel.sysrq = 1

Save and reboot to activate, or just use this:

sysctl --system

and you're good to go.

more

This answer is wrong in several ways. What you suggest is just to enable the sysrq key commands and that's not what he's trying to do. He is doing the right thing. Note that it is the trigger he is writing to.

( 2016-06-16 13:53:14 -0600 )edit

That is the right command, but the problem is that your system isn't configured to handle it properly. You need kexec and kdump installed and configured for this to work.

In the capturing section, you don't need to write the 1 before you write the c, but it also won't hurt anything.

more

Thanks a lot for your replies. I have installed kexec-tools . I think the following package is missing in the kernel version:4.0.4-301.fc22.x86_64 as the command echo c > /proc/sysrq-trigger works fine in 4.4.12-200.fc22.x86_64:- * Thu Aug 20 2015 Josh Boyer jwboyer@fedoraproject.org - Fix incorrect ext4 freezing behavior on non-journaled fs (rhbz 1250717)

I want to download the 4.0.4-301.fc22.x86_64 (fedora core 22 OS) kernel source code and apply the above patch in it to check whether it works or not ? Could you please tell the procedure to download the full kernel source for 4.0.4-301.fc22.x86_64 and the process the compiling it and loading it ?

more

You can find the source package for that build at http://koji.fedoraproject.org/koji/buildinfo?buildID=638332. As a user (you don't need to be root), rpm -i <packagename.rpm>, then you'll find all the bits in your ~/rpmbuild directory. You put the patch in SOURCES and edit the spec file in SPECS. You make a new package, do rpmbuild -bb SPECS/kernel.spec. You might need to add some parameters to limit what is built, but it's been a while since I last did that, so I don't remember what was involved.

( 2016-06-17 10:53:29 -0600 )edit

If you want to test applying the patch before trying to build (highly recommended), do rpmbuild -bp SPECS/kernel.spec, then go in to the BUILD directory and try out patch there. Every time you run rpmbuild, it will delete the existing BUILD/kernel directory and create it again clean.

( 2016-06-17 10:55:26 -0600 )edit

the command echo c > /proc/sysrq-trigger works fine in 4.4.12-200.fc22.x86_64. I want to know the two things:- 1. Which commit fixed the issue in 4.4.12-200.fc22.x86_64 so that I can pull it in 4.0.4-301.fc22.x86_64 ? 2. After giving the command echo c > /proc/sysrq-trigger in 4.0.4-301.fc22.x86_64, system gets freezed. Is there any way to know the exact reason of the system freeze i.e logs , etc ?

Note:- When system gets freezed , I am not able to do anything. I am left with only one option, just to reboot the system.

( 2016-06-22 01:07:24 -0600 )edit

I don't think anyone is going to know a specific commit from a kernel that old. The exact reason the system freezes is because you told it to by writing "c" to the trigger. Why do you need to use that specific kernel instead of upgrading it?

( 2016-06-22 23:58:41 -0600 )edit