1998-11-21 20:13:52 +00:00
|
|
|
--- scripts/safe_mysqld.sh.orig Wed Nov 4 13:21:22 1998
|
|
|
|
+++ scripts/safe_mysqld.sh Tue Nov 10 16:59:51 1998
|
1998-10-22 07:47:41 +00:00
|
|
|
@@ -12,33 +12,9 @@
|
|
|
|
|
|
|
|
trap '' 1 2 3 15 # we shouldn't let anyone kill us
|
1998-09-06 19:58:26 +00:00
|
|
|
|
|
|
|
-# Check if we are starting this relative (for the binary release)
|
|
|
|
-if test -f ./data/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \
|
|
|
|
- -x ./bin/mysqld
|
|
|
|
-then
|
|
|
|
- MY_BASEDIR_VERSION=`pwd` # Where bin, share and data is
|
|
|
|
- DATADIR=$MY_BASEDIR_VERSION/data # Where the databases are
|
|
|
|
- ledir=$MY_BASEDIR_VERSION/bin # Where mysqld are
|
|
|
|
-# Check if this is a 'moved install directory'
|
|
|
|
-elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \
|
|
|
|
- -x ./libexec/mysqld
|
|
|
|
-then
|
|
|
|
- MY_BASEDIR_VERSION=`pwd` # Where libexec, share and var is
|
|
|
|
- DATADIR=$MY_BASEDIR_VERSION/var # Where the databases are
|
|
|
|
- ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld are
|
|
|
|
-else
|
|
|
|
- MY_BASEDIR_VERSION=@prefix@
|
|
|
|
- DATADIR=@localstatedir@
|
|
|
|
- ledir=@libexecdir@
|
1998-10-22 07:47:41 +00:00
|
|
|
- if test ! -x $ledir/mysqld
|
|
|
|
- then
|
|
|
|
- echo "The file $ledir/mysqld doesn't exists or is not executable"
|
|
|
|
- echo "Please do a cd to the mysql installation directory and restart"
|
|
|
|
- echo "this scrift from there as follows:"
|
|
|
|
- echo "./bin/safe_mysqld".
|
|
|
|
- exit 1;
|
|
|
|
- fi
|
1998-09-06 19:58:26 +00:00
|
|
|
-fi
|
|
|
|
+MY_BASEDIR_VERSION=@prefix@
|
|
|
|
+DATADIR=@localstatedir@
|
|
|
|
+ledir=@libexecdir@
|
|
|
|
|
1998-11-21 20:13:52 +00:00
|
|
|
pid_file=$DATADIR/`@HOSTNAME@`.pid
|
1998-09-06 19:58:26 +00:00
|
|
|
log=$DATADIR/`@HOSTNAME@`.log
|
1998-11-21 20:13:52 +00:00
|
|
|
@@ -114,33 +90,6 @@
|
|
|
|
if test ! -f $pid_file # This is removed if normal shutdown
|
1998-09-06 19:58:26 +00:00
|
|
|
then
|
|
|
|
break;
|
|
|
|
- fi
|
|
|
|
- if @IS_LINUX@
|
|
|
|
- then
|
|
|
|
- # Test if one proces was hanging.
|
|
|
|
- # This is only a fix for Linux (running as base 3 mysqld processes)
|
|
|
|
- # but should work for the rest of the servers.
|
|
|
|
- # The only thing is ps x => redhat 5 gives warnings when using ps -x.
|
|
|
|
- # kill -9 is used or the proces won't react on the kill.
|
|
|
|
- numofproces=`ps x | grep -v "grep" | grep -c $ledir/mysqld`
|
1998-11-21 20:13:52 +00:00
|
|
|
- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
|
1998-09-06 19:58:26 +00:00
|
|
|
- I=1
|
|
|
|
- while test "$I" -le "$numofproces"
|
|
|
|
- do
|
|
|
|
- PROC=`ps x | grep $ledir/mysqld | grep -v "grep" | tail -1`
|
|
|
|
- for T in $PROC
|
|
|
|
- do
|
|
|
|
- break
|
|
|
|
- done
|
|
|
|
- # echo "TEST $I - $T **"
|
|
|
|
- if kill -9 $T
|
|
|
|
- then
|
1998-11-21 20:13:52 +00:00
|
|
|
- echo "mysqld proces hanging, pid $T - killed" | tee -a $err_log
|
1998-09-06 19:58:26 +00:00
|
|
|
- else
|
|
|
|
- break
|
|
|
|
- fi
|
|
|
|
- I=`expr $I + 1`
|
|
|
|
- done
|
|
|
|
fi
|
1998-11-21 20:13:52 +00:00
|
|
|
echo "mysqld restarted on " `date` | tee -a $err_log
|
1998-09-06 19:58:26 +00:00
|
|
|
done
|