Operating System - HP-UX
1832690 Members
2575 Online
110043 Solutions
New Discussion

Core file management with HP-UX

 
SOLVED
Go to solution
Sabrina Lautier
Advisor

Core file management with HP-UX

All,

Is there way in HP-UX 11.11 to manage core files just like Solaris does with coreadm ?
On Solaris machines, we configured coreadm so that whenever a user generates a core file the OS automatically stores it in directory $HOME/corefiles/...

The core file removal is then made easy as we know where the core files exactly are (preventing high ressource consuming with "find / -name core -type f").

As most volumes are NFS imported is it important that the core file names contain the name of the machine.

Thx in advance for your help.
Rgds,
Sabrina
3 REPLIES 3
RAC_1
Honored Contributor

Re: Core file management with HP-UX

As far as I know, there is nothing very similar in hp-ux. The core is generated in current working dir of the program. (CWD)

There are ways to put some redirections here. Yoy can create a soft link. You can file (with name) with 0000 perms and it will not be written. you can point it to /dev/null

Anil
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Core file management with HP-UX

The only option for HP-UX is to optionally append the PID to "core" but the file is always written to the current working directory.

echo " core_addpid/W1" | adb -w /stand/vmunix /dev/kmem

This will ONLY change the memory image of the running kernel and leave the object file, /stand/vmunix, untouched. It's a safe command and this is a common practice for changing kernel values that otherwise can't be modified. You could also force the write to the object file but I prefer to simply change the image in /dev/kmem and if you want this to be a "permanent" change rather than writing the object file, I prefer to setup a startup script in /sbin/init.d.



Setting core_addpid (which already exists in your kernel) to 1 will have exactly the effect you are looking for. A core.nnnnn file will be produced in the CWD rather than simply 'core'.

Of course, this is really putting a band-aid on a problem. I can't imagine working in an environment where the generation of core files is considered routine. The real solution is to fix the code.
If it ain't broke, I can fix that.
Sabrina Lautier
Advisor

Re: Core file management with HP-UX

Thanks both of you for your help.
It's pity HP does not provide a solution close to coreadm.
I will use core_addpid to change the name of the core files and move them all every night to a dedicated directory.
Rgds,
Sabrina