LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 05-26-2011, 09:21 AM   #1
sadasreddy
LQ Newbie
 
Registered: May 2011
Posts: 1

Rep: Reputation: Disabled
How to limit the total size of core files and automatically clean old core files?


Hi All,
I have a situation like below. I am using RHEL 5.

I have multiple user processes running on my machine.
I have set the appropriate sizes for core file size.
But my process management deamon is designed to restart any process that terminates.
Hence the process starts up again.
If I have a very bad nasty defect like say SEGV, it will keep on dumping core and restarting and hence filling my machine with core files until I run out of space on the partition.

My Questions:

Is there a provision in Linux to automatically cleanup the old corefiles when we reach a certain limit ?
Is there a provision in Linux to set a upper limit for space occupied by all core files (not individual core files) ?


Any inputs appreciated.

Thanks,
SADA
 
Old 05-27-2011, 11:51 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Buster (Fluxbox WM)
Posts: 1,389
Blog Entries: 52

Rep: Reputation: 358Reputation: 358Reputation: 358Reputation: 358
If you set an appropriate naming pattern for the core files in /proc/sys/kernel/core_pattern, you can at least partially solve the problem:

* set a generic filename, so that subsequent core dumps overwrite the older ones
* or set a full path to a partition that is not critical
* or set a full path to a particular directory, and have a daemon that makes use of inotify to limit the number of files in that directory to a manageable size (even just a script that uses the inotify-tools)
* or use a cron job to search for and delete excess core files

Last edited by neonsignal; 05-27-2011 at 11:53 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Total particular files size in a directory kirukan Linux - Newbie 3 01-03-2010 02:48 PM
core dump file size exceeds limit with ulimit -f unlimited. initpidzero Linux - Software 0 07-28-2009 02:08 AM
ulimit -c does not limit the core file size after a particular point meetolnx Linux - Newbie 2 10-04-2007 12:08 AM
Total size of directory and zipped files veeruk101 Linux - Newbie 1 07-17-2007 10:32 PM
finding size of total files in a directory blackzone Linux - Newbie 3 01-07-2005 03:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration