I have, for a long time, wished that Linux had a way to specify where core dumps are stored and what the name of the core dump is. Now that I have been building large linux clusters with many diskless nodes, this need has become even more important. What I did with this patch is provide a new sysctl that lets you control the name of the core file. The this name is actually a format string such that certain values from the process can be included. The sysctl is kernel.core_name_format and is a string up to 63 characters (plus 1 for the null) The following format options are available in that string: %P The Process ID (current->pid) %U The UID of the process (current->uid) %N The command name of the process (current->comm) %H The nodename of the system (system_utsname.nodename) %% A "%" For example, in my clusters, I have an NFS R/W mount at /coredumps that all nodes have access to. The format string I use is: sysctl -w "kernel.core_name_format=/coredumps/%H-%N-%P.core" This then causes core dumps to be of the format: /coredumps/whale.sinz.org-badprogram-13917.core Only behavior of appending the PID to the "core" name is still supported with the added logic of only doing so if the PID is not already part of the name format. The default name format is still just "core" to match old behavior. NOTE - I was tempted to change the default format to be something like "%N.core" which would at least identify the program that caused the core file. However, I can do that as part of my init process so it is not a issue here. The attached patch is for Linux 2.4.17 but should patch relatively easily to other versions. I tried to commend the code a bit to explain the how and why. (I have also attached the patch to 2.5.4 It is nearly identical.) -- Michael Sinz ---- Worldgate Communications ---- msinz@wgate.com A master's secrets are only as good as the master's ability to explain them to others.