Upstart config file generation

Scott James Remnant scott at netsplit.com
Wed May 4 00:25:00 UTC 2011


This is definitely one of those use cases where it's been difficult to find
a proper middle ground between the two projects. If we can crack this one, I
think we could accomplish anything.

Let's first take the tuners as an example.

The current model is that the device is visible on the bus by vendor/device
id/class etc. which during a udev "trigger" run results in modprobe being
called to load the driver. This results in additional devices being created
in the kernel, which trigger further udev rules to load firmware, probe the
resulting devices to populate the udev db, run additional scripts and
software to configure and calibrate the device and then announce to
userspace that the device is ready.

Userspace software would on startup listen for futher events, and then
iterate the available devices and match the probed information against its
configuration. As events come in it would also match these against its
configuration.

Obviously MythTV doesn't quite do this either, but that's the model it's
supposed to be following. It's supposed to be startable at any point, and
deal with configured devices being missing.

It's also supposed to not use names like /dev/video0 because the 0 bit can
change for any one device during reboots.


Now obviously that hasn't been the Upstart model, that's maybe more the
"dream" model (and systemd model). Upstart has tried to be flexible towards
existing software - thus the complex "start on" lines. In which case you
kinda end up wanting:

  start on <result of running a script>

but that's an expensive thing to do on startup - for a start, what are that
scripts dependencies?


I'm increasingly thinking that this model is backwards though - it's all
well and good probing every device on boot, but it's *expensive*. We really
don't need to care until something starts that cares. If we knew what wanted
the device information, we could delay all of that probing until it was
actually needed.

And the backend is another interesting case. We need to know what MythTV
needs - it needs MySQL, but it's configured onto a remote address, so it
doesn't need the local server - it just needs local client software and a
route to the remote server.

A change of mythtv configuration results in a change of boot configuration.

Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/upstart-devel/attachments/20110503/0a14c5bf/attachment.html>


More information about the upstart-devel mailing list