[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c0942db1003081645y4063ed29va6763151f53a282a@mail.gmail.com>
Date: Mon, 8 Mar 2010 16:45:38 -0800
From: Ray Lee <ray-lk@...rabbit.org>
To: Lennart Poettering <mzxreary@...inter.de>
Cc: Roland McGrath <roland@...hat.com>,
Kay Sievers <kay.sievers@...y.org>,
Oleg Nesterov <oleg@...hat.com>, linux-kernel@...r.kernel.org,
Americo Wang <xiyou.wangcong@...il.com>,
James Morris <jmorris@...ei.org>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Kyle McMartin <kyle@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Michael Kerrisk <mtk.manpages@...glemail.com>
Subject: Re: [PATCH] exit: PR_SET_ANCHOR for marking processes as reapers for
child processes
On Fri, Mar 5, 2010 at 4:24 PM, Lennart Poettering <mzxreary@...inter.de> wrote:
> On Fri, 05.03.10 11:18, Roland McGrath (roland@...hat.com) wrote:
>
>>
>> > Oh, no. Actually getting the SIGCHILD is the needed feature here. A
>> > process who sets the ANCHOR flag is surely expected to handle these
>> > signals. It's all about a user "init-like" process" that can do
>> > similar things for a logged-in user what /sbin/init can to for the
>> > system. So, it's all about 1.), and 3.) is a nice side-effect, but not
>> > the motivation to do this.
>>
>> Please explain this more explicitly. What the actual init does with
>> miscellaneous reparented processes is just reap them and ignore their
>> status. What do you intend an "anchor" process to do other than that?
>
> It could use the grandchildren's SIGCHLDs for various task management
> issues: i.e. watching double-forking daemons, catch SIGSEGVS so that you
> can crosslink that service state to systems like abrt. Or even just that
> you can implement a safe restarting logic: i.e. so that we can easily
> wait that a process and its children are fully dead before we restart
> the service.
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).
Would this existing mechanism cover what you need?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists