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: Thu, 14 Aug 2008 11:47:16 +0200	[thread overview]
Message-ID: <20080814094716.GA32277@skarnet.org> (raw)
In-Reply-To: <48A38C6D.9070204@magtech.com.au>

> We're running an embedded Linux system, so I was trying to keep the
> number of running processes to a minimum. I guess the runsv is fairly
> light?

 Ah, it's good too see that embedded developers use smart supervision
systems and good-quality, small-sized, software. :)
 The runsv process is quite light, you don't need to worry about it.
To be convinced, compile runit statically with the small libc of your
choice, and look at the size of the executables and the memory
footprints.

 Note: if you're not using logging at all, and you need to optimize
as much as you can, you might consider switching to daemontools.
runsv embeds the logging facility, while supervise does not, so I
think supervise should be a bit lighter. But it's a very minor
optimization, and sticking to runit might give you more benefits.


> So are you recommending that I use a Sys-V script to start all the runsv
> services?

 I'm certainly not advocating a SysV scheme. Actually I'm not advocating
any scheme at all. A simple one-time script will do. The SysV stuff
is an overcomplicated way of running one-time scripts. :)


> I currently use UDEV to do an "sv up bluetooth" when the Bluetooth
> device is inserted. I guess I could just as easily do "sv up hcid; sv up
> sdpd; ... ".
> 
> No-one actually calls "sv down" because it's an embedded system with no
> physical user interface, the services are only stopped when the device
> is power cycled, which is fairly common and expected.

 Well, as I understand it, you want to start your Bluetooth daemons as
soon as your embedded thingie is powered: then you don't need to write
any script at all. Just have your Bluetooth service directories, with
appropriate run scripts, in /var/service or wherever runsvdir is run.
 runsvdir will spawn runsv processes, which will automatically start
your daemons (unless you have "down" files in the service directories).

 If you need to send rfcomm commands, perform them in the one-time
initialization (i.e. /etc/runit/1), since rfcomm is a short-lived
program. If you need to send them _after_ the daemons are up, it's
a bit trickier; but you should already have devised a way to
execute a one-time script once the services have been started, just
add your rfcomm lines to that script.

-- 
 Laurent


      reply	other threads:[~2008-08-14  9:47 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
2008-08-14  1:37   ` Aras Vaichas
2008-08-14  9:47     ` Laurent Bercot [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=20080814094716.GA32277@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).