From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1429 Path: news.gmane.org!not-for-mail From: Adam Megacz Newsgroups: gmane.comp.sysutils.supervision.general Subject: orphan processes Date: Tue, 05 Jun 2007 17:17:42 -0700 Organization: Myself Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1181089088 21039 80.91.229.12 (6 Jun 2007 00:18:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2007 00:18:08 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1666-gcsg-supervision=m.gmane.org@list.skarnet.org Wed Jun 06 02:18:07 2007 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1HvjDz-0003Qg-2t for gcsg-supervision@gmane.org; Wed, 06 Jun 2007 02:18:07 +0200 Original-Received: (qmail 876 invoked by uid 76); 6 Jun 2007 00:18:27 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 865 invoked from network); 6 Jun 2007 00:18:27 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: chaitin.megacz.com X-Home-Page: http://www.megacz.com/ User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:joA+W8msuu+Mog762expHjN/Fjo= Original-Sender: news Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1429 Archived-At: I've got some media-encoding scripts running under runit that seem to cause orphan processes quite a lot -- in some chain of script invocations, runsv | +-- script1.sh | +-- script2.sh | +-- script3.sh Somehow script2.sh dies, script3 gets reparented to init (I'm running runit-as-a-child-of-svrinit), and then eventually when script1 finishes and the whole thing restarts, I wind up with two copies of script3.sh. Anyways, this got me thinking: is there any way in UNIX for the leader of a process/session group to tell the system that orphan processes in that group should be reparented to the leader rather than "pid 1"? If there were some way, I could add an option to runsv to tell it to immediately kill any process which unexpectedly becomes its child (ie orphans). - a -- PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380