Mysql not starting automatically

bloggz

Member
Jul 20, 2004
8
0
151
Hi,

I've been having problems with MySQL (4.1) not starting properly on a reboot.

We're running:
FC5
WHM 10.8.0 cPanel 10.9.0-C43
Fedora i686 - WHM X v3.1.0

When I SSH in and 'service mysql start' it's fine, starts up and works well.

Now, having searched the forums and found various references to chkconfig:

Just wanted to be clear that Mysql is already list on chkconfig:

chkconfig --list mysql

mysql 0: off 1: off 2: on 3: on 4: on 5: on 6: off
and i've already run:

chkconfig mysql on
and
chkconfig --add mysql

Any ideas?

(Cheers) ;)
 
Last edited:

bloggz

Member
Jul 20, 2004
8
0
151
Yea, I just checked, both checked (Enable and Monitor), I also tried un-checking them, saving then re-checking them and saving again, reboot, no MySQL start.

service mysql start

and its up and running fine

(Is it normal to have MySQL list on chkconfig as run-level 3, 4 and 5?)
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,465
30
473
Go on, have a guess
Yes, runlevel 3 4 5 is correct for most application services. You'd only ever be using 3 anyway when running up applications on a web server.

The other likelihood is if you use a virtual /tmp partition (as created using /scripts/securetmp) as this mounts /tmp as the final boot step in /etc/rc.local. If the original /tmp has the wrong permissions on it (i.e. not 1777) before /scripts/securetmp in /etc/rc.local mounts the secured /tmp partition then MySQL startup will fail.

There's a few ways round this, choose one of them:

1. Add the following line to /etc/rc.local at the bottom:

/etc/init.d/mysql restart

2. Remove /scripts/securetmp from /etc/rc.local and mount the virtual /tmp partition within fstab instead with a line like:

/usr/tmpDSK /tmp ext3 loop,noexec,nosuid,nodev 1 0

You'll then probably want to secure /var/tmp by symlinking it to /tmp:

umount /var/tmp
rm -Rfv /var/tmp
ln -s /tmp /var/tmp


3. The messiest would be to kill all processes accessing /tmp then umount /tmp and check the permission on the original /tmp directory


BTW: I always do 2.
 

bloggz

Member
Jul 20, 2004
8
0
151
Hey chirpy, thanks for that, the restart is a bit of a hack but it works fine ;)

I had a look at the /tmp with your (excellent) ConfigServer Explorer and it was reading as 1777?

I'm going to try and do it properly tho... (i.e. 2)
 
Last edited: