Go to main content

Troubleshooting System Administration Issues in Oracle® Solaris 11.3

Exit Print View

Updated: October 2017
 
 

Administering Your Core File Specifications

This section provides the following information about managing core files:

Displaying 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

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 per-process defaults that persist across a system reboot.

For example, the following coreadm command sets the default per-process core file pattern for all processes that are started by the init process. 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. For example:

$ coreadm -p $HOME/corefiles/%f.%p $$

Alternately, you could assume the root role and set a global file name pattern:

# coreadm -g /var/corefiles/%f.%p

After a global or per-process core file name pattern is set, it must be enabled with the coreadm -e command.

You can set the core file name pattern for all processes that are run during the login session of a user by providing the command in the initialization file of the user, for example, .profile.

Enabling File Paths

You can enable a per-process or global core file path.

  • To enable a per-process core file path, assume the root role and issue the following command:

    # coreadm -e process

    If you want to verify the configuration, display the current process core file path.

    # coreadm $$
    1180:   /home/kryten/corefiles/%f.%p
  • To enable a global core file path, assume the root role and issue the following command:

    # coreadm -e global -g /var/core/core.%f.%p

    If you want to verify the configuration, display the current process core file path.

    # 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

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 appropriate path.

  • If the global setuid option is enabled, a global core file path allows all setuid programs on a system to produce core files.

  • If the per-process setuid option is enabled, a per-process core file path allows specific setuid processes to produce core files.

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

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

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

Reverting to the Default Core File Settings

    As root, run one of the following commands to disable the core file path and remove the core file name pattern.

  • For global core file settings:

    # coreadm -d global -g ""

    Note -  "" is an empty string with no space.
  • For per-process core file settings:

    # coreadm -d process -g ""

    The –d option disables the core file path. The –g option with the empty string variable removes the core file name pattern. The core file path and core file name pattern are returned to the original default settings.

Correcting Obsolete Core File Parameters

The following message appears if you have an obsolete parameter that allows setuid core files in your /etc/system file:

 
NOTICE: 'set allow_setid_core = 1' in /etc/system is obsolete
NOTICE: Use the coreadm command instead of 'allow_setid_core'

To correct this problem, remove allow_setid_core=1 from the /etc/system file. Then use the coreadm command to enable global setuid core file paths.