From owner-freebsd-hackers Sat May 24 07:13:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id HAA26520 for hackers-outgoing; Sat, 24 May 1997 07:13:50 -0700 (PDT) Received: from feephi.phofarm.com (gate.phofarm.com [206.21.77.129]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id HAA26507 for ; Sat, 24 May 1997 07:13:46 -0700 (PDT) Received: from feephi.phofarm.com (feephi.phofarm.com [206.21.77.130]) by feephi.phofarm.com (8.8.5/8.8.5) with SMTP id KAA03654 for ; Sat, 24 May 1997 10:11:12 -0400 (EDT) Message-ID: <3386F6FA.41C67EA6@phofarm.com> Date: Sat, 24 May 1997 10:11:06 -0400 From: "Danny J. Zerkel" Organization: Photon Farmers X-Mailer: Mozilla 3.01 (X11; I; FreeBSD 2.2-STABLE i386) MIME-Version: 1.0 To: hackers@freebsd.org Subject: Re: process monitoring tool (like SysV init) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As Daniel O'Callaghan wrote: >On Thu, 22 May 1997, Stephen McKay wrote: ... >> I like the idea of a nanny type program, but can't decide whether it should >> be merged with init, much like System V, or kept separate like inetd. > >The question in my mind is "How does the nanny know that the program has >died?". If the program does not daemonise itself, then SIGCLD takes care >of that, but if the program *does* daemonise itself, what then? Would it >be possible for the kernel to signal an event such as a process dying? >Does it do this already? One simple, imperfect way is to grab a pid from >/var/run, and then watch /proc/{pid}/status. Back in my AT&T days, someone had hacked SVR2 and SVR3 to allow process adoption. Presumably there was some way of detecting that a process has been orphaned and then to adopt it as a child. I don't know the specifics but the work was done by someone who worked on CB Unix (Columbus). Many of the CB Unix changes made it into SysV (including stuff for init). The process adoption was done later, I believe (though it may have been in CB Unix, also). Danny J. Zerkel Photon Farmers dzerkel@phofarm.com