JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
System Administration Guide: Advanced Administration     Oracle Solaris 10 8/11 Information Library
search filter icon
search icon

Document Information

About This Book

1.  Managing Terminals and Modems (Overview)

2.  Setting Up Terminals and Modems (Tasks)

3.  Managing Serial Ports With the Service Access Facility (Tasks)

4.  Managing System Resources (Overview)

5.  Displaying and Changing System Information (Tasks)

6.  Managing Disk Use (Tasks)

7.  Managing UFS Quotas (Tasks)

8.  Scheduling System Tasks (Tasks)

9.  Managing System Accounting (Tasks)

10.  System Accounting (Reference)

11.  Managing System Performance (Overview)

12.  Managing System Processes (Tasks)

13.  Monitoring System Performance (Tasks)

14.  Troubleshooting Software Problems (Overview)

15.  Managing System Messages

16.  Managing Core Files (Tasks)

Managing Core Files (Task Map)

Managing Core Files Overview

Configurable Core File Paths

Expanded Core File Names

Setting the Core File Name Pattern

Enabling setuid Programs to Produce Core Files

How to Display the Current Core Dump Configuration

How to Set a Core File Name Pattern

How to Enable a Per-Process Core File Path

How to Enable a Global Core File Path

Troubleshooting Core File Problems

Examining Core Files

17.  Managing System Crash Information (Tasks)

18.  Troubleshooting Miscellaneous Software Problems (Tasks)

19.  Troubleshooting File Access Problems (Tasks)

20.  Resolving UFS File System Inconsistencies (Tasks)

21.  Troubleshooting Software Package Problems (Tasks)

Index

Managing Core Files Overview

Core files are generated when a process or application terminates abnormally. Core files are managed with the coreadm command.

For example, you can use the coreadm command to configure a system so that all process core files are placed in a single system directory. This means it is easier to track problems by examining the core files in a specific directory whenever a process or daemon terminates abnormally.

Configurable Core File Paths

Two new configurable core file paths that can be enabled or disabled independently of each other are:

When a process terminates abnormally, it produces a core file in the current directory by default. If the global core file path is enabled, each abnormally terminating process might produce two files, one in the current working directory, and one in the global core file location.

By default, a setuid process does not produce core files using either the global or per-process path.

Expanded Core File Names

If a global core file directory is enabled, core files can be distinguished from one another by using the variables described in the following table.

Variable Name
Variable Definition
%d
Executable file directory name, up to a maximum of MAXPATHLEN characters
%f
Executable file name, up to a maximum of MAXCOMLEN characters
%g
Effective group ID
%m
Machine name (uname -m)
%n
System node name (uname -n)
%p
Process ID
%t
Decimal value of time(2)
%u
Effective user ID
%z
Name of the zone in which process is executed (zonename)
%%
Literal %

For example, if the global core file path is set to:

/var/core/core.%f.%p

and a sendmail process with PID 12345 terminates abnormally, it produces the following core file:

/var/core/core.sendmail.12345

Setting the Core File Name Pattern

You can set a core file name pattern on a global, zone, or per-process basis. In addition, you can set the per-process defaults that persist across a system reboot.

For example, the following coreadm command sets the default per-process core file pattern. This setting applies to all processes that have not explicitly overridden the default core file pattern. This setting persists across system reboots.

# coreadm -i /var/core/core.%f.%p

The following coreadm command sets the per-process core file name pattern for any processes:

$ coreadm -p /var/core/core.%f.%p $$

The $$ symbols represent a placeholder for the process ID of the currently running shell. The per-process core file name pattern is inherited by all child processes.

Once a global or per-process core file name pattern is set, it must be enabled with the coreadm -e command. See the following procedures for more information.

You can set the core file name pattern for all processes run during a user's login session by putting the command in a user's $HOME/.profile or .login file.

Enabling setuid Programs to Produce Core Files

You can use the coreadm command to enable or disable setuid programs to produce core files for all system processes or on a per-process basis by setting the following paths:

By default, both flags are disabled. For security reasons, the global core file path must be a full pathname, starting with a leading /. If superuser disables per-process core files, individual users cannot obtain core files.

The setuid core files are owned by superuser with read/write permissions for superuser only. Regular users cannot access them even if the process that produced the setuid core file was owned by an ordinary user.

For more information, see the coreadm(1M) man page.

How to Display the Current Core Dump Configuration

Use the coreadm command without any options to display the current core dump configuration.

$ coreadm
               global core file pattern: 
     global core file content: default
       init core file pattern: core
       init core file content: default
            global core dumps: disabled
       per-process core dumps: enabled
      global setid core dumps: disabled
 per-process setid core dumps: disabled
     global core dump logging: disabled

How to Set a Core File Name Pattern

How to Enable a Per-Process Core File Path

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Enable a per-process core file path.
    # coreadm -e process
  3. Display the current process core file path to verify the configuration.
    $ coreadm $$
    1180:   /home/kryten/corefiles/%f.%p

How to Enable a Global Core File Path

  1. Become superuser or assume an equivalent role.

    Roles contain authorizations and privileged commands. For more information about roles, see Configuring RBAC (Task Map) in System Administration Guide: Security Services.

  2. Enable a global core file path.
    # coreadm -e global -g /var/core/core.%f.%p
  3. Display the current process core file path to verify the configuration.
    # coreadm
           global core file pattern: /var/core/core.%f.%p
         global core file content: default
           init core file pattern: core
           init core file content: default
                global core dumps: enabled
           per-process core dumps: enabled
          global setid core dumps: disabled
     per-process setid core dumps: disabled
         global core dump logging: disabled