Re: [PATCH] exit: PR_SET_ANCHOR for marking processes as reapersfor child processes

From: Oleg Nesterov
Date: Tue Mar 09 2010 - 08:21:42 EST


On 03/08, Ray Lee wrote:
>
> The kernel already offers system-wide process exit notification via
> taskstats (a netlink interface), though unfortunately I believe it's
> optional. It's pretty easy to use (as these things go, anyway -- I was
> able to hack up an arbitrary process exit watcher in about a half hour
> based on Documentation/accounting/getdelays.c).

Or proc connector (optional too). Unlike taskstats it notifies about
fork() as well. But, iirc it doesn't allow to filter out the unwanted pids.

Actually, I don't really understand how PR_SET_ANCHOR task can monitor
several daemons. I mean, when the grandchild dies, the sub-init doesn't
know who forked this child during daemonize().


Cough, can't resist... With utrace it would very simple to create the
module which allows to monitor the child's fork/exit/etc with almost
zero overhead, and this overhead only applies to the "traced" tasks.

Oleg.

--
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/