LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Enabling core dump (https://www.linuxquestions.org/questions/programming-9/enabling-core-dump-538073/)

sidra 03-16-2007 01:25 PM

Enabling core dump
 
Hi,

I'm trying to enable core dump in RHEL 4.0. When i use the 'ulimit -c unlimited' command from the command line it works. However when i put in in a script it doesn't work. I believe it's a shell command. How can i do this in a script. I tried putting it in a shell function and calling it but it doesn't work. I also tried modifying the hard and soft limits for core in /etc/security/limits.conf to no avail.

Some insight would be great!

wjevans_7d1@yahoo.co 03-16-2007 07:43 PM

This is just a shot in the dark, but in your script, just after the "ulimit -c unlimited" statement, put a "ulimit -c" statement and see whether the output is "unlimited". That won't solve your problem, but it will narrow it down a little.

omnio 03-18-2007 09:25 AM

Quote:

Originally Posted by sidra
I also tried modifying the hard and soft limits for core in /etc/security/limits.conf to no avail.

What about this:
Code:

echo "ulimit -c unlimited" >> /etc/profile
source /etc/profile


Thinking 03-18-2007 05:34 PM

i'm not sure but to change core limit you have to be root
so check if your script runs with root privileges

wjevans_7d1@yahoo.co 03-19-2007 09:16 AM

There's more than one limit to core dumps. Only root can change your absolute limit, but within that, you can vary whether you dump core. So even if you're not root, I repeat:

Code:

ulimit -c unlimited
ulimit -c

... and if that second line returns "unlimited", then put the first line in /etc/profile, as omnio suggests.


All times are GMT -5. The time now is 03:02 PM.