CONF Variable in /etc/init.d/mysql unused - support for multiple instance/version of mysql

Bug #106244 reported by Markus Müller
4
Affects Status Importance Assigned to Milestone
mysql-dfsg-5.0 (Debian)
Fix Released
Unknown
mysql-dfsg-5.0 (Ubuntu)
Fix Released
Wishlist
Dan Munckton

Bug Description

Binary package hint: mysql-server-5.0

I tried to run multiple mysql instances on a single server. Therefore, I prepared multiple versions of /etc/mysql/my.cnf, copied /etc/init.d/mysql and changed the value of CONF to my other mysql configuration. After that, I realized that this value is not used at all in die startupscript and that /etc/mysql/my.cnf is everywhere hardcoded.
Is it possible to change this so that CONF is actually used?

Tags: bitesize
Mathias Gug (mathiaz)
Changed in mysql-dfsg-5.0:
importance: Undecided → Wishlist
status: New → Triaged
Revision history for this message
Dan Munckton (munckfish) wrote :

Hi

I'd like to have a go at this.

Dan Munckton (munckfish)
Changed in mysql-dfsg-5.0:
assignee: nobody → munckfish
Revision history for this message
Dan Munckton (munckfish) wrote :

Debdiff attached.

Cheers

Dan

Revision history for this message
Mathias Gug (mathiaz) wrote :

Thank you for your contribution.

I'm not sure that your patch fixes the problem: even if you've changed the occurrence of '/etc/mysql/my.cnf' in the init script, mysqld_safe is still using the default file as it's called without any parameter.

You should review all the calls to mysql commands in the init script to make sure that they use the default configuration file.

You may also setup a configuration similar to the one described by the reporter and make sure that all the operations (start, stop, status) from the init script work as expected.

Revision history for this message
jcinacio (jcinacio) wrote :

Looking at mysqld_safe usage, i assume that starting it with the switch "--defaults-file=<file>" would resolve the issue.

Revision history for this message
Dan Munckton (munckfish) wrote :

Sorry for not responding yet. I'll be back to work on this again either Thurs of Fri night this week. jcinacio: thanks for the pointer, it would be good not to have to start modifying mysqld_safe if possible. I note also that there is a mysqld_multi script which appears to be especially written to support multiple instances of mysqld, maybe supporting this somehow would be a better way to achieve the goal?

Revision history for this message
Dan Munckton (munckfish) wrote :

On analysing this further I discovered that simply duplicating /etc/init.d/mysql and changing the value of the CONF variable would never be enough to properly support multiple instances of mysql even if references to the configuration file were passed on to the mysql scripts/binaries using the --defaults-file option.

The main issue is that the debian maintainer scripts are not designed to iterate through multiple instances when the package is updated. For instance this means the other instances would not have table upgrades applied.

The proper way to do multi-instances is with the upstream script mysqld_multi but apparently work still needs to be done to support this properly in Debian/Ubuntu.

After discussing on #ubuntu-server with mathiaz, infinity and others it was agreed that this bug should not be fixed but instead we should mark clearly in the init script that multiple instances are not supported in this way.

The attached debdiff adds this warning comment to /etc/init.d/mysql and includes the minor tidy up mods from the previous patch.

I look forward to any feedback.

Changed in mysql-dfsg-5.0:
status: Triaged → In Progress
Revision history for this message
Mathias Gug (mathiaz) wrote :

Looks good to me.

Could you file a bug with Debian to get this patch applied to their package and link it to this bug in LP ?

Thank you.

Revision history for this message
Dan Munckton (munckfish) wrote :

Tried to report to debian today, think I've still not got reportbug setup properly will try again tomorrow. :(

Changed in mysql-dfsg-5.0:
status: Unknown → New
Changed in mysql-dfsg-5.0:
status: New → Fix Committed
Changed in mysql-dfsg-5.0:
status: Fix Committed → Fix Released
Revision history for this message
Mathias Gug (mathiaz) wrote :

Fixed in 5.0.67-2, thus in jaunty.

Changed in mysql-dfsg-5.0 (Ubuntu):
status: In Progress → Fix Released
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.