On a Ubuntu system I came across /etc/mysql/debian-start in their MySQL server start/stop script. This script carries out a bunch of sanity checks right after starting the MySQL server. Let's adapt this script and implement it on Gentoo as well! Reproducible: Always
Created attachment 159307 [details] debian-start
Created attachment 159309 [details] the include used by debian-start
IMHO force these test on every restart is not so good as it seem. The Solution [tm] would be to add {pre,post} hooks to {start,stop} phases and maybe document some example on how to achieve automatic testing/repairing of tables, permissioons, whatever. However this should be a change in baselayout or openrc, not mysql init scripts.
OpenRC already supports pre_$command where $command is start,stop, status, custom_command, etc (just idly browsing bugzilla here)
1. See the new mysql init scripts in bug 175783. 2. I don't find Roy's mentioned pre_ ability in the openrc generic codebase. It's in the net.* stuff as shell code only.
This would also require that a valid root login for MySQL is somewhere in the filesystem (debian stores a copy for it's admin use). Respin against the new mysql-init-scripts-2.0_pre1 please
Please reopen when you respin.