supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Laurent Bercot <ska-supervision@skarnet.org>
To: supervision@list.skarnet.org
Subject: Re: Please review my Bluetooth run script
Date: Wed, 13 Aug 2008 14:05:05 +0200	[thread overview]
Message-ID: <20080813120505.GA11751@skarnet.org> (raw)
In-Reply-To: <1775.124.170.84.119.1218624530.squirrel@www.magtech.com.au>

> What I want to know is if this is the "proper" way to go about it. The
> original Blue-Z startup script starts quite a few daemons all at once,
> and it kills off each of them with a "killall".

 The original point of service supervision, what caused it to be
implemented (with daemontools first, then with runit) in the first place,
is that some daemons need to be automatically restarted if something
somehow causes them to die.

 Your current "run script" does not accomplish this.
 It starts the various Bluetooth daemons, and kills them, just like a
System V script would do. Those daemons are not supervised; what is
supervised is actually the following script:

   exec sh -c "while [ 1 ]; do sleep 100; done"

 I'm sure you will agree that supervising this script isn't particularly
useful. :)

 In other words, you've successfully converted your System V scripts
to the runsv model, but you're not taking advantage of what service
supervision can do for you. As is, you'd still be better off using a
start/stop SysV script, and do without your akward "bluetooth" service
which isn't a real service.

 My advice would be to have separate services for hcid, sdpd, hidd,
rfcommm (if it's a long-lived daemon), dund, pand and pppd. All those
daemons need to be kept alive and running; as an additional benefit,
you don't have to lose their logs by sending them to /dev/null, you
can make use of runsv's logging facility to send each daemon's log
into its own multilog or whatever your favorite logging system is.

 Then, once you have set up one service for each Bluetooth daemon
that needs to be up, you can have a "bluetooth start" script that
does a "sv up" on all those services at once, and a "bluetooth stop"
script that does a "sv down" on them. And you can even control
each daemon separately if the need arises.

-- 
 Laurent


  reply	other threads:[~2008-08-13 12:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-13 10:48 arasv
2008-08-13 12:05 ` Laurent Bercot [this message]
2008-08-14  1:37   ` Aras Vaichas
2008-08-14  9:47     ` Laurent Bercot

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=20080813120505.GA11751@skarnet.org \
    --to=ska-supervision@skarnet.org \
    --cc=supervision@list.skarnet.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).