19

I am trying to locate my coredump file in ubuntu 12.04 LTS but I cant. The problem is that I have to edit the core_pattern file content after every reboot to get it, because apport doesn't work (don't know why).

Is there any way to permanently set core_pattern file's content??

21

The /proc/sys/kernel/core_pattern configuration setting is set when the apport crash reporting service starts on system boot. So the first step in the process would be to disable apport. This can be done by editing the /etc/default/apport file, and setting enabled=0.

At this point, the kernel default core pattern should remain on boot. If you want to switch to some other pattern you can do this by placing a file in /etc/sysctl.d that ends in .conf (e.g. 60-core-pattern.conf). It's contents should look something like this (adjusting for your desired pattern):

kernel.core_pattern = core

That should cause your custom pattern to be loaded on boot. You should be able to test it without rebooting by running sudo sysctl --system.

  • Everything was fine for the whole process except for the last part "sudo sysctl --system" as it displayed '--system' as unknown parameter. After consulting sysctl manual I alternatively used "sudo sysctl -p /etc/sysctl.d/60-core-pattern.conf" command to execute sysctl using the recently created file. Then I got the coredump file in the /var/crash/ directory. Thank you sir. – Ambuj Mani Tripathi Feb 14 '14 at 19:00
  • Ah. I guess the --system option was added after 12.04. – James Henstridge Feb 15 '14 at 1:15

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.