Commit 4421c4a5 authored by unknown's avatar unknown
Browse files

Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0

into mysql.com:/home/cps/mysql/devel/im-fix-review

parents 6272f6f2 21c83834
Loading
Loading
Loading
Loading
+32 −27
Original line number Diff line number Diff line
@@ -53,8 +53,10 @@ then
  basedir=@prefix@
  bindir=@bindir@
  datadir=@localstatedir@
  sbindir=@sbindir@
else
  bindir="$basedir/bin"
  sbindir="$basedir/sbin"
fi

#
@@ -79,11 +81,18 @@ case `echo "testing\c"`,`echo -n testing` in
    *)       echo_n=   echo_c='\c' ;;
esac

parse_arguments() {
parse_server_arguments() {
  for arg do
    case "$arg" in
      --basedir=*)  basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
      --datadir=*)  datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
    esac
  done
}

parse_manager_arguments() {
  for arg do
    case "$arg" in
      --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
    esac
  done
@@ -104,7 +113,7 @@ wait_for_pid () {
}

# Get arguments from the my.cnf file,
# groups [mysqld] [mysql_server] and [mysql.server]
# the only group, which is read from now on is [mysqld]
if test -x ./bin/my_print_defaults
then
  print_defaults="./bin/my_print_defaults"
@@ -153,14 +162,17 @@ then
  extra_args="-e $datadir/my.cnf"
fi

parse_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server`
parse_server_arguments `$print_defaults $extra_args mysqld`

# Look for the pidfile 
parse_manager_arguments `$print_defaults $extra_args manager`

#
# Set pid file if not given
#
if test -z "$pid_file"
then
  pid_file=$datadir/`@HOSTNAME@`.pid
  pid_file=$datadir/mysqlmanager-`@HOSTNAME@`.pid
else
  case "$pid_file" in
    /* ) ;;
@@ -168,6 +180,9 @@ else
  esac
fi

user=@MYSQLD_USER@
USER_OPTION="--user=$user"

# Safeguard (relative paths, core dumps..)
cd $basedir

@@ -175,21 +190,21 @@ case "$mode" in
  'start')
    # Start daemon

    if test -x $bindir/mysqld_safe
    if test -x $sbindir/mysqlmanager
    then
      # Give extra arguments to mysqld with the my.cnf file. This script may
      # be overwritten at next upgrade.
      echo $echo_n "Starting MySQL"
      $bindir/mysqld_safe --datadir=$datadir --pid-file=$pid_file >/dev/null 2>&1 &
      $sbindir/mysqlmanager $USER_OPTION --pid-file=$pid_file >/dev/null 2>&1 &
      wait_for_pid

      # Make lock for RedHat / SuSE
      if test -w /var/lock/subsys
      then
        touch /var/lock/subsys/mysql
        touch /var/lock/subsys/mysqlmanager
      fi
    else
      log_failure_msg "Can't execute $bindir/mysqld_safe"
      log_failure_msg "Can't execute $sbindir/mysqlmanager"
    fi
    ;;

@@ -198,19 +213,19 @@ case "$mode" in
    # root password.
    if test -s "$pid_file"
    then
      mysqld_pid=`cat $pid_file`
      mysqlmanager_pid=`cat $pid_file`
      echo $echo_n "Shutting down MySQL"
      kill $mysqld_pid
      # mysqld should remove the pid_file when it exits, so wait for it.
      kill $mysqlmanager_pid
      # mysqlmanager should remove the pid_file when it exits, so wait for it.
      wait_for_pid

      # delete lock for RedHat / SuSE
      if test -f /var/lock/subsys/mysql
      if test -f /var/lock/subsys/mysqlmanager
      then
        rm -f /var/lock/subsys/mysql
        rm -f /var/lock/subsys/mysqlmanager
      fi
    else
      log_failure_msg "MySQL PID file could not be found!"
      log_failure_msg "mysqlmanager PID file could not be found!"
    fi
    ;;

@@ -221,19 +236,9 @@ case "$mode" in
    $0 start
    ;;

  'reload')
    if test -s "$pid_file" ; then
      mysqld_pid=`cat $pid_file`
      kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL"
      touch $pid_file
    else
      log_failure_msg "MySQL PID file could not be found!"
    fi
  ;;

  *)
    # usage
    echo "Usage: $0 start|stop|restart|reload"
    echo "Usage: $0 start|stop|restart"
    exit 1
    ;;
esac
+11 −2
Original line number Diff line number Diff line
@@ -429,9 +429,11 @@ ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql
# (safe_mysqld will be gone in MySQL 4.1)
ln -sf ./mysqld_safe $RBR%{_bindir}/safe_mysqld

# Touch the place where the my.cnf config file might be located
# Touch the place where the my.cnf config file and mysqlmanager.passwd
# (MySQL Instance Manager password file) might be located
# Just to make sure it's in the file list and marked as a config file
touch $RBR%{_sysconfdir}/my.cnf
touch $RBR%{_sysconfdir}/mysqlmanager.passwd

%pre server
# Shut down a previously installed server first
@@ -551,6 +553,7 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/replace.1*

%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf
%ghost %config(noreplace,missingok) %{_sysconfdir}/mysqlmanager.passwd

%attr(755, root, root) %{_bindir}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisamchk
@@ -579,6 +582,7 @@ fi
%attr(755, root, root) %{_bindir}/safe_mysqld

%attr(755, root, root) %{_sbindir}/mysqld
%attr(755, root, root) %{_sbindir}/mysqlmanager
%attr(755, root, root) %{_sbindir}/rcmysql
%attr(644, root, root) %{_libdir}/mysql/mysqld.sym

@@ -690,9 +694,14 @@ fi
# itself - note that they must be ordered by date (important when
# merging BK trees)
%changelog 
* Sun Feb 20 2005 Petr Chardin <petr@mysql.com>

- Install MySQL Instance Manager together with mysqld, toch mysqlmanager
  password file

* Mon Feb 14 2005 Lenz Grimmer <lenz@mysql.com>

* Fixed the compilation comments and moved them into the separate build sections
- Fixed the compilation comments and moved them into the separate build sections
  for Max and Standard

* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com>