Supervising hardware-specific daemon with runit

Mikhail Gusarov dottedmag at dottedmag.net
Fri Jun 4 15:15:04 UTC 2010


Hello.

I've got a userspace daemon needed for functioning some piece of
hardware, and interested in integrating it with runit (I suppose this is
the best mailing list to discuss runit).

This daemon need to be started when the device is hotplugged (which may
happen way before Stage 2) and stopped when device is ejected or system
is shut down.

Catching aforementioned events is easy, the hard part is how to start
the service: you can't just enable service in /etc/service where Stage 2
runsvdir looks, as daemon is needed before Stage 2.

The only idea I came up with which does not interfere with Stage 2
runsvdir and allows daemon to be started early is

1) separate runsvdir supervisor for "early services" is started at the
   beginning of Stage 1.

2) Services are enabled/disabled in this "early services" directory
   according to the devices hotplug/removal.

3) Stage 3 shuts down both regular and early services.

This looks bulky, am I missing some obvious solution?

-- 
  http://fossarchy.blogspot.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20100604/b45ce8cf/attachment.pgp>


More information about the busybox mailing list