start & stop hang on mysql-server (10.0.4 upgrade from 8.04)

Bug #551097 reported by Gary B
14
This bug affects 3 people
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! :)

Revision history for this message
Gary B (gar37bic) wrote :

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.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Unfortunately this is the *upstream* bug tracker for Upstart, not the Ubuntu package.

You'll need to a file a new bug on mysql

Changed in upstart:
status: New → Invalid
Revision history for this message
Gary B (gar37bic) wrote :

Thanks, new # is bug no. 551130 in case anybody comes here. :)

Revision history for this message
Henrik Heimbuerger (henrik-heimbuerger) wrote :

I did come here with the same problem, so many thanks for taking the time to link this, Gary B!

Revision history for this message
Robert (robrwo) wrote :

I have a similar problem, but installed mysql after upgrading. It used to only hang after starting/stopping but started properly on reboot. Now it hangs even then.

affects: upstart → null
Revision history for this message
Chuck Short (zulcss) wrote :

Thanks I have a possible fix that Im testing right now. Ill probably backport it to lucid.

Regards
chuck

Changed in mysql-dfsg-5.1 (Ubuntu):
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mysql-dfsg-5.1 - 5.1.43-1ubuntu2

---------------
mysql-dfsg-5.1 (5.1.43-1ubuntu2) maverick; urgency=low

  [Marc Deslauriers]
  * debian/mysql-server-5.0.preinst: Set mysql user's home directory
    to /nonexistent to protect against having the /var/lib/mysql
    user-writeable. If an attacker can trick mysqld into creating
    dot files in the home directory, he could do .rhost-like attacks
    on the system. (LP: #293258)

  [Chuck Short]
  * debian/mysql-server-5.1.mysql.upstart: Dont wait forever for a ping from
    the mysql server. It might not be configured properly. (LP: #551097)
 -- Chuck Short <email address hidden> Thu, 20 May 2010 15:35:48 -0400

Changed in mysql-dfsg-5.1 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
StephanNies (nies-stephan) wrote :

see my full explanation in bug #551130

the short answer: you have to run mysqld as user mysql

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.