Start upon existence of multiple devices

Scott James Remnant scott at netsplit.com
Tue Feb 8 20:47:43 UTC 2011


In general, this is the exact use case (multiple devices come up in an
unknown order) for which the current behavior of "and" is intended
for.

  start on device_a and device_b

Would be the simplest expression, and the side-effects that you
usually try and avoid with "and" are probably exactly what you want in
this case.

In practice, you may want to put the device requirements in a
process-less conf file which you can reference with "started
mythtv_required_devices" or similar to abstract it out a bit.  This
would make the multiple-deps problem easier to manage too.

Scott

On Sun, Feb 6, 2011 at 1:18 AM, Jan Ceuleers <jan.ceuleers at computer.org> wrote:
> Hi.
>
> I have a howto question. If there is somewhere else more appropriate to such
> questions then feel free to point me there.
>
> I have a task that should not be started until multiple devices have been
> registered. In the general case the order in which these devices come up
> after boot is unknown and may differ from one boot to the next (e.g.
> depending on whether the devices have retained their firmware).
>
> The specific use cases I have in mind are the following:
>
> 1. The MythTV master backend process should not be started until networking
> is up, and the mysql server is up, and all configured video capture devices
> are ready for use.
>
> 2. The MythTV slave backend process should not be started until networking
> is up and all configured video capture devices are ready for use.
>
> So there are multiple problems:
>
> A. The problem pointed out above with regard to a dependency on multiple
> devices;
>
> B. The fact that, at the moment, the /etc/init/mythtv-backend.conf file is
> generic rather than taking the above dependencies into account, knowing that
> they differ depending on the use case and available video capture devices.
> So ideally a way is needed to automatically generate the .conf file.
>
> Thanks, Jan
>
> --
> upstart-devel mailing list
> upstart-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/upstart-devel
>



More information about the upstart-devel mailing list