The mysql init script has been through many revisions, yet still does not support a chroot'd mysql environment. Fortuntely, however, it does not require many changes to do so. I have attached 3 patches which I think provide good chroot support and I've tested it with success in an amd64-multilib environment. Obviously, if you like the changes to the ebuild, we should migrate them to the eclass. Also, I'm not sure if mysql needs any other libraries preloaded, but this seems to work perfectly. Without libnss_compat.so preloaded you'll get the error: [ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists! You could also copy this library into the chroot environment, but this is a more robust solution. Finally, if this ends up being a well-received enhancement, I am willing to make the commits and get the changes tested by the different archs, if you would like. For now, I defintely would like some feedback from the mysql team.
Created attachment 100458 [details, diff] mysql-5.0.26-r1.ebuild.patch
Created attachment 100459 [details, diff] mysql.rc6.patch
Created attachment 100460 [details, diff] mysql.conf.d.patch
I should also state that this chroot environment is created by simply placing: chroot = /home/mysql under the mysqld section of my.cnf.
I also want to be clear on this point: I am making this bug "normal" severity, because if you do use the my.cnf line mentioned above, Gentoo's init script thoroughly breaks.
Yeah, we never advertised it does handle/support chroot, why are you surprised? :)
Re-marking as enhancement, as Jakub stated it was never actually intended to work with chroot support... We'll ponder this and maybe add it, if you could update the patches to cleanly apply to the latest init.d/conf.d scripts, now found in dev-db/mysql-init-scripts, that would be greatly appreciated! Best regards, CHTEKK.
I'm trying to run mysql-5.0.38 under chroot.. Without your patches "/etc/init.d/mysql start" was giving me this: ---------- * Caching service dependencies ... [ ok ] * Remounting root filesystem read-only ... mount: / not mounted already, or bad option [ !! ] * Checking root filesystem ... ext2fs_check_if_mount: No such file or directory while determining whether /dev/ROOT is mounted. fsck.ext3: No such file or directory while trying to open /dev/ROOT /dev/ROOT: The superblock could not be read or does not describe a correct ext2 filesystem. If the device is valid and it really contains an ext2 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock: e2fsck -b 8193 <device> ... Press Ctrl+D to debug / reboot, e.t.c.... --------- After all patches there's no halts now.. but: mysql doesnt launch finally: "mysqld is already starting", and 'ps ax|grep mysql' shows me startup script is running.. can u check/release your patches for the latest mysql?
Please respin against mysql-init-scripts-2.0_pre1
No response from user for 2 years.