Commit 28bf5364 authored by petr@mysql.com's avatar petr@mysql.com

IM setup patch. Enable IM instead of mysqld_safe in start/stop script.

Alter RPM to include mysqlmanger binary and config files.
parent 021f8d21
......@@ -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
;;
......@@ -219,21 +234,11 @@ case "$mode" in
# running or not, start it again.
$0 stop
$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
......@@ -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>
......
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