Skip Navigation Links | |
Exit Print View | |
Troubleshooting Typical Issues in Oracle Solaris 11.1 Oracle Solaris 11.1 Information Library |
1. Managing System Crash Information (Tasks)
2. Managing Core Files (Tasks)
Setting the Core File Name Pattern
Enabling setuid Programs to Produce Core Files
Managing Core Files (Task Map)
Displaying the Current Core Dump Configuration
How to Set a Core File Name Pattern
Troubleshooting Core File Problems
3. Troubleshooting System and Software Problems (Tasks)
4. Troubleshooting Miscellaneous System and Software Problems (Tasks)
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.
Two following configurable core file paths that can be enabled or disabled independently of each other:
A per-process core file path, which defaults to core and is enabled by default. If enabled, the per-process core file path causes a core file to be produced when the process terminates abnormally. The per-process path is inherited by a new process from its parent process.
When generated, a per-process core file is owned by the owner of the process with read/write permissions for the owner. Only the owning user can view this file.
A global core file path, which defaults to core and is disabled by default. If enabled, an additional core file with the same content as the per-process core file is produced by using the global core file path.
When generated, a global core file is owned by root, with read/write permissions for root only. Non-privileged users cannot view this file.
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.
If a global core file directory is enabled, core files can be distinguished from one another by using the variables that are described in the following table.
|
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
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. This setting applies to all processes that have not explicitly overridden the default core file pattern. This setting persists across system reboots. For example, the following coreadm command sets the global core file pattern for all processes that are started by the init process. This pattern will persist 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.
After 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 that are run during a user's login session by putting the command in a user's initialization file, for example, .profile.
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:
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 file, 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.
|
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
# coreadm -e process
# coreadm $$ 1180: /home/kryten/corefiles/%f.%p
# coreadm -e global -g /var/core/core.%f.%p
# 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