summaryrefslogtreecommitdiff
path: root/support-files
diff options
context:
space:
mode:
authorunknown <lenz@mysql.com>2002-12-05 22:05:31 +0100
committerunknown <lenz@mysql.com>2002-12-05 22:05:31 +0100
commit820589496fbae332bf2c65b46a28126cfe953ca7 (patch)
tree099892f349fe42652bdfd390c1f416a13a007795 /support-files
parent9b5167eeac3e8d14134769334d94f260cb5db277 (diff)
parent5e354455bed2b7df3b7433ad20ec518877dee49f (diff)
downloadmariadb-git-820589496fbae332bf2c65b46a28126cfe953ca7.tar.gz
Merge mysql.com:/space/my/mysql-4.0
into mysql.com:/space/my/mysql-4.0-build support-files/mysql.server.sh: Auto merged
Diffstat (limited to 'support-files')
-rw-r--r--support-files/mysql.server.sh9
-rw-r--r--support-files/mysql.spec.sh63
2 files changed, 55 insertions, 17 deletions
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index d52ade03836..7340cff9cad 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -174,9 +174,16 @@ case "$mode" in
fi
;;
+ 'restart')
+ # Stop the service and regardless of whether it was
+ # running or not, start it again.
+ $0 stop
+ $0 start
+ ;;
+
*)
# usage
- echo "usage: $0 start|stop"
+ echo "Usage: $0 start|stop|restart"
exit 1
;;
esac
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index dcff17dee03..978e04e3268 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -71,7 +71,7 @@ Este pacote contém os clientes padrão para o MySQL.
%package bench
Release: %{release}
-Requires: %{name}-client MySQL-DBI-perl-bin perl
+Requires: %{name}-client perl-DBI perl
Summary: MySQL - Benchmarks and test system
Group: Applications/Databases
Summary(pt_BR): MySQL - Medições de desempenho
@@ -269,7 +269,7 @@ RBR=$RPM_BUILD_ROOT
MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
# Ensure that needed directories exists
-install -d $RBR/etc/{logrotate.d,rc.d/init.d}
+install -d $RBR/etc/{logrotate.d,init.d}
install -d $RBR/var/lib/mysql/mysql
install -d $RBR/usr/share/{sql-bench,mysql-test}
install -d $RBR%{_mandir}
@@ -290,14 +290,20 @@ install -m644 $MBD/sql/mysqld.sym $RBR/usr/lib/mysql/mysqld.sym
# Install logrotate and autostart
install -m644 $MBD/support-files/mysql-log-rotate $RBR/etc/logrotate.d/mysql
-install -m755 $MBD/support-files/mysql.server $RBR/etc/rc.d/init.d/mysql
+install -m755 $MBD/support-files/mysql.server $RBR/etc/init.d/mysql
# Create symbolic compatibility link safe_mysqld -> mysqld_safe
# (safe_mysqld will be gone in MySQL 4.1)
ln -sf ./mysqld_safe $RBR/usr/bin/safe_mysqld
%pre
-if test -x /etc/rc.d/init.d/mysql
+# Shut down a previously installed server first
+if test -x /etc/init.d/mysql
+then
+ /etc/init.d/mysql stop > /dev/null 2>&1
+ echo "Giving mysqld a couple of seconds to exit nicely"
+ sleep 5
+elif test -x /etc/rc.d/init.d/mysql
then
/etc/rc.d/init.d/mysql stop > /dev/null 2>&1
echo "Giving mysqld a couple of seconds to exit nicely"
@@ -313,7 +319,15 @@ if test ! -d $mysql_datadir/mysql; then mkdir $mysql_datadir/mysql; fi
if test ! -d $mysql_datadir/test; then mkdir $mysql_datadir/test; fi
# Make MySQL start/shutdown automatically when the machine does it.
-/sbin/chkconfig --add mysql
+# use insserv for older SuSE Linux versions
+if test -x /sbin/insserv
+then
+ /sbin/insserv /etc/init.d/mysql
+# use chkconfig on Red Hat and newer SuSE releases
+elif test -x /sbin/chkconfig
+then
+ /sbin/chkconfig --add mysql
+fi
# Create a MySQL user. Do not report any problems if it already
# exists. This is redhat specific and should be handled more portable
@@ -334,31 +348,37 @@ chown -R mysql $mysql_datadir
chmod -R og-rw $mysql_datadir/mysql
# Restart in the same way that mysqld will be started normally.
-/etc/rc.d/init.d/mysql start
+/etc/init.d/mysql start
# Allow safe_mysqld to start mysqld and print a message before we exit
sleep 2
%post Max
# Restart mysqld, to use the new binary.
-# There may be a better way to handle this.
-/etc/rc.d/init.d/mysql stop > /dev/null 2>&1
-echo "Giving mysqld a couple of seconds to restart"
-sleep 5
-/etc/rc.d/init.d/mysql start
-sleep 2
+echo "Restarting mysqld."
+/etc/init.d/mysql restart > /dev/null 2>&1
%preun
if test $1 = 0
then
- if test -x /etc/rc.d/init.d/mysql
+ # Stop MySQL before uninstalling it
+ if test -x /etc/init.d/mysql
then
- /etc/rc.d/init.d/mysql stop > /dev/null
+ /etc/init.d/mysql stop > /dev/null
fi
# Remove autostart of mysql
- /sbin/chkconfig --del mysql
+ # for older SuSE Linux versions
+ if test -x /sbin/insserv
+ then
+ /sbin/insserv -r /etc/init.d/mysql
+ # use chkconfig on Red Hat and newer SuSE releases
+ elif test -x /sbin/chkconfig
+ then
+ /sbin/chkconfig --del mysql
+ fi
fi
+
# We do not remove the mysql user since it may still own a lot of
# database files.
@@ -412,7 +432,7 @@ fi
%attr(644, root, root) /usr/lib/mysql/mysqld.sym
%attr(644, root, root) /etc/logrotate.d/mysql
-%attr(755, root, root) /etc/rc.d/init.d/mysql
+%attr(755, root, root) /etc/init.d/mysql
%attr(755, root, root) /usr/share/mysql/
@@ -482,6 +502,17 @@ fi
%changelog
+* Wed Nov 27 2002 Lenz Grimmer <lenz@mysql.com>
+
+- moved init script from /etc/rc.d/init.d to /etc/init.d (the majority of
+ Linux distributions now support this scheme as proposed by the LSB either
+ directly or via a compatibility symlink)
+- Use new "restart" init script action instead of starting and stopping
+ separately
+- Be more flexible in activating the automatic bootup - use insserv (on
+ older SuSE versions) or chkconfig (Red Hat, newer SuSE versions and
+ others) to create the respective symlinks
+
* Wed Sep 25 2002 Lenz Grimmer <lenz@mysql.com>
- MySQL-Max now requires MySQL >= 4.0 to avoid version mismatches