So, I'm working on an upstart init script for mysql. Should be trivial, right? My stop stanza looks like:
kill timeout 30
stop on runlevel [016]
I shutdown now -r
, and mysql yells about my MyISAM tables being crashed, just like I'd kill -9
'd my mysql process. Boo. Upstart doesn't seem to be waiting for mysql to quit before restarting. Some searching on Google finds me this link suggesting I do, instead:
stop on starting rc RUNLEVEL=[016]
and indeed, that seems to fix the problem.
But: WFT? Essentially, I want to make sure mysql is stopped before trying to unmount the local filesystems. Is this the right way to do this? Why is my stop on runlevel
stanza not waiting for mysql to stop before switching runlevels?
And: is this y'know, documented anywhere?