MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Bugs and Requests => Topic started by: Spacedust on 2016-03-12, 17:17:19

Title: mysqld restart needs also mysqld_safe
Post by: Spacedust on 2016-03-12, 17:17:19
Should be:

Quote
#!/bin/sh

echo "*** Process for MYSQL/MARIADB service ***"

if [ -f /etc/rc.d/init.d/mysql ] ; then
   if [ "$(/etc/rc.d/init.d/mysql status|grep pid)" == "" ] ; then
      /etc/rc.d/init.d/mysql start
   fi
   sleep 1
elif [ -f /etc/rc.d/init.d/mysqld ] ; then
   if [ "$(/etc/rc.d/init.d/mysqld status|grep pid)" == "" ] ; then
      /etc/rc.d/init.d/mysqld start
   fi
   sleep 1
else
   echo "  - No need started"
fi

echo "  - Process: restart"
if [ -f /etc/rc.d/init.d/mysql ] ; then
   /etc/rc.d/init.d/mysql stop
   pkill -9 mysql
   pkill -9 mysql_safe
   /etc/rc.d/init.d/mysql start
elif [ -f /etc/rc.d/init.d/mysqld ] ; then
   /etc/rc.d/init.d/mysqld stop
   pkill -9 mysqld
   pkill -9 mysql_safe
   /etc/rc.d/init.d/mysqld start
fi
echo "No message for restart"