How does a post-start script know the main script has died?

upstart at upstart at
Wed Dec 9 21:40:53 GMT 2009

I'm launching dbus via an upstart job.  To prevent later jobs from
being launched before the daemon is ready to handle connection
requests I have a post-start script that polls for the existance of
dbus-daemon's unix domain socket in /proc/net/tcp, breaking out of a
loop when the socket appears.  When this works jobs that 'start on
started dbus' don't spawn until the socket is available.

But when dbus-daemon crashes, the post-start script runs forever.
(No, I can't just respawn dbus, but doing so doesn't seem to fix the
problem.)  I'd like the post-start script to detect that dbus has
died.  I can grep for the string 'stop' in the output of 'initcdl list
dbus' but that's gross: is there a better way?  Am I misunderstanding
upstart to think that it should kill or at least signal the post-start
script itself in this case?

We're running 0.3.8, BTW.  Our build system with its ancient autoconf
can't handle anything newer.


* From the desktop of: Eric House, eehouse at                       *
*       Crosswords 4.4 for WinMobile plays over the internet:  *

More information about the upstart-devel mailing list