Tech Tips

  1. Uncategorized
  2. 152 view

[Shell][mysql]Monitor mysqld process and reboot it if it’s needed

Target

mysqld die sometimes at my web app,
So I tried to make a shell script to reboot the process if the process died.

source

#!/bin/sh

PROCESS=`ps -ef | grep /usr/sbin/mysqld | grep -v grep | wc -l`
if test $PROCESS -eq 0
then
        LOG=`sudo /etc/init.d/mysql start`
fi

Make this run at a cycle with crontab.

Uncategorized recent post

  1. Run Amazon FreeRTOS on M5Stack Core2 for AWS …

  2. Udacity Self-Driving Car Engineer Nanodegree …

  3. Install sbt 1.0.0 and run sample template

  4. Visualization of Neural Network and its Train…

  5. [Machine Learning]Created docker image includ…

関連記事

PAGE TOP