Commit 4421c4a5 authored by unknown's avatar unknown

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

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

parents 6272f6f2 21c83834
...@@ -53,8 +53,10 @@ then ...@@ -53,8 +53,10 @@ then
basedir=@prefix@ basedir=@prefix@
bindir=@bindir@ bindir=@bindir@
datadir=@localstatedir@ datadir=@localstatedir@
sbindir=@sbindir@
else else
bindir="$basedir/bin" bindir="$basedir/bin"
sbindir="$basedir/sbin"
fi fi
# #
...@@ -79,11 +81,18 @@ case `echo "testing\c"`,`echo -n testing` in ...@@ -79,11 +81,18 @@ case `echo "testing\c"`,`echo -n testing` in
*) echo_n= echo_c='\c' ;; *) echo_n= echo_c='\c' ;;
esac esac
parse_arguments() { parse_server_arguments() {
for arg do for arg do
case "$arg" in case "$arg" in
--basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--datadir=*) datadir=`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/^[^=]*=//'` ;; --pid-file=*) pid_file=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac esac
done done
...@@ -104,7 +113,7 @@ wait_for_pid () { ...@@ -104,7 +113,7 @@ wait_for_pid () {
} }
# Get arguments from the my.cnf file, # 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 if test -x ./bin/my_print_defaults
then then
print_defaults="./bin/my_print_defaults" print_defaults="./bin/my_print_defaults"
...@@ -153,14 +162,17 @@ then ...@@ -153,14 +162,17 @@ then
extra_args="-e $datadir/my.cnf" extra_args="-e $datadir/my.cnf"
fi 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 # Set pid file if not given
# #
if test -z "$pid_file" if test -z "$pid_file"
then then
pid_file=$datadir/`@HOSTNAME@`.pid pid_file=$datadir/mysqlmanager-`@HOSTNAME@`.pid
else else
case "$pid_file" in case "$pid_file" in
/* ) ;; /* ) ;;
...@@ -168,6 +180,9 @@ else ...@@ -168,6 +180,9 @@ else
esac esac
fi fi
user=@MYSQLD_USER@
USER_OPTION="--user=$user"
# Safeguard (relative paths, core dumps..) # Safeguard (relative paths, core dumps..)
cd $basedir cd $basedir
...@@ -175,21 +190,21 @@ case "$mode" in ...@@ -175,21 +190,21 @@ case "$mode" in
'start') 'start')
# Start daemon # Start daemon
if test -x $bindir/mysqld_safe if test -x $sbindir/mysqlmanager
then then
# Give extra arguments to mysqld with the my.cnf file. This script may # Give extra arguments to mysqld with the my.cnf file. This script may
# be overwritten at next upgrade. # be overwritten at next upgrade.
echo $echo_n "Starting MySQL" 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 wait_for_pid
# Make lock for RedHat / SuSE # Make lock for RedHat / SuSE
if test -w /var/lock/subsys if test -w /var/lock/subsys
then then
touch /var/lock/subsys/mysql touch /var/lock/subsys/mysqlmanager
fi fi
else else
log_failure_msg "Can't execute $bindir/mysqld_safe" log_failure_msg "Can't execute $sbindir/mysqlmanager"
fi fi
;; ;;
...@@ -198,19 +213,19 @@ case "$mode" in ...@@ -198,19 +213,19 @@ case "$mode" in
# root password. # root password.
if test -s "$pid_file" if test -s "$pid_file"
then then
mysqld_pid=`cat $pid_file` mysqlmanager_pid=`cat $pid_file`
echo $echo_n "Shutting down MySQL" echo $echo_n "Shutting down MySQL"
kill $mysqld_pid kill $mysqlmanager_pid
# mysqld should remove the pid_file when it exits, so wait for it. # mysqlmanager should remove the pid_file when it exits, so wait for it.
wait_for_pid wait_for_pid
# delete lock for RedHat / SuSE # delete lock for RedHat / SuSE
if test -f /var/lock/subsys/mysql if test -f /var/lock/subsys/mysqlmanager
then then
rm -f /var/lock/subsys/mysql rm -f /var/lock/subsys/mysqlmanager
fi fi
else else
log_failure_msg "MySQL PID file could not be found!" log_failure_msg "mysqlmanager PID file could not be found!"
fi fi
;; ;;
...@@ -221,19 +236,9 @@ case "$mode" in ...@@ -221,19 +236,9 @@ case "$mode" in
$0 start $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 # usage
echo "Usage: $0 start|stop|restart|reload" echo "Usage: $0 start|stop|restart"
exit 1 exit 1
;; ;;
esac esac
...@@ -429,9 +429,11 @@ ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql ...@@ -429,9 +429,11 @@ ln -s %{_sysconfdir}/init.d/mysql $RPM_BUILD_ROOT%{_sbindir}/rcmysql
# (safe_mysqld will be gone in MySQL 4.1) # (safe_mysqld will be gone in MySQL 4.1)
ln -sf ./mysqld_safe $RBR%{_bindir}/safe_mysqld 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 # Just to make sure it's in the file list and marked as a config file
touch $RBR%{_sysconfdir}/my.cnf touch $RBR%{_sysconfdir}/my.cnf
touch $RBR%{_sysconfdir}/mysqlmanager.passwd
%pre server %pre server
# Shut down a previously installed server first # Shut down a previously installed server first
...@@ -551,6 +553,7 @@ fi ...@@ -551,6 +553,7 @@ fi
%doc %attr(644, root, man) %{_mandir}/man1/replace.1* %doc %attr(644, root, man) %{_mandir}/man1/replace.1*
%ghost %config(noreplace,missingok) %{_sysconfdir}/my.cnf %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}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisamchk %attr(755, root, root) %{_bindir}/myisamchk
...@@ -579,6 +582,7 @@ fi ...@@ -579,6 +582,7 @@ fi
%attr(755, root, root) %{_bindir}/safe_mysqld %attr(755, root, root) %{_bindir}/safe_mysqld
%attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld
%attr(755, root, root) %{_sbindir}/mysqlmanager
%attr(755, root, root) %{_sbindir}/rcmysql %attr(755, root, root) %{_sbindir}/rcmysql
%attr(644, root, root) %{_libdir}/mysql/mysqld.sym %attr(644, root, root) %{_libdir}/mysql/mysqld.sym
...@@ -690,9 +694,14 @@ fi ...@@ -690,9 +694,14 @@ fi
# itself - note that they must be ordered by date (important when # itself - note that they must be ordered by date (important when
# merging BK trees) # merging BK trees)
%changelog %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> * 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 for Max and Standard
* Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com> * Mon Feb 7 2005 Tomas Ulin <tomas@mysql.com>
......
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