Description:
I use packaged MySQL binaries. This makes upgrading easier and also allows me to verify the build is as installed etc. One part of the binaries are the system provided init scripts.
Sometimes the Oracle provided init scripts for MySQL don't exactly match our needs. Examples: the use of numactl on some Linux servers requires "unusual" settings (and wrapper scripts) to work properly.
However, basically I may want to do things that are site dependent and obviously Oracle shouldn't be expected to cater for (specifically).
So I'd like to suggest that some "hooks" are added prior to starting/stopping and after starting/stopping the mysql instance so that I can do custom processing. I could modify the init scripts myself but then every rpm upgrade (in my case) would overwrite this and thus not allow the intended customisations I need, or even build my own packages based on the ones provided by Oracle. Again if this can be avoided I think it's better, and a generic approach to allow the use of these external hooks could be quite handy.
Other things that I would typically do would be:
- disable/enable monitoring of the MySQL instance while it's being shutdown/started up using site specific calls
- warmup the database (though this may be less of an issue in 5.6, but specific settings may need to be applied to a specific server and that's easier to handle with an external function/script) on startup.
How to repeat:
Currently there's little flexibility for me to adjust the startup procedures without rewriting the script.
Other users of the system (sysadmins) may not be aware of the specific changes that we add, and it's much easier if they are able to use the "standard" /etc/init.d/mysql start/stop processing and so don't need to worry about "special site behaviour" that may be added.
Suggested fix:
I'd suggest something like an optional shell script be sourced when the script is started (configured from my.cnf as now) which allows the user to override predefined empty shell functions like pre_start (), post_start () , pre_shutdown, post_shutdown (), which would be called at the appropriate points in time.
I'm open to other suggestions.
This should ensure there's no impact on existing systems (so you could provide this in later 5.5 or 5.6 provided init scripts, rather than meaning we have to wait until 5.7 or later...)