Sun Gathering Debug Data for Sun Java System Application Server

2.2 Configuring Solaris OS to Generate Core Files

Core files are generated when a process or application terminates abnormally. Core files are managed with the coreadm command. This section describes how to use the coreadm command to configure a system so that all process core files are placed in a single system directory. This enables you to track problems by examining the core files in a specific directory whenever a Solaris OS process or daemon terminates abnormally.

Before configuring your system for core files, make sure the /var file system has sufficient space. Once you configure Solaris OS to generate core files, a core file is written to the /var/cores directory every time a process crashes.

ProcedureTo Configure Solaris OS to Generate Core Files

  1. Run the following commands as root.

    mkdir -p /var/cores
    coreadm -g /var/cores/%f.%n.%p.core -e global -e process -e \
    global-setid -e proc-setid -e log
  2. View the core configuration.

    # coreadm
               global core file pattern: 
                    init core file pattern: %f.%n.%p.core
                      global core dumps: enabled
              per-process core dumps: enabled
              global setid core dumps: enabled
     per-process setid core dumps: enabled
           global core dump logging: enabled

    See the coreadm man page for further information.

  3. Set the size of the core dumps to unlimited.

    # ulimit -c unlimited
    # ulimit -a
            coredump(blocks) unlimited

    See the ulimit man page for further information.

  4. Verify core file creation.

    # cd /var/cores
    # sleep 100000 &
    [1] PID
    # kill -8 PID
    # ls