Symas OpenLDAP Knowledge Base

Triggering Core Dumps

Overview

Sometimes OpenLDAP crashes or baffles the experts. When there is a crash or a slapd behavior we can’t diagnose from logs, the data, or your configuration a deeper look is needed. In those situations, troubleshooting requires the analysis of a core dump.

Default operating system settings often interfere with core dump creation.
See Core Dump Configuration to ensure your system is properly configured to save and retain full core dump files.

Linux Core Dumps

Create a Core Dump by Killing slapd

If the process is still running and you need to kill it, send the slapd process a SIGQUIT signal:

Core Dump With kill

  • Get the slapd process ID

      user@host> ps -C slapd
      PID TTY      TIME  CMD
      23348 ?    15:35:33  slapd
    
      # Kill the process with a SIGQUIT signal
      user@host> kill -3 23348

OR

    user@host> kill $(pgrep slapd)

After you kill the process, there should be a file with the name “core” in it in your current working directory or dedicated core file location.

Create a Core Dump Without Killing slapd

If you need a core dump but don’t want or need to kill slapd, you can obtain the core dump by using the gcore utility.
This will create a core without disturbing the slapd process.

The gcore utility is not installed by default on some systems. You may need to install it to use this approach. gcore is a standard package on RHEL, OpenSuSE, Debian, and Ubuntu (and their derivative distributions).

To obtain a core with gcore, get the process id of slapd, then call gcore:

# Get the slapd process ID
user@host> ps -C slapd  ## pgrep???
PID TTY      TIME  CMD
23348 ?    15:35:33  slapd

# Run gcore with the slapd process id
user@host> gcore 23348

– OR –

user@host> gcore $(pgrep slad)

The resulting core file should be in your current working directory and should have the id of the process that was dumped in the filename.