Core files are generated when a process or 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 will enable you to track problems by examining the core files in a specific directory whenever a Solaris OS 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.core -e global -e process -e \ global-setid -e proc-setid -e log
View the core configuration.
# coreadm global core file pattern: init core file pattern: %f.%n.%p.core global core dumps: enabled per-process core dumps: enabled global setid core dumps: enabled per-process setid core dumps: enabled 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.
You may find that when you issue a kill -SEGV or a kill -BUS commands, the core file is not generated even though you have done the necessary setting using the coreadm command. To enable the instance to generate the core file, add the following line to the Proxy Server start script.
The start file looks like (# more server-root/proxy-identifier/start):
#!/bin/shcd /proxyserver/p36sp5/bin/proxy: ./ns-proxy -d /proxyserver/p36sp5/proxy-sun-proxy/config $@
Replace the start file with the following:
#!/bin/shcd /proxyserver/p36sp5/bin/proxy: ./ns-proxy -c -d /proxyserver/p36sp5/proxy-sun-proxy/config $@
The change is that -c is added before -d
You must restart the modified Proxy Server instance. When you issue a kill -SEGV or a kill -BUS, it will generate a core file under the proxy-instance/config directory.
Verify core file creation.
# cd /var/cores # sleep 100000 & [1] PID # kill -8 PID # ls |