4

When I am running code on a container it cores I am not able to locate it on my container(or the core file is not being stored).

  1. ulimit -c is set to unlimited
  2. /proc/sys/kernel/core_pattern is set to |/usr/share/apport/apport %p %s %c %P (what is the meaning of |?)

Do I need to make any changes in/to the host system?

ajax_velu
  • 286
  • 3
  • 16

1 Answers1

10

| indicates that a program should handle the core dump. Rather than saving the coredump to a file it will be piped into that programs input. Means if core_pattern is set to |... apport apport will handle the core dumps.

Unfortunately apport will create coredumps only for installed packages. I would set the pattern to a file name, like this:

echo '/tmp/cores/core.%e.%p.%t' > /proc/sys/kernel/core_pattern

The would give you coredumps like /tmp/core.program.pid.012345678 where program is the program name, pid the program's pid plus a timestamp at the end.

Check man core for more information (espcecially information about meta chars that can be used in the core pattern.

hek2mgl
  • 152,036
  • 28
  • 249
  • 266
  • I was thinking about what you have suggested, some of the questions are more towards containers than core files like: 1. Should I change the core pattern in my container or my host ubuntu machine? 2. If I need to change it in my container, I am not able to edit the file as root – ajax_velu Mar 20 '15 at 18:25
  • 1
    Unfortunately I cannot test it at the moment but it would make sense to configure it in the host. Have you tried that? – hek2mgl Mar 20 '15 at 18:48