Skip to content
Permalink
Browse files

Only kill mysqld if running

  • Loading branch information...
NEMS Linux
NEMS Linux committed Sep 5, 2019
1 parent 0124439 commit b454cd5f5d2f58b31462947ea249e2ee7c93c8c0
Showing with 12 additions and 2 deletions.
  1. +12 −2 init.sh
14 init.sh
@@ -256,7 +256,12 @@ fi
# Replace the database with Sample database
systemctl stop mysql
# Force kill MySQL (in case safe mode prevents shutdown, as is the case on Docker)
sleep 3 && kill -9 $(pidof mysqld)
sleep 3
mysqldpid=$(pidof mysqld)
if [[ $mysldpid != "" ]]; then
kill -9 $mysqldpid
sleep 1
fi
rm -rf /var/lib/mysql/
if (( $(awk 'BEGIN {print ("'$ver'" >= "'1.5'")}') )); then
cp -R /root/nems/nems-migrator/data/1.5/mysql/NEMS-Sample /var/lib
@@ -268,7 +273,12 @@ fi
mv /var/lib/NEMS-Sample /var/lib/mysql
chown -R mysql:mysql /var/lib/mysql
# Force kill MySQL (in case safe mode prevents shutdown, as is the case on Docker)
sleep 3 && kill -9 $(pidof mysqld) && sleep 1
sleep 3
mysqldpid=$(pidof mysqld)
if [[ $mysldpid != "" ]]; then
kill -9 $mysqldpid
sleep 1
fi
systemctl start mysql

# Replace the Nagios cgi.cfg file with the sample and add username

0 comments on commit b454cd5

Please sign in to comment.
You can’t perform that action at this time.