Upstart config file generation
Clint Byrum
clint at ubuntu.com
Wed May 4 06:07:52 UTC 2011
Excerpts from Scott James Remnant's message of Tue May 03 17:26:12 -0700 2011:
> On Sun, May 1, 2011 at 12:17 PM, Clint Byrum <clint at ubuntu.com> wrote:
>
> > > If the backend starts before mysql is available then it will fail, and
> > > upstart does have an opportunity to retry. No harm done then. Not ideal
> > > either, because this attempt will have needlessly slowed the boot
> > > procedure down. So why not put the dependency in the default (and
> > > static) upstart configuration file? Because in the general case the
> > > database need not reside on the same server as the backend (e.g. in the
> > > case of a slave backend).
> >
> > I'm working on a new wait-for-state.conf (which I hope to upload this
> > coming week to Oneiric, and will submit upstream for inclusion) which
> > will make it this easy:
> >
> > if [ -x /usr/sbin/mysqld ] && [ -f /etc/init/mysql.conf ] ; then
> > start wait-for-state WAIT_FOR=mysql WAIT_STATE=started WAITER=mythtv
> > WAIT_FOREVER=1
> > fi
> >
> >
>
> I'm not sure how this is different from a flexible "on" ?
I'm not sure I understand exactly what you mean. An "or" with the two
conditions (video-device-added or started mysql for instance) would
produce a difficult situation where we need to make sure we actually want
to start now, and then we may decide "no mysql isn't ready yet, don't
start" and meanwhile mysql has started and we don't try again because
of the race between checking for mysql and the pre-start changing the
goal back to 'stop'.
I get the feeling though, that you mean something else. Can you elaborate?
More information about the upstart-devel
mailing list