List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:April 16 2005 5:03am
Subject:bk commit into 5.0 tree (jimw:1.1894) BUG#9829
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1894 05/04/15 20:03:42 jimw@stripped +2 -0
  Clean up mysqlmanager integration into mysql.server.sh. (Bug #9829)

  scripts/make_binary_distribution.sh
    1.80 05/04/15 20:03:38 jimw@stripped +1 -1
    Replace libexecdir in mysql.server.sh

  support-files/mysql.server.sh
    1.46 05/04/15 19:51:52 jimw@stripped +13 -2
    Check for mysqlmanager in libexecdir, sbindir, and bindir,
    to cover all the bases.

  support-files/mysql.server.sh
    1.45 05/04/15 19:28:54 jimw@stripped +50 -5
    If mysqlmanager can't be found, try to use mysqld_safe.
    Re-add 'reload' support, although it only reloads the server.

  support-files/mysql.server.sh
    1.44 05/04/15 19:12:15 jimw@stripped +1 -1
    Fix path for sbindir when basedir is set (binary distribution)

  scripts/make_binary_distribution.sh
    1.79 05/04/15 19:10:39 jimw@stripped +1 -1
    Use configured @MYSQLD_USER@ in replacement of mysql.server.sh

  support-files/mysql.server.sh
    1.43 05/04/15 19:09:53 jimw@stripped +4 -4
    Pick up user setting from .cnf files

  support-files/mysql.server.sh
    1.42 05/04/15 19:07:47 jimw@stripped +1 -1
    Use full complement of documented groups for server arguments

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-build

--- 1.78/scripts/make_binary_distribution.sh	2005-04-06 07:23:32 -07:00
+++ 1.80/scripts/make_binary_distribution.sh	2005-04-15 20:03:38 -07:00
@@ -233,7 +233,7 @@
   chmod a+x $BASE/bin/*
   $CP scripts/* $BASE/bin
   $BASE/bin/replace \@localstatedir\@ ./data \@bindir\@ ./bin \@scriptdir\@ ./bin
\@libexecdir\@ ./bin \@sbindir\@ ./bin \@prefix\@ . \@HOSTNAME\@ @HOSTNAME@
\@pkgdatadir\@ ./support-files < $SOURCE/scripts/mysql_install_db.sh >
$BASE/scripts/mysql_install_db
-  $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin
\@MYSQLD_USER\@ mysql \@localstatedir\@ /usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@
< $SOURCE/support-files/mysql.server.sh > $BASE/support-files/mysql.server
+  $BASE/bin/replace \@prefix\@ /usr/local/mysql \@bindir\@ ./bin \@sbindir\@ ./bin
\@libexecdir\@ ./bin \@MYSQLD_USER\@ @MYSQLD_USER@ \@localstatedir\@
/usr/local/mysql/data \@HOSTNAME\@ @HOSTNAME@ < $SOURCE/support-files/mysql.server.sh
> $BASE/support-files/mysql.server
   $BASE/bin/replace /my/gnu/bin/hostname /bin/hostname -- $BASE/bin/mysqld_safe
   mv $BASE/support-files/binary-configure $BASE/configure
   chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-*
$BASE/support-files/mysql.server $BASE/configure

--- 1.41/support-files/mysql.server.sh	2005-04-01 00:13:28 -08:00
+++ 1.46/support-files/mysql.server.sh	2005-04-15 19:51:52 -07:00
@@ -48,15 +48,19 @@
 
 # Set some defaults
 pid_file=
+server_pid_file=
+user=@MYSQLD_USER@
 if test -z "$basedir"
 then
   basedir=@prefix@
   bindir=@bindir@
   datadir=@localstatedir@
   sbindir=@sbindir@
+  libexecdir=@libexecdir@
 else
   bindir="$basedir/bin"
-  sbindir="$basedir/sbin"
+  sbindir="$basedir/bin"
+  libexecdir="$basedir/bin"
 fi
 
 #
@@ -86,6 +90,8 @@
     case "$arg" in
       --basedir=*)  basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
       --datadir=*)  datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+      --user=*)  user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+      --pid-file=*) server_pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
     esac
   done
 }
@@ -94,6 +100,7 @@
   for arg do
     case "$arg" in
       --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
+      --user=*)  user=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
     esac
   done
 }
@@ -175,7 +182,7 @@
   extra_args="-e $datadir/my.cnf"
 fi
 
-parse_server_arguments `$print_defaults $extra_args mysqld`
+parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server
mysql.server`
 
 # Look for the pidfile 
 parse_manager_arguments `$print_defaults $extra_args manager`
@@ -192,9 +199,15 @@
     * )  pid_file="$datadir/$pid_file" ;;
   esac
 fi
-
-user=@MYSQLD_USER@
-USER_OPTION="--user=$user"
+if test -z "$server_pid_file"
+then
+  server_pid_file=$datadir/`@HOSTNAME@`.pid
+else
+  case "$server_pid_file" in
+    /* ) ;;
+    * )  server_pid_file="$datadir/$server_pid_file" ;;
+  esac
+fi
 
 # Safeguard (relative paths, core dumps..)
 cd $basedir
@@ -203,12 +216,21 @@
   'start')
     # Start daemon
 
-    if test -x $sbindir/mysqlmanager
+    manager=$bindir/mysqlmanager
+    if test -x $libexecdir/mysqlmanager
+    then
+      manager=$libexecdir/mysqlmanager
+    elif test -x $bindir/mysqlmanager
+    then
+      manager=$sbindir/mysqlmanager
+    fi
+
+    if test -x $manager
     then
       # Give extra arguments to mysqld with the my.cnf file. This script may
       # be overwritten at next upgrade.
       echo $echo_n "Starting MySQL"
-      $sbindir/mysqlmanager $USER_OPTION --pid-file=$pid_file >/dev/null 2>&1
&
+      $manager --user=$user --pid-file=$pid_file >/dev/null 2>&1 &
       wait_for_pid created
 
       # Make lock for RedHat / SuSE
@@ -216,14 +238,38 @@
       then
         touch /var/lock/subsys/mysqlmanager
       fi
+    elif test -x $bindir/mysqld_safe
+    then
+      # Give extra arguments to mysqld with the my.cnf file. This script may  be
overwritten at next upgrade.
+      echo $echo_n "Starting MySQL"
+      pid_file=$server_pid_file
+      $bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file >/dev/null
2>&1 &
+      wait_for_pid created
+
+      # Make lock for RedHat / SuSE
+      if test -w /var/lock/subsys
+      then
+        touch /var/lock/subsys/mysql
+      fi
     else
-      log_failure_msg "Can't execute $sbindir/mysqlmanager"
+      log_failure_msg "Couldn't find MySQL manager or server"
     fi
     ;;
 
   'stop')
     # Stop daemon. We use a signal here to avoid having to know the
     # root password.
+
+    # The RedHat / SuSE lock directory to remove
+    lock_dir=/var/lock/subsys/mysqlmanager
+
+    # If the manager pid_file doesn't exist, try the server's
+    if test ! -s "$pid_file"
+    then
+      pid_file=$server_pid_file
+      lock_dir=/var/lock/subsys/mysql
+    fi
+
     if test -s "$pid_file"
     then
       mysqlmanager_pid=`cat $pid_file`
@@ -233,12 +279,12 @@
       wait_for_pid removed
 
       # delete lock for RedHat / SuSE
-      if test -f /var/lock/subsys/mysqlmanager
+      if test -f $lock_dir
       then
-        rm -f /var/lock/subsys/mysqlmanager
+        rm -f $lock_dir
       fi
     else
-      log_failure_msg "mysqlmanager PID file could not be found!"
+      log_failure_msg "MySQL manager or server PID file could not be found!"
     fi
     ;;
 
@@ -249,9 +295,19 @@
     $0 start
     ;;
 
+  'reload')
+    if test -s "$server_pid_file" ; then
+      mysqld_pid=`cat $server_pid_file`
+      kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
+      touch $server_pid_file
+    else
+      log_failure_msg "MySQL PID file could not be found!"
+    fi
+    ;;
+
   *)
     # usage
-    echo "Usage: $0 start|stop|restart"
+    echo "Usage: $0 start|stop|restart|reload"
     exit 1
     ;;
 esac
Thread
bk commit into 5.0 tree (jimw:1.1894) BUG#9829Jim Winstead16 Apr