Prevent Solaris Core Files Creation with coreadm

Core files provide debugging information about a process that has terminated unexpectedly. Unless you are developing an application, core files are typically of little use and can cause serious problems by filling up filesystems. This tech-recipe describes how to configure Solaris to turn off core file creation for processes.


The coreadm command controls the generation of core files. To determine the current coreadm settings, run coreadm as root. This will generate output such as the following:

global core file pattern:
init core file pattern: core
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

Given the sample configuration above, per-process core dumps are enabled. When a process terminates abnormally or receives an appropriate signal, it will generate a core file named ‘core’ in the working directory of the process.

To disable per-process core file creation, use the following:

coreadm -d process

This will modify the /etc/coreadm.conf which is read at boot when /etc/init.d/coreadm is executed from a runtime control script. To make permanent changes to coreadm, do not edit the /etc/coreadm.conf file. Use the coreadm command.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.