From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2016 Path: news.gmane.org!not-for-mail From: Wayne Marshall Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: pidsig 0.11 - a fghack like de-daemonisation tool Date: Fri, 4 Jun 2010 16:26:24 +0000 Organization: guinix international Message-ID: <20100604162624.5a24e83c@slate.copperisle.com> References: <20100602184653.GA20534@skarnet.org> <20100603192530.GA19916@skarnet.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1275668749 27313 80.91.229.12 (4 Jun 2010 16:25:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Jun 2010 16:25:49 +0000 (UTC) To: Laurent Bercot , supervision@list.skarnet.org Original-X-From: supervision-return-2251-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Jun 04 18:25:47 2010 connect(): No such file or directory Return-path: Envelope-to: gcsg-supervision@lo.gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1OKZiL-0007GC-T3 for gcsg-supervision@lo.gmane.org; Fri, 04 Jun 2010 18:25:45 +0200 Original-Received: (qmail 28213 invoked by uid 76); 4 Jun 2010 16:27:50 -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 28196 invoked from network); 4 Jun 2010 16:27:49 -0000 In-Reply-To: <20100603192530.GA19916@skarnet.org> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.16.6; i386--netbsdelf) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2016 Archived-At: On Thu, 3 Jun 2010 21:25:30 +0200 Laurent Bercot wrote: > > These kinds of problems are not that theoretical - just > > recently I saw svscan/svscanboot crashing on a >1y uptime > > box, taking many of the processes with it, including most of > > the supervise infrastructure, very likely not due to any > > fault in them - could be oom gone wild, cosmic rays hitting > > svscan memory, whatever). > > That's a typical case of "weak" supervision, as opposed to a > "strong" supervision chain. "Strong" supervision makes sure > that all the infrastructure is connected to init. > > * svscan achieves strong supervision *if* svscanboot is > flagged as "respawn" in /etc/inittab on System V-style inits, > in /etc/event.d/ with Upstart, or in /etc/gettys on BSD. It > does *not* achieve it if svscanboot is started via some > rc.local script (as the stock daemontools instructions tell > you to do, shame on DJB! :)) > * perp is in the same boat, depending on how you start > perpboot. > ... > Strong supervision makes sure that your supervisor process > tree is *always* alive and complete, unless process 1 itself > crashes, in which case you're doomed to reboot anyway. > FWIW, the perp-setup(8)/perpboot(8) utilities do indeed enable such "strong supervision" in the default configurations on both BSD and Linux systems. Let me know if any question. > > Another question would be if there are more ways to reliably > > connect to any given process detecting it being gone - but > > all the current daemons that I run can be handled now :) > > Unfortunately, no; not without support from the process you > want to monitor. There are only two ways of being notified of > a process' death: > - getting a SIGCHLD if you're the process' parent. That's > what a supervisor uses (supervise, runsv, perpetrate, > s4-supervise all work on this model). > - getting an EOF on a pipe or socket you're listening to, > when the monitored process is the only writer on the other > side. That's what fghack uses (and pidsig too, I presume). > Also FWIW, the minit/ninit suites offer a "pidfilehack" utility that enables the supervisor to watch for SIGCHLD from non-progeny processes. It is clever and effective, but only works as intended if running minit/ninit as process 1. (The trick is based on the fact that process 1 inherits processes without parents.) Cheers, Wayne