From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/724 Path: main.gmane.org!not-for-mail From: Lars Kellogg-Stedman Newsgroups: gmane.comp.sysutils.supervision.general Subject: Adding a 'setup' phase to service startup? Date: Mon, 21 Feb 2005 17:41:59 +0000 (UTC) Message-ID: Reply-To: lars@oddbit.com NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1109007768 15312 80.91.229.2 (21 Feb 2005 17:42:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Feb 2005 17:42:48 +0000 (UTC) Original-X-From: supervision-return-963-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Feb 21 18:42:48 2005 Original-Received: from antah.skarnet.org ([212.85.147.14] ident=qmailr) by ciao.gmane.org with smtp (Exim 4.43) id 1D3HZk-0002jZ-KF for gcsg-supervision@gmane.org; Mon, 21 Feb 2005 18:42:28 +0100 Original-Received: (qmail 10084 invoked by uid 76); 21 Feb 2005 17:46:17 -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 10078 invoked from network); 21 Feb 2005 17:46:16 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-To: supervision@list.skarnet.org Original-Lines: 35 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 209-6-203-41.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com User-Agent: slrn/0.9.8.1 (Linux) Original-Sender: news X-MailScanner-To: gcsg-supervision@gmane.org Xref: main.gmane.org gmane.comp.sysutils.supervision.general:724 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:724 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. 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 svwaitup() would block if a service was in the "setup" phase. This should require only minor changes to runit -- introduce "runsv" to the "setup" script, and modify svwaitup, svwaitdown, and runsvstat to understand a new state value in the status file. -- Lars -- Lars Kellogg-Stedman