All of lore.kernel.org
 help / color / mirror / Atom feed
* How to limit the total size used by core files or automatically delete old corefiles.
@ 2011-05-26 12:31 SADA SIVA REDDY S
  2011-05-26 16:05 ` Andrzej Kardas
  2011-05-26 21:55 ` Manish Katiyar
  0 siblings, 2 replies; 4+ messages in thread
From: SADA SIVA REDDY S @ 2011-05-26 12:31 UTC (permalink / raw)
  To: kernelnewbies

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


   1. I have multiple user processes running on my machine.
   2. I have set the appropriate sizes for core file size.
   3. But my process maangement demon is designed to restart any process
   that terminates.
   4. Hence the process starts up again.
   5. If I have a very bad nasty defect, it will keep on filling my machine
   with core files until I run out of space on the partition.

My Questions:

   1. Is there a provision in Linux to automatically cleanup the old
   corefiles when we reach a certain limit ?
   2. 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110526/01909d82/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How to limit the total size used by core files or automatically delete old corefiles.
  2011-05-26 12:31 How to limit the total size used by core files or automatically delete old corefiles SADA SIVA REDDY S
@ 2011-05-26 16:05 ` Andrzej Kardas
  2011-05-26 21:55 ` Manish Katiyar
  1 sibling, 0 replies; 4+ messages in thread
From: Andrzej Kardas @ 2011-05-26 16:05 UTC (permalink / raw)
  To: kernelnewbies



On 26.05.2011 14:31, SADA SIVA REDDY S wrote:
> My Questions:
>
>    1. Is there a provision in Linux to automatically cleanup the old
>       corefiles when we reach a certain limit ?
>
I  think there is no such feature. Core dump is regular file saved in 
default process directory, and system doesn't trace these files, it 
simply generates core dump and forget about it (on other words, system 
treats core dumps as regular file and doesn't know that is a core dump 
file).
>
>    1. Is there a provision in Linux to set a upper limit for space
>       occupied by all core files (not individual core files) ?
>
I think no, you can limit size of generated core dump per file, per user 
(ulimit -c).


But, you can change destination of all core dump files by add line

kernel.core_pattern = /vol/allcoredumps/%u/%e

in /etc/sysctl.conf


After that, you can write a simple script to check amount of free space, 
schedule it into crontab. When free space will be below certain limit, 
script should remove oldest or biggest files from above location.

Below, list of available patterns:
|
%p: pid
%: '%' is dropped
%%: output one '%'
%u: uid
%g: gid
%s: signal number
%t: UNIX time of dump
%h: hostname
%e: executable filename
%: both are dropped|

--
regards
Andrzej Kardas
http://www.linux.mynotes.pl


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110526/a0ea1a7f/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How to limit the total size used by core files or automatically delete old corefiles.
  2011-05-26 12:31 How to limit the total size used by core files or automatically delete old corefiles SADA SIVA REDDY S
  2011-05-26 16:05 ` Andrzej Kardas
@ 2011-05-26 21:55 ` Manish Katiyar
  2011-05-27  8:11   ` SADA SIVA REDDY S
  1 sibling, 1 reply; 4+ messages in thread
From: Manish Katiyar @ 2011-05-26 21:55 UTC (permalink / raw)
  To: kernelnewbies

On Thu, May 26, 2011 at 5:31 AM, SADA SIVA REDDY S
<sadasiva.reddy@gmail.com> wrote:
> 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 maangement demon is designed to restart any process that
> terminates.
> Hence the process starts up again.
> If I have a very bad nasty defect, it will keep on 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.

May be "man logrotate" can help.

-- 
Thanks -
Manish

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How to limit the total size used by core files or automatically delete old corefiles.
  2011-05-26 21:55 ` Manish Katiyar
@ 2011-05-27  8:11   ` SADA SIVA REDDY S
  0 siblings, 0 replies; 4+ messages in thread
From: SADA SIVA REDDY S @ 2011-05-27  8:11 UTC (permalink / raw)
  To: kernelnewbies

Thanks Andrej and Manish.
I will try to see if I can use logrotat or atleast buy the logic from it.

Thanks,
SADA

On Thu, May 26, 2011 at 10:55 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:

> On Thu, May 26, 2011 at 5:31 AM, SADA SIVA REDDY S
> <sadasiva.reddy@gmail.com> wrote:
> > 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 maangement demon is designed to restart any process that
> > terminates.
> > Hence the process starts up again.
> > If I have a very bad nasty defect, it will keep on 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.
>
> May be "man logrotate" can help.
>
> --
> Thanks -
> Manish
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110527/a4d8edad/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-27  8:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-26 12:31 How to limit the total size used by core files or automatically delete old corefiles SADA SIVA REDDY S
2011-05-26 16:05 ` Andrzej Kardas
2011-05-26 21:55 ` Manish Katiyar
2011-05-27  8:11   ` SADA SIVA REDDY S

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.