lkml.org 
[lkml]   [2008]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2.6.25-4] getdelays.c: signal handling for log rotation
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

I believe it, but you can miss a lot of important stuff between STOP
and CONT, especially on a busy system. With a single handler that
reopens the file, you'll miss at most one netlink datum packet, and
most of the time you'll miss nothing.

Scott
--
Scott Wiersdorf
<scott@bluehost.com>


\
 
 \ /
  Last update: 2008-06-06 23:07    [W:0.283 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site