conditonal events to start a script?
Sean Russell
upstart at ser1.net
Mon Oct 30 22:58:24 GMT 2006
On Monday 30 October 2006 16:09, Michael Biebl wrote:
> I agree, that something like this is useful. The problem is, a
> deterministic, dependency based init system does not map one to one
> to an event based init system.
True.
> Even if you have xfs in /etc/event.d/, you can't tell for sure if
> (and when) the start event for xfs is generated and xfs is ever
> started. So what do you do in such a case: wait and then timeout?
I was writing a rebuttal, and then thought of a use case that
illustrates your point :-)
Just because an service is in the events list, doesn't mean that it will
ever get an event causing it to either start or fail. That means that
my simple solution (that it is satisfied if it starts, fails to start,
or doesn't exist) is insufficient to cover all scenarios.
That said, I believe that this situation (a service is in the list of
events but is never triggered) is an edge case, and conditional events
are still useful following the guidelines I suggested in an earlier
email.
> > PS for Gentoo-ers, this is know as 'after'
>
> Not quite correct, the corresponding functionality in Gentoo's init
> is called "use", which describes a conditional dependency (in
> contrary to "need", which is an absolute dep). "before" and "after"
> are mere ordering statements [1].
He was right: it is closer to "after" than "use". From the Gentoo init
documentation:
"In some cases you might not require a service, but want your service
to be started before (or after) another service if it is available on
the system"
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4
> Cheers,
Back atcha.
--- SER
More information about the Upstart-devel
mailing list