Using Systemd to Manage Core Dumps

Explains how to enable, configure, analyze, and export systemd-managed core dumps on Oracle Linux.

Core dumps contain crash information for userspace applications and services running on Oracle Linux. They can be generated on demand by using a debugger, or the systemd-coredump service can be configured to generate them automatically in the event of a process stopping prematurely.

Core dumps contain a log summary of the crash event that typically includes the process ID, owner, termination signal, and a stack trace. For more information, see the systemd-coredump(8) manual pages.

The coredumpctl command can be used to review core dumps that have been written to the system journal or saved as a file. For more information, see the coredumpctl(1) manual pages.

Enabling Core Dumps

Core dumps aren't enabled by default, so you must configure systemd to generate them.

  1. Create the /etc/systemd/system.conf.d/10-enable-coredumps.conf configuration file and add the following content:
    [Manager]
    DumpCore=yes
    DefaultLimitCORE=infinity
  2. Reload the systemd configuration so the manager re-executes with the new settings:
    sudo systemctl daemon-reexec

Configuring Core Dumps

  1. To adjust the scope of the data captured in systemd core dumps and define where systemd stores them, change the /etc/systemd/coredump.conf configuration file.

    For more information, see the coredump.conf(5) manual pages.

  2. Before running the coredumpctl command, remove any core dump size limits that apply to the current shell session:
    sudo ulimit -c unlimited

    For more information about the ulimit command, see the ulimit(1) manual pages.

Analyzing Core Dumps

  • Use the coredumpctl command to list the core dumps that are available on the system:

    coredumpctl list
  • To review more information about the core dumps stored for a particular application, specify the executable as an option:

    coredumpctl list executable-path
  • To review all the core dumps that are stored for a failed process on the system, specify the process ID instead:

    coredumpctl list process-id

Exporting Core Dumps

  1. To export the core dump for bug reporting purposes, specify the process ID and output file when you run the coredumpctl dump command:
    coredumpctl dump process-id -o output-file
  2. (Optional) Export an SOS report with extra information about the system.
  3. On the same system or a different one, install the gdb package and then step through a core dump with the GNU Debugger by using the coredumpctl debug command:
    sudo dnf install gdb
    coredumpctl debug process-id

For more information about the coredumpctl command, see the coredumpctl(1) manual pages.