Core files are generated when a process or an application terminates abnormally. You can manage the core files 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 process or daemon terminates abnormally.
Before configuring your system for the core files, make sure that the /var file system has sufficient space. Once you configure Solaris to generate the core files, a core file is written to the /var/cores directory every time a process crashes.
Run the following commands as root.
mkdir -p /var/cores coreadm -g /var/cores/%f.%n.%p.%t.core -e global -e global-setid -e log -d process -d proc-setid
In this command:
Specifies the global core file name pattern. Unless a per-process pattern or setting overrides it, core files are stored in the specified directory with a name such as program.node.pid.time.core, for example: mytest.myhost.1234.1102010309.core.
Specifies options to enable. The preceding command enables:
Use of the global (that is, system-wide) core file name pattern (and thereby location)
Capability of setuid programs to also dump core as per the same pattern
Generation of a syslog message by any attempt to dump core (successful or not)
Specifies options to disable. The preceding command disables:
Core dumps per the per-process core file pattern
Per-process core dumps of setuid programs
The preceding command stores all core dumps in a central location with names identifying what process dumped core and when. These changes only impact processes started after you run the coreadm command. Use the coreadm -u command after the preceding command to apply the settings to all existing processes.
Display the core configuration.
# coreadmglobal core file pattern: /var/cores/%f.%n.%p.%t.core init core file pattern: core global core dumps: enabled per-process core dumps: disabled global setid core dumps: enabled per-process setid core dumps: disabled global core dump logging: enabled |
See the coreadm man page for further information.
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.
If the Web Server instance is running in SSL mode, it does not generate a core file . To enable the instance to generate the core file, add the following line to the server start script start.
SSL_DUMP=1; export SSL_DUMP
This step applies to Web Server 6.0 and 6.1. If you are using Web Server 7.0, this step must be skipped.
Verify the core file creation.
# cd /var/cores # sleep 100000 & [1] PID # kill -8 PID # ls |