Starting Processes on Boot

vps

#1

So for various reasons not worth getting into here, I decided to get rid of my VPS mysql server, and instead run mysql on my VPS webserver. This entailed installing the mysql server, which was fairly painless. The whole thing has been working great in this configuration, except for one small thing: the mysql server doesn’t automatically restart when the server is rebooted.

So the normal way I manually start mysql is by running
/etc/init.d/mysql start
This works fine. Permissions and ownership of /etc/init.d/mysql is the same as every other file in that directory.

I have symbolic links to /etc/init.d/mysql in two places:
/etc/rc3.d/S99mysql
/etc/rc0.d/K01mysql

I know that these symbolic links aren’t messed up because I’ve started the mysql server by running “/etc/rc3.d/S99mysql start”. I know that I’m in run level three from “who -r”. But clearly /etc/rc3.d/S99mysql is either not getting run or fails when it runs, because mysql is never running after a reboot.

Normally I’d watch for error messages on the console during boot, but for a VPS server there doesn’t seem to be a console. dmesg doesn’t seem to work, and even if it did, it probably wouldn’t include messages printed by init scripts. So I’m a bit perplexed as to how to even debug this. Any advice?


#2

Until you receive a better response, a band-aid approach might be to implement a crontab that checks for the process periodically (e.g. 1m) and start it if not found.


#3

How did you install MySQL?

In particular, how did the links in rc3.d get created? Try running “update-rc.d mysql defaults” (as root) to try repairing them.


#4

Thanks, Andrew F - that was what I needed. I removed the links I had created manually and ran the command you recommended, and now things work.

Installation was from the latest mysql.com tarball. I’m a little old fashioned - the last Unix versions I administered were System III and 4.2bsd. Oh, and I guess I was an OpenBSD expert for a while. I tend not to know about all the layers that have been built on top of the old stuff in the last few decades.