Dependencies

Jerry Haltom wasabi at larvalstage.net
Sat Oct 7 16:17:23 BST 2006


My reply is going off of our new edgy+1 design ideas.

> set of events have been generated.  An example of mounting network 
> filesystems is a good example; how would one write the rules to have, for 
> example, the "netfs" process wait until it receives BOTH network/started and 
> localfs/started events? 

We've been considering how to deal with this for a number of different
problems. My current thinking is that the job should be triggered on
BOTH events, in any order, and each time it is triggered, it should do
some work to make sure the other one is currently satisfied.

In the example of netfs, you'd have the netfs job which started on
"started localfs", and then ran a checked to see if BOTH network and
localfs were in fact satisfied. It would check if all the FSs are
mounted, and if there is a network interface. It could either fail
immediately after realizing one is not satisfied, or wait with a loop on
initctrl for a certain timeout period. It seems reasonable that it may
be able to implement this logic in sh in the pre-start script.

> Also, I'd like a pointer to any discussion about conditional use cases.  Is 
> there any mechanism for supporting the case where a service CAN use another 
> service, but doesn't require it?  This may be an difficult problem to solve 
> in an indeterminate, event-driven system like Upstart, but I'd like to know 
> if anybody has given it any thought.  An example of this is a printing 
> subsystem, where printers are connected both locally and remotely.  In this 
> case, the Cups service may be triggered when a USB printer is detected, and 
> when the network comes up.  How is this to be handled?  Do we start Cups when 
> it gets a USB event, and then restart it when the network comes up?

Cups is a hard one. I'd say it should either watch the network on it's
own and use HAL. Or accept a signal telling it to rescan everything, in
response to an upstart event.

> 3) The "getting started" tutorial is good, but utterly impractical for 
> anything other sysinit-based systems.  I'd really like to see even a sparse, 
> rough draft, but formalized syntax for the scripts, and/or some examples of 
> non-trivial scripts.  For example, describing how to handle multiple event 
> dependencies :-)  Since the examples provided offload all of the 
> inter-service dependency handling to sysinit, they aren't very useful. 

A lot of those features barely even exist. I think the best we've got
about where we're going is a wiki page:
https://wiki.ubuntu.com/UpstartDesignChanges

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20061007/56de37e7/attachment.pgp 


More information about the Upstart-devel mailing list