LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-16-2007, 01:25 PM   #1
sidra
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora Core 3, Red Hat 9, CentOS 4.2, Mandriva, Ret Hat Enterprise Linux 4.0
Posts: 116

Rep: Reputation: 15
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!
 
Old 03-16-2007, 07:43 PM   #2
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
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.
 
Old 03-18-2007, 09:25 AM   #3
omnio
Member
 
Registered: Feb 2007
Location: $HOME
Distribution: Hardened Gentoo
Posts: 66
Blog Entries: 1

Rep: Reputation: 16
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

Last edited by omnio; 03-18-2007 at 09:30 AM.
 
Old 03-18-2007, 05:34 PM   #4
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
i'm not sure but to change core limit you have to be root
so check if your script runs with root privileges
 
Old 03-19-2007, 09:16 AM   #5
wjevans_7d1@yahoo.co
Member
 
Registered: Jun 2006
Location: Mariposa
Distribution: Slackware 9.1
Posts: 938

Rep: Reputation: 31
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is core dump and how to do it dayalan_cse Programming 3 11-03-2006 12:59 AM
Core Dump! khaleel5000 Linux - Software 6 06-29-2006 05:21 AM
Core Dump MrPotatoHead AIX 3 01-14-2004 09:42 AM
core dump tomservo Linux - General 4 09-23-2002 05:35 PM
core dump lacrimae Linux - General 3 02-19-2002 01:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration