Comment 8 for bug 1017666

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: Upstart startup

This sounds like a bug in pdns, not mysql.

At this time, there is no earlier set of events we can use than runlevel [2345]. MySQL requires that the static network be up and working and that all filesystems be mounted, which is what runlevel 2 triggers on. On my 2008 model macbookpro w/ slow disk, this is 36 seconds after the kernel starts. On my mac book air w/ SSD, this is 6 seconds after the kernel starts. The proposed start on would not be sufficient on systems with more than one static network interface.

pdns, however, seems to still be controlled by an init.d script. So that is problem #1. If it cannot handle being started before a local dependency (I'd argue that is a bug as it should be able to poll for quite a while at startup), then it needs an upstart job which can wait for mysql to start in its pre-start:

pre-start script
  if [ -f /etc/init/mysql.conf ] ; then
    start wait-for-state WAIT_FOR=mysql WAITER=pdns
  fi
end script

That will spin for up to 30 seconds after trying to start mysql (or forever if you set WAIT_FOREVER=1) before returning. You can in fact use 'start wait-for-state ...' in an init.d script as well for the same purpose, so you don't actually have to write an upstart job.

Anyway, I'm redirecting this as a bug in pdns, not mysql. I don't see anything that mysql can change to help dependent services deal with the fact that they haven't in any way declared or even tried to deal with those dependencies.