From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/581 Path: main.gmane.org!not-for-mail From: Gerrit Pape Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Nested runsvdir Date: Sun, 19 Sep 2004 20:00:47 +0000 Message-ID: <20040919200041.27877.qmail@f9605ebbee6e9c.315fe32.mid.smarden.org> References: <873c1i2fip.wl@badger.wordzoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1095624033 12719 80.91.229.6 (19 Sep 2004 20:00:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 19 Sep 2004 20:00:33 +0000 (UTC) Original-X-From: supervision-return-820-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Sep 19 22:00:21 2004 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14] ident=qmailr) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1C97rB-0003YV-00 for ; Sun, 19 Sep 2004 22:00:21 +0200 Original-Received: (qmail 21667 invoked by uid 76); 19 Sep 2004 20:00:41 -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 21662 invoked from network); 19 Sep 2004 20:00:41 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <873c1i2fip.wl@badger.wordzoo.com> Xref: main.gmane.org gmane.comp.sysutils.supervision.general:581 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:581 On Thu, Sep 16, 2004 at 12:13:50PM -0700, Jared Rhine wrote: > Are there any known caveats to "nesting" runsvdir instances? I'm > having problems with signals and processes reparenting to init. > > By nested I mean that an init-started "main" runsvdir has one service > which has a run script of: > > -- begin -- > #!/bin/sh > exec 2>&1 > exec chpst -P -u monitor -e /var/di/monitor/runit/envdir runsvdir -P /var/di/monitor/runit/services 'log: ..........' > -- end -- > I can start/stop/manipulate these services fine using > runsvctrl. > > But if I terminate the "parent" service (via runsvctrl down for > instance), the router and archiver runsv processes don't die; they > instead move to a parent pid of 1. I can then runsvctrl the router > and archiver services fine. But this is a bad situation to put the > server in and worse case (except I'm using chpst -L lockfiles), I get > multiple daemons running. I expect that killing the nested runsvdir > should kill all its child services. > > runit is probably doing the expected thing given what I'm thrown at Yes, see section SIGNALS in runsvdir(8): If runsvdir receives a TERM signal, it exits with 0 immediately. If runsvdir receives a HUP signal, it sends a TERM signal to each runsv(8) process it is monitoring and then exits with 111. > Suggestions or snippets of working "nested" runsvdir configurations > would be most appreciated. I suggest that you run svwaitdown -xk /var/di/monitor/runit/services/* in the ./finish script of the runsvdir service, just as runit's stage 3 does for the main runsvdir process (stage 2) after it's terminated. That should fix your problem. Regards, Gerrit.