diff options
author | unknown <patg@krsna.patg.net> | 2004-08-31 18:59:41 -0700 |
---|---|---|
committer | unknown <patg@krsna.patg.net> | 2004-08-31 18:59:41 -0700 |
commit | 0d80b507ffd32ac5151570c73e83250ff49a046d (patch) | |
tree | 222a63e493de00f649523de3a74b84496b8e8436 /scripts | |
parent | f1257b3f915949a836224a810b1973bfa13beeb9 (diff) | |
download | mariadb-git-0d80b507ffd32ac5151570c73e83250ff49a046d.tar.gz |
mysqld_safe.sh:
bug #5001, added conditional if to test if port set, then only kill the processes
for this port, not all processes (in the case of this bug where multiple servers
are killed.)
The change to the 'grep' to make sure mysqld_safe isn't killed was per Serg's
discovery that mysqld_safe would get killed.
In my testing, in killing one of the pids for a running server, the "if test ! -f $pid_file"
was the case that evaluated as true, so in order to test, I had to comment that block
out.
scripts/mysqld_safe.sh:
bug #5001, added conditional if to test if port set, then only kill the processes
for this port, not all processes (in the case of this bug where multiple servers
are killed.)
The change to the 'grep' to make sure mysqld_safe isn't killed was per Serg's
discovery that mysqld_safe would get killed.
In my testing, in killing one of the pids for a running server, the "if test ! -f $pid_file"
was the case that evaluated as true, so in order to test, I had to comment that block
out.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqld_safe.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 7b77bf449cd..8ad2ee1df4d 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -311,6 +311,7 @@ do fi if test ! -f $pid_file # This is removed if normal shutdown then + echo "STOPPING server from pid file $pid_file" break fi @@ -321,12 +322,24 @@ do # 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 process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` + if test -n "$mysql_tcp_port" + then + numofproces=`ps xa | grep -v "grep" | grep $ledir/$MYSQLD| grep -c "port=$mysql_tcp_port"` + else + numofproces=`ps xa | grep -v "grep" | grep -c $ledir/$MYSQLD` + fi + echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | sed -n '$p'` + if test -n "$mysql_tcp_port" + then + PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "port=$mysql_tcp_port" | sed -n '$p'` + else + PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | sed -n '$p'` + fi + for T in $PROC do break |