MySQL and Chroot?

NightShade03NightShade03 Member Posts: 1,383 ■■■■■■■□□□
Wondering if anyone can shed some light. I have a folder called LIVE which I've used rsync to copy the entire ubuntu 9.10 live cd too. Once done I mount --bind /dev and then sudo chroot LIVE. Now that I'm in the chroot environment I mount /proc /sys /dev/pts and begin installing all the software that I want. When I get to apt-get mysql-server-5.1 it installs, stops the service, then upon restarting the service it fails and exits the install with an error. I can't seem to trace via the logs where the error is coming from and everytime I apt-get there after it tries to reinstall the mysql package. Funny thing is the sql server still works when I build the live cd. Anyone have any ideas?


  • Forsaken_GAForsaken_GA Member Posts: 4,024
    Without the error, it's hard to say. There's usually some of error, either during the installation process, from apt afterwards, or in /var/log/daemon.log|syslog

    Do you have mysql running in your normal environment? If so, when you try to install it in a chroot environment, it will fail if they're trying to bind to the same port on the same IP

    Oh, and if you want apt to move on from it, just edit /etc/init.d/mysql add exit 0; after the #!/bin/bash line at the top and then run apt again, it'll finish the install and leave you alone thereafter. I occasionally run into services that are picky about this while doing a dist-upgrade, and that lets me get past them and finish the upgrade, and then I can worry about the affected service thereafter. Just remember to take the line out of the init script after apt is done with it or you'll drive yourself bonkers as to why it isnt doing anything
  • NightShade03NightShade03 Member Posts: 1,383 ■■■■■■■□□□
    It seems that when I'm in my chroot environment and installing packages (apache, ssh, mysql) they all try to start the service after install and for whatever reason always fail to start. Only MySQL's install sees this as an issue which is when it starts throwing all kinds of errors. Most likely I have not mounted something for my chroot enviroment properly which is whats causing the services to fail after install (because they start and run fine on the live cd).

    Took your advice about the exit 0 and that cleared up my apt problem which helps. This is the first live cd I've custom made so I figured I would run into a few snags. Thanks for the advice. Next I'm on to a custom boot screen.
  • Chris:/*Chris:/* Member Posts: 658 ■■■■■■■■□□
    Perhaps this can help: Securing MySQL: step-by-step | Symantec Connect

    Unless I actually know everything you are doing and your setup or the errors you are seeing I cannot help. If you are still having problems hit me up. Cheers.
    M.S. Information Security and Assurance
    B.S. Computer Science - Summa Cum Laude
    A.A.S. Electronic Systems Technology
Sign In or Register to comment.