From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/611 Path: main.gmane.org!not-for-mail From: Gerrit Pape Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: runit & bluetooth daemons Date: Fri, 22 Oct 2004 10:19:46 +0000 Message-ID: <20041022101922.17471.qmail@a301513d9dc993.315fe32.mid.smarden.org> References: <711460.1098125755860.JavaMail.julle80@nic.fi> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098440362 25039 80.91.229.6 (22 Oct 2004 10:19:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Oct 2004 10:19:22 +0000 (UTC) Original-X-From: supervision-return-850-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Oct 22 12:19:09 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 1CKwVo-0002U2-00 for ; Fri, 22 Oct 2004 12:19:08 +0200 Original-Received: (qmail 9888 invoked by uid 76); 22 Oct 2004 10:19:22 -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 9883 invoked from network); 22 Oct 2004 10:19:22 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <711460.1098125755860.JavaMail.julle80@nic.fi> Xref: main.gmane.org gmane.comp.sysutils.supervision.general:611 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:611 On Mon, Oct 18, 2004 at 09:55:55PM +0300, julle80@nic.fi wrote: > I know that one time initialization tasks should go into stage 1, but > isn't there really any way to make a init script for these tasks to be > run at stage 2? > > The reason why I need this kind of operation is the following: > > If I want full bluetooth support in my system I need to start hcid & > hidd daemons which offcourse I want to start on stage2, but AFTER > starting those I need to run the hid2hci program (not daemon) so I > really can't place it on the stage1 without placing the daemons too. > Any suggestions how to resolve this situation? I don't know the daemons/program you mention, but had a similar problem with the cfs daemon; to have the cfs service actually enabled, ``mount ...'' must be called after cfsd has been started. But _when_ after cfsd started should mount be run?, immediately, one second, more? The answer was: after cfsd has successfully initialized and entered a select loop. So the time span could vary, and only cfsd knows when mount can be run successfully. I ended up changing cfsd to start a script itself at the time initialization was done. Another possibility could be to repeatedly run ``hid2hci'' (as a service) until it succeeds, and then take the service down, e.g.: #!/bin/sh ! hid2hci || runsvctrl down . > I have couple other scripts too which I would like to place on stage 2 > (for faster system startup) but haven't found any reasonable way to do > this as runit expects all init scrtipts to stay running. Yes, runit separates one-time-tasks from long-running-services. You could try to experiment with the workaround to have a service just run ``once'', as discussed here: http://thread.gmane.org/gmane.comp.sysutils.supervision.general/363 HTH, Gerrit.