1835912 Members
3165 Online
110087 Solutions
New Discussion

Re: Custom coredump file

 
SOLVED
Go to solution
Delcho Tuhchiev
Frequent Advisor

Custom coredump file

Hi all.
I've question aboute custom generated core files. So, I want to make a convention name to the core files (generated from specific application which is running with a specific user) such as
core.process_name.process_id
and to set a limit of 1G for these core files.
4 REPLIES 4
Ivan Krastev
Honored Contributor
Solution

Re: Custom coredump file

Only in 11v3 with coreadm - http://docs.hp.com/en/B2355-60130/coreadm.1M.html

regards,
ivan
Dennis Handly
Acclaimed Contributor

Re: Custom coredump file

Bill Hassell
Honored Contributor

Re: Custom coredump file

> make a convention name to the core files...

Already available for 11.11, 11.23 and 11.31. As mentioned, 11.31 has coreadm, but for 11.11 and 11.23, there is a secret (well, not well documented) way to do this. The kernel parameter core_addpid will do exactly what you want, that is, every core file will have the PID added to the end of the filename. Here is how to do it:

11.11
echo "core_addpid/W 1" | adb -o -w /stand/vmunix /dev/kmem

11.23
echo "core_addpid/W 1" | adb -k -w /stand/vmunix /dev/kmem

This is not settable in SAM (hence, secret, undocumented) but you can set the value with a start-script so it always exists for your system. (there is no core_addpid location prior to 11.11) Note that you can't change the main filename (core), but you can append the PID to each core dump.

And as mentioned, ulimit -C can limit the core file size. Lesser known are the -H and -S options to ulimit -c. By default, ulimit -c sets the maximum core file size. Once you lower it, it cannot be raised in the current environment. So, ulmit -c 1000 is the same as ulimit -Hc 1000 and ulimit -HC 2000 will fail because it cannot be raised. But use the -S option and now you can change the limit at any time during your session.

A common technique is to use ulimit -Sc 0 in /etc/profile so that no one can create a core file unless they specifically increase the value. Then developers can set ulimit -Sc 1000000 (or whatever) in their .profile or just pick a core dump size for each test.


Bill Hassell, sysadmin
Delcho Tuhchiev
Frequent Advisor

Re: Custom coredump file

...