why would /etc/init.d/mysql run the wrong upstart job?

update: /lib/init/upstart-job has been replaced with the MongoDB init script.

For some reason, /etc/init.d/mysql start|stop|restart|status (/etc/init.d/mysql is simply a symlink to /lib/init/upstart-job) is affecting my MongoDB install, not my MySQL install. service start|stop|restart|status mysql works as you'd expect.

An example:

root@score:~# /etc/init.d/mysql status
 * Checking status of database MongoDB
   ...fail!
root@score:~# 

What could cause this, and how can I fix it?

Scripts:

  • /lib/init/upstart-job: http://paste.ubuntu.com/517647/
  • /etc/init/mysql.conf: http://paste.ubuntu.com/517648/
  • /etc/init/mongodb.conf: http://paste.ubuntu.com/517649/

Solution 1:

The correct contents of /lib/init/upstart-job for lucid or maverick are http://paste.ubuntu.com/517673/ Please triple-check that it is a regular file before editing this, and not a symlink (in case the symlink in in the wrong direction). Since this file is used for starting many core services, you do not want to have it broken further, and should check carefully before rebooting. At this stage, I'm not sure how it could have the different contents unless there was some manual intervention to change it. The package in maverick appears to contain the correct symlink.