Operating System - HP-UX
1753916 Members
7960 Online
108810 Solutions
New Discussion юеВ

How to change the default core dump directory to /tmp?

 
SOLVED
Go to solution
MA Qiang
Regular Advisor

How to change the default core dump directory to /tmp?

Thanks.
6 REPLIES 6
Enrico P.
Honored Contributor

Re: How to change the default core dump directory to /tmp?

Hi,

vi /etc/rc.config.d/savecrash

SAVECRASH=1

SAVECRASH_DIR=/tmp

Enrico
Steven E. Protter
Exalted Contributor

Re: How to change the default core dump directory to /tmp?

Shalom,

Core dumps by default are where the program was run.

If they are getting annoying, providing no value or filling up disk drive they can be disabled.

ulimit -Sc 0

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mridul Shrivastava
Honored Contributor

Re: How to change the default core dump directory to /tmp?

edit /etc/rc.config.d/savecrash :
SAVECRASH=1
SAVECRASH_DIR= /var/adm/crash <-- This should be large enough to save a full dump.
Its always recommendd to have sufficient space in dump directory (atleast equivalent to physical memory).
Dump space is nothing more than swap space. When a system is running under
normal circumstances the swap space is used as swap but when a system
crashes that same space is then used as a dump area. To determine the
amount of available swap space issue swapinfo.

# swapinfo
Kb Kb Kb PCT START/ RESERVE
TYPE AVAIL USED FREE USED LIMIT kb PRI NAME
dev 524288 24620 499668 5% 0 - 1
/dev/vg00/lvol2
reserve - 251584 -251584
memory 291208 114040 177168 39%

In the example above the only swap space is /dev/vg00/lvol2 with 524288kb
Time has a wonderful way of weeding out the trivial
Bill Hassell
Honored Contributor
Solution

Re: How to change the default core dump directory to /tmp?

As you can see, there are two meanings for the term core dump. The most common is for core files produced by programs. They are called "core" and are always created in the current working directory where the program is running. You cannot redirect the file to another location. If the core dumps are not needed, then use the ulimit command mentioned above just before starting the programs that are crashing and no core dump will be produced at all. Note that in SysV V.4 filesystem layout, the /tmp directory is used for system processes while /var/tmp is the preferred location for user files.

The other core dump is called a system panic and that's where you would edit the crashconf file. Note that /tmp is far too small to hold a carsh dump.


Bill Hassell, sysadmin
MA Qiang
Regular Advisor

Re: How to change the default core dump directory to /tmp?

/etc/rc.config.d/savecrash is used for system crash dumps. What about user's core dump file?
Michael Steele_2
Honored Contributor

Re: How to change the default core dump directory to /tmp?

Its the current working directory but here's a good discussion about it:

http://forums1.itrc.hp.com/service/forums/bizsupport/questionanswer.do?threadId=728058&admit=-682735245+1149515421307+28353475
Support Fatherhood - Stop Family Law