From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/728 Path: main.gmane.org!not-for-mail From: Stefan Karrmann Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Adding a 'setup' phase to service startup? Date: Wed, 23 Feb 2005 22:12:23 +0100 Message-ID: <20050223211223.GC3942@johann.karrmann.de> References: Reply-To: sk@mathematik.uni-ulm.de NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1109197846 881 80.91.229.2 (23 Feb 2005 22:30:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 23 Feb 2005 22:30:46 +0000 (UTC) Original-X-From: supervision-return-967-gcsg-supervision=m.gmane.org@list.skarnet.org Wed Feb 23 23:30:46 2005 Original-Received: from antah.skarnet.org ([212.85.147.14] ident=qmailr) by ciao.gmane.org with smtp (Exim 4.43) id 1D451i-0000Fj-Te for gcsg-supervision@gmane.org; Wed, 23 Feb 2005 23:30:39 +0100 Original-Received: (qmail 30122 invoked by uid 76); 23 Feb 2005 22:34:47 -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 30117 invoked from network); 23 Feb 2005 22:34:47 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: Mail-Reply-To: X-MailKey: xkJ5TvOgzl4Iya5d0JvKP8S_ztRnvAgZAz X-Passkey: b8b2906d4f8f939edc6277942ddcc3f2b97cab9774309f1ccbef5b9255c9e703 User-Agent: Mutt/1.5.6+20040907i Original-Sender: S.Karrmann@web.de X-Sender: S.Karrmann@web.de X-MailScanner-To: gcsg-supervision@gmane.org Xref: main.gmane.org gmane.comp.sysutils.supervision.general:728 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:728 My 2 cent: Lars Kellogg-Stedman (Mon, Feb 21, 2005 at 05:41:59PM +0000): > I was mulling over service dependencies yesterday, and I wonder if it would > make sense to add a "setup" phase to runsv's service startup sequence. > This would allow, for example, svwaitup to block while a service performed > one time initialization. You may use pipe-tools, cf. . > Here I'm thinking particularly of long-running setup actions, such as > database initialization or something. The current solution -- waiting for > a number of seconds and then crossing our fingers -- doesn't provide the > level of control that runit provides in other areas. > > This would make the start sequence look like this: > > IF file "setup" exists THEN > SET STATE TO S_SETUP > RUN file "setup" > END IF > > SET STATE TO S_RUN > RUN file "run" > > IF file "finish" exists THEN > SET STATE TO S_FINISH > RUN file "finish" > END IF With pipe-tools you only need the run and finish file: ######################### # run file ./setup npt-notify ./events isup standard-run-script ######################### # finish file npt-notify ./events down ######################### The setup code my wait on another service X by ,npt-wait /service/X/events'. The demon can even use libnptrigger to signal the events during its running. Regards, -- Stefan Karrmann