Messages in this thread | | | Date | Tue, 9 Mar 2010 14:19:35 +0100 | From | Oleg Nesterov <> | Subject | Re: [PATCH] exit: PR_SET_ANCHOR for marking processes as reapers for child processes |
| |
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.
| |