[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

severe bug in mysql-server-5.1 (postinst maint script, easy to fix)



Hello,

mysql-server-5.1 package in Debian/Squeeze(-lts) has a serious bug: some-
times upgrades do change the ownership of /var/lib/mysql and all content
to 'root:root'. As a result, the MySQL service doesn't start anymore.

Reason for the bug is line 144 of the mysql-server-5.1.postinst maintainer
script:

    bash /usr/bin/mysql_install_db --rpm 2>&1 | $ERR_LOGGER

This should rather be:

    bash /usr/bin/mysql_install_db --user=mysql --rpm 2>&1 | $ERR_LOGGER

See bugreport #737224 for reference - it is about the same bug in
mysql-server-5.5.

I don't understand yet, when the bug is triggered. It doesn't happen at
every upgrade, but when it happens, the result is a broken MySQL
installation: the package is in half-installed state and the service
doesn't start anymore due to the wrong permissions.

It's not enough to simply change the ownership of '/var/lib/mysql' back
to 'mysql:mysql' as the next run of apt-get will run the maintainer
script again which in turn changes ownership back to 'root:root'. For
now the proper solution (until packages are fixed) is to patch line 144
of /var/lib/dpkg/info/mysql-server-5.1.postinst and run 'apt-get -f
install' afterwards.

I therefore suggest to fix this bug within the next upload of mysql-5.1
to squeeze-lts.

Cheers,
 jonas


Reply to: