Update: Filed as bug #812423 on Launchpad.
I have mysqld pointed to an external volume:
$ cat /etc/mysql/conf.d/data_joliss.cnf
[mysqld]
datadir=/mnt/data_joliss/mysql
This is working fine in general. But sometimes the volume is not mounted, for whatever reason. In those cases, mysqld fails like it should:
# mysqld
110716 14:17:42 [Warning] Can't create test file /mnt/data_joliss/mysql/opinionated-programmer.lower-test
110716 14:17:42 [Warning] Can't create test file /mnt/data_joliss/mysql/opinionated-programmer.lower-test
mysqld: Can't change dir to '/mnt/data_joliss/mysql/' (Errcode: 2)
110716 14:17:42 [ERROR] Aborting
110716 14:17:42 [Note] mysqld: Shutdown complete
However, the upstart job on Ubuntu 11.04 (start mysql
or service start mysql
) simply waits (hangs) indefinitely without outputting anything. The strace isn't telling me anything, but if anybody cares to take a look: strace -fv start mysql
I would like the mysql
upstart job to just report an error and terminate rather than hanging. How do I do this?
(Background: I have an EC2 instance with an extra EBS volume to store permanent data. If the EBS volume is not available at boot time, the system hangs waiting for mysql, and I cannot even SSH into it to fix the problem -- so now my instance has become completely unusable. I would like it to just continue booting, even without a MySQL server.)
As a work around you could probably change /etc/init/mysql.conf and add 'and started ssh' to the 'start on ()' section. This should prevent mysql from attempting to start until ssh is already running so that at least you can fix the machine.