cron job to auto restart mysql or httpd or even droplet when errors
Sometimes my droplet has a problem Error establishing database connection.
Im fixing it now. The temp way is to restart mysql then things would be ok for few hours or days.
Im also thinking a temporary way until i can truly solve the above problem.
Step A. Auto restart mysql whenever error happens => I created a cron job to do this.
Step B. But sometimes even the mysql or http were hanging out and cant be restarted. In this time I had to poweroff my droplet then turn it on again.
So how to define the way for this cron job?
I knew how to do A but not B.
Mine: Wordpress, Centos 6.5 64, Virtualmin
PS: Im not a tech guy so pls dont use complex jargons :-)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.