supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Gerrit Pape <pape@smarden.org>
Subject: Re: runit & bluetooth daemons
Date: Fri, 22 Oct 2004 10:19:46 +0000	[thread overview]
Message-ID: <20041022101922.17471.qmail@a301513d9dc993.315fe32.mid.smarden.org> (raw)
In-Reply-To: <711460.1098125755860.JavaMail.julle80@nic.fi>

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.


      reply	other threads:[~2004-10-22 10:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 18:55 julle80
2004-10-22 10:19 ` Gerrit Pape [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041022101922.17471.qmail@a301513d9dc993.315fe32.mid.smarden.org \
    --to=pape@smarden.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).