Tuesday, January 8, 2008

How to setup Core dump in Solaris?

Generally, in Solaris, coredumps are generated in the same directory from where the command is issued (which caused a core dump). In place of having those core dumps in splitted locations, I would prefer to have them at a common place with some more details in the name of core file itself.

Here is how I would do the coredump setup in Solaris 10:

# coreadm -i /var/core/core.%n.%f.%u

Here is how I would verify my core dump settings:
# coreadm
global core file pattern:
global core file content: default
init core file pattern: /var/core/core.%n.%f.%u
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

In order coreadm to work, make sure that following service is running (if not, make it online):
# svcs coreadm
online Jan_07 svc:/system/coreadm:default

In following command, I am checking whether any core dump is generated:
# ls -l /var/core
total 15680
-rw------- 1 root root 8015855 Dec 31 11:47 core.abcnetbackup.PRG-rds.UID-0.PID-5837

Explanation of core file name:
core.abcnetbackup.PRG-rds.UID-0.PID-5837
core -----> Name indicates that it is a core file
abcnetbackup ----> Hostname
PRG-rds ----> Which program generated this core
UID-0 -----> Which user
PID-5837 ------> What was the PID of program which generated the core

No comments: