Troubleshooting System Administration Issues in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

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, you can use the following coreadm command to set 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

You can use the following coreadm command to set 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.

Here's another example:
$ coreadm -p $HOME/corefiles/%f.%p $$

Alternately, 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 a user's login session by putting the command in a user's initialization file, for example, .profile.