start & stop hang on mysql-server (10.0.4 upgrade from 8.04)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
NULL Project |
Invalid
|
Undecided
|
Unassigned | ||
mysql-dfsg-5.1 (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
I believe this may have already been reported through apport as a dpkg bug. In the upgrade to 10.0.4 beta from 8.04, upgrading mysql-server failed, and every software update and attempt to run dpkg hangs up when the process gets to the pont of either 'stop mysql' or 'start mysql'. Each time if I go into a shell and kill the 'stop' or 'start' then dpkg proceeds on, but of course ends with a warning. As a result, mysql-server appears to be installed but it isn't. I have tried various things but to no avail.
trying to run stop and start from the shell looks like this:
~# initctl status mysql
mysql start/post-start, (post-start) process 1004
~# stop mysql
^C
~# stop mysql
stop: Job has already been stopped: mysql
~# start mysql
^C
~# start mysql
start: Job is already running: mysql
Searching my machine, as far as I can tell mysqld is not on the system anywhere. Process 1004 at this particular time was 'sh -e /proc/self/fd/8' - but there is no /proc/self/fd/8. I note that when I reboot and do another ps auxww|grep mysql, this same item shows up with a different process number, and different final number (now it is /proc/self/fd/10) that is nonexistent in /proc/self/fd, (I am clueless about the inner workings of initctl so I'm jiust providing whatever info might be useful.)
I assume there is semaphore or flag file somewhere that initctl is looking for, that is set with wrong permissions, contains the wrong data, should exist, or should not exist - or maybe it's because it's trying to stop/start a nonexistent program (the old copy of mysql appears to be gone). If I could learn how to reset the state, perhaps I can get this mysql-server thingy working. That would be nice, because I can't work at home until I have mysql working! :)
Related branches
affects: | upstart → null |
Aha!! After several days working on this on and off, and searching the net etc. I found and looked at the mysql.conf file in /etc/init/ mysql.conf.
That is where the bug is. The file /etc/init/ mysql.conf has an infinite loop in it in the post-start section. It keeps trying to run mysqladmin until it succeeds. But if mysqld is failing, mysqladmin silently (in this case) fails.
I tried running the actual start commands cited in this conf file, starting with ' install -m 755 -o mysql -g root -d /var/run/mysqld'. This install command finally put the mysqld program into /usr/sbin/. Then I ran the line starting with LC_ALL, and then I tried running /usr/bin/mysqld, and that failed with an error. I forget the particular error but it apparently didn't like some of the options - one was deprecated, one was not recognized. So I backed up my old /etc/mysql/my.cnf, copied my.cnf.dpkg-dist to my.cnf and retried. That worked. Mysqld started, and I can now use mysqladmin to stop the server. I can also use service mysql start and stop. Also, dpkg now runs without errors (well actually there is an error about linux-headers not being configured, but I think that is some other issue.)
I don't know if I should post this bug on the mysql-server. Presumably the maintainers of this package can move it.