The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Fresh Install: MySQL Fails on boot, but succeeds on restart

Discussion in 'General Discussion' started by geddes2, Jul 20, 2006.

  1. geddes2

    geddes2 Member

    Joined:
    Jun 19, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hello all, thank you for your help in the past, andd thank you in advance for taking the time to help with this latest problem.

    On two seperate servers I have the same problem, both are running RHEL 3. I install CPanel using layer1.cpanel.net/latest, everything works great, and then eventually I reboot my server. While booting, mysql fails to start, but after booting, I can log in and run /scripts/restartsrv_mysql and mysql starts up without a problem.

    So, I guess the question is, what does /scripts/restartsrv_mysql do right that /etc/init.d/mysql does wrong, and how can I fix that? I tried looking at the various scripts, and determined that one problem might be that the /etc/init.d/mysql script does not specify a basedir, but I have no idea what that basedir should be, since I don't even find a basedir line in Cpanel's script.

    I thought maybe the problem was that mysql was starting too early, but when I upped its number in rc3.d it still failed, albeit later in the boot process.

    Any insights into the problem would be appreciated.

    Thanks,
    - Geddes
     
  2. Rafaelfpviana

    Rafaelfpviana Well-Known Member

    Joined:
    Mar 12, 2004
    Messages:
    142
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Brazil
    Well, first of all I recommend that you put this in your /etc/my.cnf

    That way you will know if the server is trying to start mysql and if something happens in the process.

    Next, check if mysql is in chkconfig, to check do this:

    If you don't get a result like mine you can add mysql in chkconfig like this:
    Then add the runlevels to be checked if mysql stared and if it isn't running it will try to start it.
    Next time you reboot the server take a look the the log in /var/log/mysqld.log and if something went wrong you will know.

    Hope I helped you out.
    Have a good day.
     
    #2 Rafaelfpviana, Jul 21, 2006
    Last edited: Jul 21, 2006
  3. geddes2

    geddes2 Member

    Joined:
    Jun 19, 2006
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your help, looking at the log showed that on boot mysql was having problems writing to /tmp

    Then i looked at my fstab to find that cpanel had deleted my /tmp! Then I looked at local.rc, and found that cpanel runs a script called /scripts/securetmp that creates one on the fly on booting, but in rc3 it runs as S99, which is after mysql, which was at S64, and thus the problem. To fix, I just removed mysql from rc3.d and put the start command in the rc.local after the securetmp had been set up.

    - Geddes
     
  4. jefferyw18

    jefferyw18 Well-Known Member

    Joined:
    Apr 10, 2004
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Vancouver BC Canada
    cPanel Access Level:
    DataCenter Provider
    I Am Having Same Problem Could You Show Me Exactly What You Did To Fix It??
     
  5. archimedes79

    archimedes79 Registered

    Joined:
    May 1, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I just read this and it worked for me. The exact commands are like this.

    rm /etc/rc3.d/S64mysql

    vi /etc/rc.local

    (add this line to the bottom of the file)
    /etc/init.d/mysql start

    (save and exit with this command)
    :wq

    Then reboot
     
  6. archimedes79

    archimedes79 Registered

    Joined:
    May 1, 2007
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    After doing this, cpanel still would not start on boot so I did the same with the cpanel startup script.

    rm /etc/rc3.d/S95cpanel

    vi /etc/rc.local

    (add this line)
    /etc/init.d/cpanel start

    (save)
    :wq

    restart.
     
Loading...

Share This Page