Re: [PATCH 2.6.25-4] getdelays.c: signal handling for log rotation

From: Andrew Morton
Date: Mon Jun 30 2008 - 15:54:22 EST


On Fri, 6 Jun 2008 14:47:04 -0600
Scott Wiersdorf <scott@xxxxxxxxxxxx> wrote:

> On Fri, Jun 06, 2008 at 03:59:09PM +0200, Andi Kleen wrote:
> > Scott Wiersdorf <scott@xxxxxxxxxxxx> 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?)
>
> 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).
>

I've somewhat lost track of the discussion here. Could you please send
a new patch which reflects the changes whcih you decided to make?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/