Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

corefiles 2

Status
Not open for further replies.

mrn

MIS
Apr 27, 2001
3,993
GB
Using AIX 5.2 is it possible to timestamp a corefile when its created. We have a porcess that is core dumping but it's being overwritten each time. I know I could use the syscorepath and get core.pid but wanted to leave the core in its original location.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
You could use 'chcore' to change the corefile name after it is written.

Do a man on chcore.

Regards,
Chuck
 
I don't have chcore. I believe this was only introduced in 5.3

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
I've read it can be done with environment settings but can't find an example.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Sorry, you are correct. I was on my 5.3 box here.

If the core files are being placed in the same directory each time, you could write a small script to check for any core files and then rename the file with a timestamp that would run out of cron every 5 minutes for example.

If you're up on perl, you could also create a daemon to check for the same core files and then rename if it finds one. This bypasses having to use cron.


Regards,
Chuck
 
Thanks Chuck,

I'm still interested in any other methods anyone can come up with.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Hi Mike,

I think from 5.1 onwards you can use the CORE_NAMING env var.

Try setting it to yes, and see if that gets the behaviour your after.

All the Best. :)

____________________
Sometimes it pays to stay in bed on Monday, rather than spending the rest of the week debuging Mondays code.
 
Where is it set? In the users environment?

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
from :

Core file naming enhancements
Core file naming enhancements (5.1.0) AIX 5L Version 5.1 has changed the way it names the core file used for a core dump. In earlier AIX releases, a core file was always named core. If more than one application dumped or the same application dumped more than once, you always lost the earlier core file. Beginning with AIX 5L Version 5.1, each core file can be uniquely named so no core file will be overwritten with a new one. This feature helps debugging and tracing application failures.
By default, a new core file is named core. To enable the new enhancement, set the CORE_NAMING environment variable to yes. After setting the CORE_NAMING variable, the new core file names are of the format core.pid.ddhhmmss, where:

pid Process ID
dd Day of the month

Put the line
CORE_NAMING=yes
in the file /etc/environment

So that all new processes (ALL processes on next reboot) know about that variable.

HTH,

p5wizard
 
Thanks to all for you help; I just found the same doc wiz.

Mike

"A foolproof method for sculpting an elephant: first, get a huge block of marble, then you chip away everything that doesn't look like an elephant."

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top