lkml.org 
[lkml]   [2008]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateSat, 07 Jun 2008 03:13:01 +0200
FromAndi Kleen <>
SubjectRe: [PATCH 2.6.25-4] getdelays.c: signal handling for log rotation
Scott Wiersdorf wrote:
> On Fri, Jun 06, 2008 at 03:59:09PM +0200, Andi Kleen wrote:
>> Scott Wiersdorf <scott@perlcode.org> writes:
>>
>>> This adds a USR1 signal handler to getdelays.c, which causes getdelays
>>> to close its logfile and reopen it (if '-w logfile' is
>>> specified). This is useful in situations when getdelays is running for
>>> a long time (i.e, the log file growing) and you need to rotate the
>>> logs but don't want to lose any log data.
>> You could do the same by sending SIGSTOP; copy file; truncate file; SIGCONT
>
> Actually, I was wrong in my previous reply. Sorry for my error. The
> above will work fine (no data loss; I guess the data queues somewhere
> in some magic way?)

netlink has a socket buffer like all other buffer. I think it's around
128K.

> I still think a single handler is elegant enough though, and works
> better with many log rotation systems that want to send a single
> signal to a pid (it's what we need where I'm working now, hence the
> patch).

Well in general it would be cool if there was nicer free userland for
the obscure but useful delay accounting. The code in Documentation
is really not much more than a example. Do you have something downloadable?

-Andi



\
 
 \ /
  Last update: 2008-06-07 03:33    [from the cache]
©2003-2010