public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: anyone ever implemented a reparent(pid) syscall?
Date: Fri, 09 May 2003 14:54:29 -0400	[thread overview]
Message-ID: <3EBBF965.4060001@nortelnetworks.com> (raw)


I've got some other developers wanting some way for a process to be notified on 
the death of another process.  Now I understand that if all the processes are 
forked by a main one, then the main one will get a SIGCHILD on the death of the 
other processes.

The problem with this is that if the main one dies, then all the other ones get 
reparented to init.  I would like some way for the main one to restart, read the 
list of pids out of a file that it conveniently stashed away, and reparent the 
pids back to itself (the same way that they were reparented to init in the first 
place) so that it gets SIGCHILD when they die.

Once I have this ability, then it becomes simple for arbitrary processes to 
register with it so that others can be notified in some standard way if they die.

Has anyone ever done this?  Is there any reason why it is a particularly bad idea?

Thanks,

Chris

-- 
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com


             reply	other threads:[~2003-05-09 18:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-09 18:54 Chris Friesen [this message]
2003-05-10  9:39 ` anyone ever implemented a reparent(pid) syscall? Werner Almesberger
2003-05-12  3:23   ` Chris Friesen
2003-05-12  7:33     ` Werner Almesberger
2003-05-12 14:03       ` Chris Friesen

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=3EBBF965.4060001@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    /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