Commit 9adfaf1b authored by unknown's avatar unknown

Added option --skip-kill-mysqld to mysqld_safe. This can be useful,

if one is running many mysqlds through mysqld_multi, for example.
Without this option, on Linux one mysqld_safe process may kill
other mysqlds as well, if started using the same binary and path.

parent f5fba553
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
# mysql.server works by first doing a cd to the base directory and from there # mysql.server works by first doing a cd to the base directory and from there
# executing mysqld_safe # executing mysqld_safe
KILL_MYSQLD=1;
trap '' 1 2 3 15 # we shouldn't let anyone kill us trap '' 1 2 3 15 # we shouldn't let anyone kill us
umask 007 umask 007
...@@ -34,6 +36,9 @@ parse_arguments() { ...@@ -34,6 +36,9 @@ parse_arguments() {
for arg do for arg do
case "$arg" in case "$arg" in
--skip-kill-mysqld*)
KILL_MYSQLD=0;
;;
# these get passed explicitly to mysqld # these get passed explicitly to mysqld
--basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;; --basedir=*) MY_BASEDIR_VERSION=`echo "$arg" | sed -e "s;--basedir=;;"` ;;
--datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;; --datadir=*) DATADIR=`echo "$arg" | sed -e "s;--datadir=;;"` ;;
...@@ -83,6 +88,7 @@ parse_arguments() { ...@@ -83,6 +88,7 @@ parse_arguments() {
done done
} }
MY_PWD=`pwd` MY_PWD=`pwd`
# Check if we are starting this relative (for the binary release) # Check if we are starting this relative (for the binary release)
if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \
...@@ -298,7 +304,7 @@ do ...@@ -298,7 +304,7 @@ do
break break
fi fi
if @IS_LINUX@ if test @IS_LINUX@ -a $KILL_MYSQLD -eq 1
then then
# Test if one process was hanging. # Test if one process was hanging.
# This is only a fix for Linux (running as base 3 mysqld processes) # This is only a fix for Linux (running as base 3 mysqld processes)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment