linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ray Lee <ray-lk@madrabbit.org>
To: Lennart Poettering <mzxreary@0pointer.de>
Cc: Roland McGrath <roland@redhat.com>,
	Kay Sievers <kay.sievers@vrfy.org>,
	Oleg Nesterov <oleg@redhat.com>,
	linux-kernel@vger.kernel.org,
	Americo Wang <xiyou.wangcong@gmail.com>,
	James Morris <jmorris@namei.org>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Kyle McMartin <kyle@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Michael Kerrisk <mtk.manpages@googlemail.com>
Subject: Re: [PATCH] exit: PR_SET_ANCHOR for marking processes as reapers for  child processes
Date: Mon, 8 Mar 2010 16:45:38 -0800	[thread overview]
Message-ID: <2c0942db1003081645y4063ed29va6763151f53a282a@mail.gmail.com> (raw)
In-Reply-To: <20100306002414.GJ28657@tango.0pointer.de>

On Fri, Mar 5, 2010 at 4:24 PM, Lennart Poettering <mzxreary@0pointer.de> wrote:
> On Fri, 05.03.10 11:18, Roland McGrath (roland@redhat.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?

  reply	other threads:[~2010-03-09  0:51 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 12:04 [PATCH] exit: PR_SET_ANCHOR for marking processes as reapers for child processes Lennart Poettering
2010-02-03  8:24 ` KOSAKI Motohiro
2010-02-03  9:53   ` Lennart Poettering
2010-02-03 15:31 ` Américo Wang
2010-02-03 17:49   ` Lennart Poettering
2010-02-05  9:54     ` Américo Wang
2010-02-11 10:21       ` Kay Sievers
2010-02-04 15:42 ` Kay Sievers
2010-02-04 20:59   ` Kay Sievers
2010-03-04 14:08 ` Oleg Nesterov
2010-03-04 22:14   ` Roland McGrath
2010-03-05 18:51     ` Kay Sievers
2010-03-05 19:18       ` Roland McGrath
2010-03-06  0:24         ` Lennart Poettering
2010-03-09  0:45           ` Ray Lee [this message]
2010-03-09 13:19             ` Oleg Nesterov
2010-03-06  0:20     ` Lennart Poettering
2010-03-08 23:11       ` Roland McGrath
2010-03-05  4:47   ` KOSAKI Motohiro
2010-03-05 18:55     ` Kay Sievers
2010-03-06  0:16   ` Lennart Poettering
2010-03-11  4:14     ` Eric W. Biederman
2010-03-11  7:56       ` KOSAKI Motohiro
2010-12-20 14:26 ` Scott James Remnant
2010-12-20 14:51   ` Kay Sievers
2010-12-21  9:56   ` Lennart Poettering
2010-12-21 12:05     ` Scott James Remnant
2010-12-23 15:44       ` Lennart Poettering
2010-12-23 16:00         ` Scott James Remnant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c0942db1003081645y4063ed29va6763151f53a282a@mail.gmail.com \
    --to=ray-lk@madrabbit.org \
    --cc=jmorris@namei.org \
    --cc=kay.sievers@vrfy.org \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=kyle@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@googlemail.com \
    --cc=mzxreary@0pointer.de \
    --cc=oleg@redhat.com \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).