Operating System - HP-UX
1834798 Members
2814 Online
110070 Solutions
New Discussion

Re: core files in home directory

 
George Morrison
Frequent Advisor

core files in home directory

We routinely disable core file generation in /etc/profile: ulimit -c 0. Recently, I disabled this on one server to accomodate a test. The user confirmed that ulimit -a shows coredump unlimited, however could not get a corefile to be generated using a simple program I created. After further checking, the test program would produce a core file if the current directory was not his home director, e.g., /var/tmp. For example,


$ ulimit -a
...
coredump unlimted
...
$ ./coretest
Bus error
$ # Note - no core file produced.
$ cd /var/tmp
$ ~/coretest
Bus error (coredump)
$ # now a core file has been produced

The user does "log in" via sudo - does that matter? Any idea why a core dump would be PWD specific?!?!
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: core files in home directory

Hi:

Regardless of what the current directory is, a zero-length core file should be produced if you set the coresize to 0.

However, unless the login causes your '/etc/profile' to be run your mechanism will not be armed. For instance, doing 'su user' instead of a 'su - user' skips running '/etc/profile' and thus your revised 'ulimit' isn't set.

Regards!

...JRF...
Geoff Wild
Honored Contributor

Re: core files in home directory

Is his home directory a NFS automount?

That may be why it works elsewhere.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
George Morrison
Frequent Advisor

Re: core files in home directory

Thanks to all who responded. The problem was specific to the home directory because the home directory had a directory named core. HP-UX will not write out a core file if the process owner does not have write permission to the directory or if the directry contains an unwritable file, e.g. a directory or a self referential soft link (ln -s core .).

Thanks!
George Morrison
Frequent Advisor

Re: core files in home directory

See my reply above.