Slight, maybe problem.
Tristan Wibberley
tristan at wibberley.org
Mon Nov 13 20:45:29 GMT 2006
Scott James Remnant wrote:
> On Mon, 2006-11-13 at 21:13 +0100, Luka Renko wrote:
>> ... for "and"
>> conditions, we need to keep the state of event and evaluate the complete
>> condition on every change of state (or better event). In your example, newly
>> registered job (apache) would evaluate conditon of network-up that would be
>> cached in upstart.
>>
> The obvious problem here is that upstart would have to cache whether an
> event has happened or not. And while this is suitable for "from
> network-up until network-down" stanzas, this would not be suitable for
> "on control-alt-delete"
>
> Also there's a majorly obvious problem...
>
> while true; do
> initctl emit `uuidgen`
> done
>
> upstart will consume all available memory.
Why not have jobs that have "and" conditions check when they come up
whether all their conditions are met (via atomic mechanism provided by
those jobs it "depends" upon) - and die (probably without emitting
anything) if not? So they get triggered once for each event and only
stay triggered (telling upstart to emit its "up" event) on the last one.
Jobs should then be written to cope with jobs they depend on
disappearing. There's no reason for this to be high overhead and a job
could stay in a semi-alive state to avoid exec-thrashing (with upstart
providing a unix domain socket based signalling mechanism for such
clever jobs.
--
Tristan Wibberley - "it" is the preferred noun of an abated intellect.
These opinions are my own, and do not reflect those of my employer.
More information about the Upstart-devel
mailing list