From d4f9f827e6eea683743e3cd20701d3fd2b91d050 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Sun, 13 Mar 2005 11:57:26 +0000 Subject: [PATCH] This commit was manufactured by cvs2git to create branch 'MYSQL_4_00'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Sprout from master 2004-09-12 12:15:22 UTC Arkadiusz Miśkiewicz '- updated for 4.0.21' Cherrypick from master 2004-12-25 13:00:13 UTC Jakub Bogusz '- use check that isn't broken with lib64': mysql-nptl.patch -> 1.2 Cherrypick from unlabeled-1.1.2 2005-03-13 11:57:14 UTC Arkadiusz Miśkiewicz '- up for 4.0.24': mysql-libwrap.patch -> 1.1.2.1 Cherrypick from unlabeled-1.12.2 2005-01-11 07:57:26 UTC Elan Ruusamäe '- wrrr, don't rotate stderr, it's later impossible to see anything from mysqld if it's rotated gziped or removed': mysql.logrotate -> 1.12.2.1 Cherrypick from unlabeled-1.235.2 2005-03-13 11:57:26 UTC Arkadiusz Miśkiewicz '- up to 4.0.24': mysql.spec -> 1.235.2.11 Cherrypick from unlabeled-1.70.2 2004-12-21 13:49:22 UTC Elan Ruusamäe '- no need to wait for mysqladmin shutdown': mysql.init -> 1.70.2.6 Delete: mysql-docs_make.patch mysql-dump_quote_db_names.patch mysql-fulltext-small.patch mysql-info-res.patch mysql-moreincludes.patch mysql-no-my_inet_ntoa.patch mysql-no_libnsl.patch mysql-opt.patch mysql.monitrc --- mysql-docs_make.patch | 23 -------- mysql-dump_quote_db_names.patch | 17 ------ mysql-fulltext-small.patch | 11 ---- mysql-info-res.patch | 73 ------------------------- mysql-libwrap.patch | 21 +++----- mysql-moreincludes.patch | 17 ------ mysql-no-my_inet_ntoa.patch | 15 ------ mysql-no_libnsl.patch | 24 --------- mysql-nptl.patch | 2 +- mysql-opt.patch | 26 --------- mysql.init | 47 ++++++++++++----- mysql.logrotate | 4 +- mysql.monitrc | 23 -------- mysql.spec | 94 +++++++++++++++++++++------------ 14 files changed, 102 insertions(+), 295 deletions(-) delete mode 100644 mysql-docs_make.patch delete mode 100644 mysql-dump_quote_db_names.patch delete mode 100644 mysql-fulltext-small.patch delete mode 100644 mysql-info-res.patch delete mode 100644 mysql-moreincludes.patch delete mode 100644 mysql-no-my_inet_ntoa.patch delete mode 100644 mysql-no_libnsl.patch delete mode 100644 mysql-opt.patch delete mode 100644 mysql.monitrc diff --git a/mysql-docs_make.patch b/mysql-docs_make.patch deleted file mode 100644 index fc0d224..0000000 --- a/mysql-docs_make.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -Naur mysql-3.23.25-beta/Docs/Makefile.am mysql-3.23.25-beta-p/Docs/Makefile.am ---- mysql-3.23.25-beta/Docs/Makefile.am Wed Sep 27 10:51:44 2000 -+++ mysql-3.23.25-beta-p/Docs/Makefile.am Thu Oct 12 21:40:23 2000 -@@ -18,7 +18,7 @@ - Support/generate-mirror-listing.pl - info_TEXINFOS = manual.texi - --targets = manual.txt mysql.info manual.html manual.pdf -+targets = mysql.info manual.html - - BUILT_SOURCES = $(targets) manual_toc.html include.texi - EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt INSTALL-BINARY ---- mysql-3.23.25-beta/Docs/Makefile.in Wed Sep 27 11:02:20 2000 -+++ mysql-3.23.25-beta-p/Docs/Makefile.in Thu Oct 12 22:03:10 2000 -@@ -168,7 +168,7 @@ - - info_TEXINFOS = manual.texi - --targets = manual.txt mysql.info manual.html manual.pdf -+targets = manual.txt mysql.info manual.html - - BUILT_SOURCES = $(targets) manual_toc.html include.texi - EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt INSTALL-BINARY diff --git a/mysql-dump_quote_db_names.patch b/mysql-dump_quote_db_names.patch deleted file mode 100644 index 2534075..0000000 --- a/mysql-dump_quote_db_names.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -urN mysql-4.0.12.org/client/mysqldump.c mysql-4.0.12/client/mysqldump.c ---- mysql-4.0.12.org/client/mysqldump.c Wed Apr 16 00:26:02 2003 -+++ mysql-4.0.12/client/mysqldump.c Wed Apr 16 00:37:52 2003 -@@ -1254,10 +1254,12 @@ - { - if (opt_databases || opt_alldbs) - { -+ char database_buff[NAME_LEN+3]; -+ - fprintf(md_result_file,"\n--\n-- Current Database: %s\n--\n", database); - if (!opt_create_db) - fprintf(md_result_file,"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n", -- database); -+ quote_name(database, database_buff)); - fprintf(md_result_file,"\nUSE %s;\n", database); - } - } diff --git a/mysql-fulltext-small.patch b/mysql-fulltext-small.patch deleted file mode 100644 index 8a4a176..0000000 --- a/mysql-fulltext-small.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- myisam/ftdefs.h Fri Jan 10 23:39:49 2003 -+++ myisam/ftdefs.h.tjbnym Fri Jan 10 23:39:39 2003 -@@ -22,7 +22,7 @@ - #include - #include - --#define MIN_WORD_LEN 4 -+#define MIN_WORD_LEN 3 - - #define HYPHEN_IS_DELIM - #define HYPHEN_IS_CONCAT /* not used for now */ diff --git a/mysql-info-res.patch b/mysql-info-res.patch deleted file mode 100644 index e2a551a..0000000 --- a/mysql-info-res.patch +++ /dev/null @@ -1,73 +0,0 @@ ---- mysql-3.23.54a/Docs/manual.texi.orig Mon Dec 16 12:40:58 2002 -+++ mysql-3.23.54a/Docs/manual.texi Mon Dec 16 15:04:14 2002 -@@ -29177,7 +29177,69 @@ - A few are reserved because MySQL needs them and is - (currently) using a @code{yacc} parser: - --@include reservedwords.texi -+@multitable @columnfractions .33 .33 .33 -+@item @strong{Word} @tab @strong{Word} @tab @strong{Word} -+@item @code{ADD} @tab @code{ALL} @tab @code{ALTER} -+@item @code{ANALYZE} @tab @code{AND} @tab @code{AS} -+@item @code{ASC} @tab @code{AUTO_INCREMENT} @tab @code{BDB} -+@item @code{BERKELEYDB} @tab @code{BETWEEN} @tab @code{BIGINT} -+@item @code{BINARY} @tab @code{BLOB} @tab @code{BOTH} -+@item @code{BTREE} @tab @code{BY} @tab @code{CASCADE} -+@item @code{CASE} @tab @code{CHANGE} @tab @code{CHAR} -+@item @code{CHARACTER} @tab @code{COLLATE} @tab @code{COLUMN} -+@item @code{COLUMNS} @tab @code{CONSTRAINT} @tab @code{CREATE} -+@item @code{CROSS} @tab @code{CURRENT_DATE} @tab @code{CURRENT_TIME} -+@item @code{CURRENT_TIMESTAMP} @tab @code{DATABASE} @tab @code{DATABASES} -+@item @code{DAY_HOUR} @tab @code{DAY_MINUTE} @tab @code{DAY_SECOND} -+@item @code{DEC} @tab @code{DECIMAL} @tab @code{DEFAULT} -+@item @code{DELAYED} @tab @code{DELETE} @tab @code{DESC} -+@item @code{DESCRIBE} @tab @code{DISTINCT} @tab @code{DISTINCTROW} -+@item @code{DOUBLE} @tab @code{DROP} @tab @code{ELSE} -+@item @code{ENCLOSED} @tab @code{ERRORS} @tab @code{ESCAPED} -+@item @code{EXISTS} @tab @code{EXPLAIN} @tab @code{FIELDS} -+@item @code{FLOAT} @tab @code{FOR} @tab @code{FOREIGN} -+@item @code{FROM} @tab @code{FULLTEXT} @tab @code{FUNCTION} -+@item @code{GEOMETRY} @tab @code{GRANT} @tab @code{GROUP} -+@item @code{HASH} @tab @code{HAVING} @tab @code{HELP} -+@item @code{HIGH_PRIORITY} @tab @code{HOUR_MINUTE} @tab @code{HOUR_SECOND} -+@item @code{IF} @tab @code{IGNORE} @tab @code{IN} -+@item @code{INDEX} @tab @code{INFILE} @tab @code{INNER} -+@item @code{INNODB} @tab @code{INSERT} @tab @code{INT} -+@item @code{INTEGER} @tab @code{INTERVAL} @tab @code{INTO} -+@item @code{IS} @tab @code{JOIN} @tab @code{KEY} -+@item @code{KEYS} @tab @code{KILL} @tab @code{LEADING} -+@item @code{LEFT} @tab @code{LIKE} @tab @code{LIMIT} -+@item @code{LINES} @tab @code{LOAD} @tab @code{LOCK} -+@item @code{LONG} @tab @code{LONGBLOB} @tab @code{LONGTEXT} -+@item @code{LOW_PRIORITY} @tab @code{MASTER_SERVER_ID} @tab @code{MATCH} -+@item @code{MEDIUMBLOB} @tab @code{MEDIUMINT} @tab @code{MEDIUMTEXT} -+@item @code{MIDDLEINT} @tab @code{MINUTE_SECOND} @tab @code{MRG_MYISAM} -+@item @code{NATURAL} @tab @code{NOT} @tab @code{NULL} -+@item @code{NUMERIC} @tab @code{ON} @tab @code{OPTIMIZE} -+@item @code{OPTION} @tab @code{OPTIONALLY} @tab @code{OR} -+@item @code{ORDER} @tab @code{OUTER} @tab @code{OUTFILE} -+@item @code{PRECISION} @tab @code{PRIMARY} @tab @code{PRIVILEGES} -+@item @code{PROCEDURE} @tab @code{PURGE} @tab @code{READ} -+@item @code{REAL} @tab @code{REFERENCES} @tab @code{REGEXP} -+@item @code{RENAME} @tab @code{REPLACE} @tab @code{REQUIRE} -+@item @code{RESTRICT} @tab @code{RETURNS} @tab @code{REVOKE} -+@item @code{RIGHT} @tab @code{RLIKE} @tab @code{RTREE} -+@item @code{SELECT} @tab @code{SET} @tab @code{SHOW} -+@item @code{SMALLINT} @tab @code{SONAME} @tab @code{SPATIAL} -+@item @code{SQL_BIG_RESULT} @tab @code{SQL_CALC_FOUND_ROWS} @tab @code{SQL_SMALL_RESULT} -+@item @code{SSL} @tab @code{STARTING} @tab @code{STRAIGHT_JOIN} -+@item @code{STRIPED} @tab @code{TABLE} @tab @code{TABLES} -+@item @code{TERMINATED} @tab @code{THEN} @tab @code{TINYBLOB} -+@item @code{TINYINT} @tab @code{TINYTEXT} @tab @code{TO} -+@item @code{TRAILING} @tab @code{TYPES} @tab @code{UNION} -+@item @code{UNIQUE} @tab @code{UNLOCK} @tab @code{UNSIGNED} -+@item @code{UPDATE} @tab @code{USAGE} @tab @code{USE} -+@item @code{USER_RESOURCES} @tab @code{USING} @tab @code{VALUES} -+@item @code{VARBINARY} @tab @code{VARCHAR} @tab @code{VARYING} -+@item @code{WARNINGS} @tab @code{WHEN} @tab @code{WHERE} -+@item @code{WITH} @tab @code{WRITE} @tab @code{XOR} -+@item @code{YEAR_MONTH} @tab @code{ZEROFILL} -+@end multitable - - The following symbols (from the table above) are disallowed by ANSI SQL - but allowed by MySQL as column/table names. This is because some diff --git a/mysql-libwrap.patch b/mysql-libwrap.patch index b0cfb9f..7ce6293 100644 --- a/mysql-libwrap.patch +++ b/mysql-libwrap.patch @@ -1,7 +1,7 @@ -diff -urN mysql-4.0.10-gamma.org/sql/mysqld.cc mysql-4.0.10-gamma/sql/mysqld.cc ---- mysql-4.0.10-gamma.org/sql/mysqld.cc Wed Jan 29 12:29:20 2003 -+++ mysql-4.0.10-gamma/sql/mysqld.cc Wed Feb 12 02:04:17 2003 -@@ -96,7 +96,13 @@ +diff -urN mysql-4.0.24.org/sql/mysqld.cc mysql-4.0.24/sql/mysqld.cc +--- mysql-4.0.24.org/sql/mysqld.cc 2005-03-05 01:38:14.000000000 +0100 ++++ mysql-4.0.24/sql/mysqld.cc 2005-03-13 12:11:01.312220224 +0100 +@@ -99,7 +99,16 @@ #endif /* __WIN__ */ #ifdef HAVE_LIBWRAP @@ -12,16 +12,9 @@ diff -urN mysql-4.0.10-gamma.org/sql/mysqld.cc mysql-4.0.10-gamma/sql/mysqld.cc +#undef hosts_access +#undef sock_host +#undef eval_client - #include - #ifdef NEED_SYS_SYSLOG_H - #include -@@ -105,6 +111,9 @@ - int deny_severity = LOG_WARNING; - - #ifdef __STDC__ +extern int hosts_access(struct request_info *); +extern int sock_host(struct request_info *); +extern int eval_client(struct request_info *); - #define my_fromhost(A) fromhost(A) - #define my_hosts_access(A) hosts_access(A) - #define my_eval_client(A) eval_client(A) + #include + #ifdef NEED_SYS_SYSLOG_H + #include diff --git a/mysql-moreincludes.patch b/mysql-moreincludes.patch deleted file mode 100644 index 30fe3bd..0000000 --- a/mysql-moreincludes.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- mysql-3.23.52/include/Makefile.am.orig Wed Aug 14 00:08:16 2002 -+++ mysql-3.23.52/include/Makefile.am Sat Aug 17 09:09:22 2002 -@@ -20,12 +20,13 @@ - mysqld_error.h my_list.h \ - my_pthread.h my_no_pthread.h raid.h errmsg.h \ - my_global.h my_net.h \ -+ my_dir.h \ - sslopt-case.h sslopt-longopts.h sslopt-usage.h \ - sslopt-vars.h $(BUILT_SOURCES) - noinst_HEADERS = global.h config-win.h config-os2.h\ - nisam.h heap.h merge.h my_bitmap.h\ - myisam.h myisampack.h myisammrg.h ft_global.h\ -- my_dir.h mysys_err.h my_base.h \ -+ mysys_err.h my_base.h \ - my_nosys.h my_alarm.h queues.h \ - my_tree.h hash.h thr_alarm.h thr_lock.h \ - getopt.h t_ctype.h violite.h \ diff --git a/mysql-no-my_inet_ntoa.patch b/mysql-no-my_inet_ntoa.patch deleted file mode 100644 index 5e4a95c..0000000 --- a/mysql-no-my_inet_ntoa.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -urN mysql-4.0.10-gamma.org/vio/viosocket.c mysql-4.0.10-gamma/vio/viosocket.c ---- mysql-4.0.10-gamma.org/vio/viosocket.c Thu Feb 13 18:28:22 2003 -+++ mysql-4.0.10-gamma/vio/viosocket.c Thu Feb 13 18:28:35 2003 -@@ -294,9 +294,9 @@ - DBUG_PRINT("exit", ("getpeername gave error: %d", socket_errno)); - DBUG_RETURN(1); - } -- my_inet_ntoa(vio->remote.sin_addr,buf); -+/* my_inet_ntoa(vio->remote.sin_addr,buf); */ - } -- DBUG_PRINT("exit", ("addr: %s", buf)); -+/* DBUG_PRINT("exit", ("addr: %s", buf)); */ - DBUG_RETURN(0); - } - diff --git a/mysql-no_libnsl.patch b/mysql-no_libnsl.patch deleted file mode 100644 index 4849222..0000000 --- a/mysql-no_libnsl.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- mysql-3.23.51/configure.in.orig Mon Jun 3 12:39:03 2002 -+++ mysql-3.23.51/configure.in Thu Jun 13 09:41:57 2002 -@@ -675,16 +675,14 @@ - - AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity)) - --AC_CHECK_LIB(nsl_r, gethostbyname_r, [], -- AC_CHECK_LIB(nsl, gethostbyname_r)) --AC_CHECK_FUNC(gethostbyname_r) -+AC_CHECK_FUNC(gethostbyname_r, [], -+ [AC_CHECK_LIB(nsl_r, gethostbyname_r, -+ [AC_CHECK_LIB(nsl, gethostbyname_r)] -+ )] -+) - - AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt)) --AC_CHECK_FUNC(yp_get_default_domain, , -- AC_CHECK_LIB(nsl, yp_get_default_domain)) - AC_CHECK_FUNC(p2open, , AC_CHECK_LIB(gen, p2open)) --# This may get things to compile even if bind-8 is installed --AC_CHECK_FUNC(bind, , AC_CHECK_LIB(bind, bind)) - # For crypt() on Linux - AC_CHECK_LIB(crypt, crypt) - AC_CHECK_FUNC(crypt, AC_DEFINE(HAVE_CRYPT)) diff --git a/mysql-nptl.patch b/mysql-nptl.patch index 8e3153a..b0286e1 100644 --- a/mysql-nptl.patch +++ b/mysql-nptl.patch @@ -6,7 +6,7 @@ AC_MSG_CHECKING("LinuxThreads") - res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l` - if test "$res" -gt 0 -+ if test -f /lib/libpthread.so.0 ++ if grep -qs pthread_create /usr/include/pthread.h then AC_MSG_RESULT("Found") AC_DEFINE(HAVE_LINUXTHREADS) diff --git a/mysql-opt.patch b/mysql-opt.patch deleted file mode 100644 index d4e196a..0000000 --- a/mysql-opt.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- mysql-3.23.56/configure.in.orig Sat Feb 10 02:57:16 2001 -+++ mysql-3.23.56/configure.in Sat Feb 10 03:21:04 2001 -@@ -1252,17 +1252,17 @@ - if test "$with_debug" = "yes" - then - # Medium debug. -- CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" -- CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" -+ CFLAGS="-DDBUG_ON -DSAFE_MUTEX $CFLAGS" -+ CXXFLAGS="-DSAFE_MUTEX $CXXFLAGS" - elif test "$with_debug" = "full" - then - # Full debug. Very slow in some cases -- CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" -- CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" -+ CFLAGS="-DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" -+ CXXFLAGS="-DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" - else - # Optimized version. No debug -- CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" -- CXXFLAGS="$OPTIMIZE_CXXFLAGS -DDBUG_OFF $CXXFLAGS" -+ CFLAGS="-DDBUG_OFF $CFLAGS" -+ CXXFLAGS="-DDBUG_OFF $CXXFLAGS" - fi - - # Force static compilation to avoid linking probles/get more speed diff --git a/mysql.init b/mysql.init index ea97cfb..5a8a5ae 100644 --- a/mysql.init +++ b/mysql.init @@ -6,7 +6,6 @@ # # description: A very fast and reliable SQL database engine. # - # Source function library . /etc/rc.d/init.d/functions @@ -18,7 +17,7 @@ if [ -f /etc/sysconfig/mysql ]; then . /etc/sysconfig/mysql else nls "Error: %s not found" /etc/sysconfig/mysql - nls " MySQL can't be run." + nls "%s can't be run." MySQL exit 1 fi @@ -26,15 +25,22 @@ if [ -n "$MYSQL_DB_CLUSTERS" ]; then nls "Warning: MYSQL_DB_CLUSTERS is set. It's obsolete. Use %s instead." /etc/mysql/clusters.conf fi -[ -f /etc/mysql/clusters.conf ]&& MYSQL_DB_CLUSTERS=$(grep -v '^#' /etc/mysql/clusters.conf | cut -s -f 2 -d '=') +if [ -f /etc/mysql/clusters.conf ]; then + MYSQL_DB_CLUSTERS=$(grep -v '^#' /etc/mysql/clusters.conf | cut -s -f 2 -d '=') + if [ -z "$MYSQL_DB_CLUSTERS" ]; then + nls "Warning: there are no configured clusters." + fi -if [ -z "$MYSQL_DB_CLUSTERS" ]; then +else nls "Warning: Missing clusters config file %s" /etc/mysql/clusters.conf - nls "Warning: or there is no configured clusters in it." - nls "Using default cluster /var/lib/mysql (compatibility mode)" - MYSQL_DB_CLUSTERS=/var/lib/mysql + if [ -z "$MYSQL_DB_CLUSTERS" ]; then + nls "Warning: there are no configured clusters." + nls "Using default cluster /var/lib/mysql (compatibility mode)" + MYSQL_DB_CLUSTERS=/var/lib/mysql + fi fi + # Check that networking is up if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then @@ -69,7 +75,7 @@ MYSQL_ERRLOG=/var/log/mysql/err # $1 - db cluster # # sets variables: -# MYSQL_STATUS = running | not running +# MYSQL_STATUS = running | not running | died # MYSQL_PID = pid of mysqld process # mysqlstatus() { @@ -84,7 +90,7 @@ mysqlstatus() { if [ ! -d "/proc/$MYSQL_PID" -a "$MYSQL_PID" != "unknown" ]; then MYSQL_STATUS="died" elif [ -d "/proc/$MYSQL_PID" ]; then - grep -q "$MYSQL_PIDFILE" /proc/$MYSQL_PID/cmdline && MYSQL_STATUS="running" || MYSQL_STATUS="not running" + grep -qa "$MYSQL_PIDFILE" /proc/$MYSQL_PID/cmdline && MYSQL_STATUS="running" || MYSQL_STATUS="not running" fi } @@ -103,8 +109,8 @@ mysqlgetconfig() { config_file=/etc/mysqld.conf else # TODO: convert this piece of crap to awk - config=`grep -v \"^#\" /etc/mysql/clusters.conf | grep "${clusterdir}$" | cut -s -f 1 -d '='` - if [ -f "$config" ]; then + config=`grep -v "^#" /etc/mysql/clusters.conf | grep "${clusterdir}$" | cut -s -f 1 -d '='` + if echo "$config" | grep -q '^/'; then config_file="$config" elif [ -f "/etc/mysql/$config" ]; then config_file=/etc/mysql/$config @@ -208,6 +214,16 @@ mysqlstop() { mysqlstatus "$clusterdir" msg_stopping "MySQL $clusterdir" busy + +# TODO +# graceful mysql shutdown with mysqladmin shutdown requires 'shutdown' +# privilege. create new user mysqlctl or rename mysql_logrotate to mysqlctl +# and give it both privs (flush-logs and shutdown)? + + # try graceful shutdown -- send shutdown command + /usr/bin/mysqladmin --defaults-file=$MYSQL_CONFIG ${MYSQL_SOCKET:+--socket=$MYSQL_SOCKET} shutdown + mysqlstatus "$clusterdir" + [ "$MYSQL_PID" != "unknown" ] && kill -TERM "$MYSQL_PID" 2> /dev/null # 3 seconds for nr in 1 2 3; do @@ -221,6 +237,8 @@ mysqlstop() { else ok fi + + # FIXME: should let mysqld remove pid by itself? rm -f "$MYSQL_PIDFILE" } @@ -495,7 +513,7 @@ This is done (after starting database) with: NOTE: mysql_logrotate password should be placed to $MYSQL_CONFIG in mysqladmin section. See the manual for more instructions. -IMPORTANT: The configuration file is mysqld.conf in MYSQ_DB_CLUSTERS directories. +IMPORTANT: The configuration file is mysqld.conf in MYSQL_DB_CLUSTERS directories. END_OF_MSG else @@ -568,6 +586,7 @@ case "$action" in mysqlsubsys ;; status) + status mysqld for mysqldir in $DB_CLUSTERS; do mysqlstatus "$mysqldir" echo "MySQL cluster $mysqldir: $MYSQL_STATUS" @@ -575,8 +594,8 @@ case "$action" in exit $? ;; restart|force-reload) - $0 stop - $0 start + $0 stop $DB_CLUSTERS + $0 start $DB_CLUSTERS exit $? ;; init) diff --git a/mysql.logrotate b/mysql.logrotate index 9bd4d19..3b89fed 100644 --- a/mysql.logrotate +++ b/mysql.logrotate @@ -1,6 +1,6 @@ -/var/log/mysql/err /var/log/mysql/log /var/log/mysql/isamlog.log /var/log/mysql/update* { +/var/log/mysql/log /var/log/mysql/isamlog.log /var/log/mysql/update* { olddir /var/log/archiv/mysql - notifempty + notifempty create 640 mysql mysql sharedscripts postrotate diff --git a/mysql.monitrc b/mysql.monitrc deleted file mode 100644 index f5467f8..0000000 --- a/mysql.monitrc +++ /dev/null @@ -1,23 +0,0 @@ -check process mysql with pidfile /var/lib/mysql/mysql.pid - group database - start program = "/etc/init.d/mysql restart" - stop program = "/etc/init.d/mysql stop" - if failed unix /var/lib/mysql/mysql.sock then restart - if 5 restarts within 5 cycles then timeout - depends on mysql_bin - depends on mysql_rc - -check file mysql_bin with path /usr/sbin/mysqld - group database - if failed checksum then unmonitor - if failed permission 755 then unmonitor - if failed uid root then unmonitor - if failed gid root then unmonitor - -check file mysql_rc with path /etc/init.d/mysql - group database - if failed checksum then unmonitor - if failed permission 754 then unmonitor - if failed uid root then unmonitor - if failed gid root then unmonitor - diff --git a/mysql.spec b/mysql.spec index 7004771..ee539fc 100644 --- a/mysql.spec +++ b/mysql.spec @@ -2,11 +2,15 @@ # - trigger that prepares system from pre-cluster into cluster # - trigger /etc/mysqld.conf into /etc/mysql/mysqld.conf. Solve possible # conflict with /var/lib/mysql/mysqld.conf -# - SECURITY: http://securitytracker.com/alerts/2004/Aug/1011008.html -# - SECURITY: http://securitytracker.com/alerts/2004/Aug/1010979.html +# - what's the libwrapper constistent name, i see in specs 'libwrap', 'tcpd', 'tcp_wrappers' # # Conditional build: %bcond_with bdb # Berkeley DB support +%bcond_without innodb # Without InnoDB support +%bcond_without isam # Without ISAM table format (used in mysql 3.22) +%bcond_without raid # Without raid +%bcond_without ssl # Without OpenSSL +%bcond_without tcpd # Without libwrap (tcp_wrappers) support # %include /usr/lib/rpm/macros.perl Summary: MySQL: a very fast and reliable SQL database engine @@ -18,11 +22,11 @@ Summary(uk): MySQL - Summary(zh_CN): MySQLÊý¾Ý¿â·þÎñÆ÷ Name: mysql Group: Applications/Databases -Version: 4.0.20 -Release: 4 -License: GPL -Source0: http://mysql.linux.cz/Downloads/MySQL-4.0/mysql-%{version}.tar.gz -# Source0-md5: 7c75ac74e23396bd228dbc2c2d1131df +Version: 4.0.24 +Release: 1 +License: GPL + MySQL FLOSS Exception +Source0: http://mysql.mainseek.com/Downloads/MySQL-4.0/mysql-%{version}.tar.gz +# Source0-md5: 408d3001ed715ddc90009c247e548638 Source1: %{name}.init Source2: %{name}.sysconfig Source3: %{name}.logrotate @@ -34,11 +38,10 @@ Patch1: %{name}-libwrap.patch Patch2: %{name}-c++.patch Patch3: %{name}-_r-link.patch Patch4: %{name}-info.patch -Patch5: %{name}-dump_quote_db_names.patch -Patch7: %{name}-sql-cxx-pic.patch -Patch8: %{name}-noproc.patch -Patch9: %{name}-fix_privilege_tables.patch -Patch10: %{name}-nptl.patch +Patch5: %{name}-sql-cxx-pic.patch +Patch6: %{name}-noproc.patch +Patch7: %{name}-fix_privilege_tables.patch +Patch8: %{name}-nptl.patch Icon: mysql.gif URL: http://www.mysql.com/ #BuildRequires: ORBit-devel @@ -48,13 +51,14 @@ BuildRequires: automake %{?with_bdb:BuildRequires: db3-devel} BuildRequires: libstdc++-devel >= 5:3.0 BuildRequires: libtool -BuildRequires: libwrap-devel +%{?with_tcpd:BuildRequires: libwrap-devel} BuildRequires: ncurses-devel >= 4.2 -BuildRequires: openssl-devel >= 0.9.7d +%{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d} BuildRequires: perl-DBI BuildRequires: perl-devel >= 1:5.6.1 BuildRequires: readline-devel >= 4.2 BuildRequires: rpm-perlprov >= 4.1-13 +BuildRequires: rpmbuild(macros) >= 1.159 BuildRequires: texinfo BuildRequires: zlib-devel PreReq: rc-scripts >= 0.2.0 @@ -68,10 +72,12 @@ Requires(post,preun): /sbin/chkconfig Requires: %{name}-libs = %{version}-%{release} Requires: /usr/bin/setsid Provides: MySQL-server +Provides: group(mysql) Provides: msqlormysql -BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) +Provides: user(mysql) Obsoletes: MySQL Obsoletes: mysql-server +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _libexecdir %{_sbindir} %define _localstatedir /var/lib/mysql @@ -246,7 +252,7 @@ Summary(ru): MySQL - Summary(uk): MySQL - ÈÅÄÅÒÉ ÔÁ ¦Â̦ÏÔÅËÉ ÐÒÏÇÒÁͦÓÔÁ Group: Development/Libraries Requires: %{name}-libs = %{version}-%{release} -Requires: openssl-devel +%{?with_ssl:Requires: openssl-devel} Requires: zlib-devel Obsoletes: MySQL-devel Obsoletes: libmysql10-devel @@ -345,25 +351,23 @@ Podr %patch2 -p1 %patch3 -p1 %patch4 -p1 -#%patch5 -p1 %ifarch alpha # this is strange: mysqld functions for UDF modules are not explicitly defined, # so -rdynamic is used; in such case gcc3+ld on alpha doesn't like C++ vtables # in objects compiled without -fPIC -%patch7 -p1 +%patch5 -p1 %endif +%patch6 -p1 +%patch7 -p1 %patch8 -p1 -%patch9 -p1 -%patch10 -p1 - -%{__perl} -pi -e 's@/lib/libpthread@/%{_lib}/libpthread@' configure.in %build %{__libtoolize} %{__aclocal} %{__automake} %{__autoconf} -CXXFLAGS="%{rpmcflags} -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}" +# The compiler flags are as per their "official" spec ;) +CXXFLAGS="%{rpmcflags} -felide-constructors -fno-rtti -fno-exceptions %{!?debug:-fomit-frame-pointer}" CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}" %configure \ PS='/bin/ps' \ @@ -375,18 +379,20 @@ CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}" --enable-shared \ --enable-static \ --enable-thread-safe-client \ - %{?with_bdb:--with-berkeley-db} \ + --with%{!?with_bdb:out}-berkeley-db \ + --with%{!?with_innodb:out}-innodb \ + --with%{!?with_isam:out}-isam \ + --with%{!?with_raid:out}-raid \ + --with%{!?with_ssl:out}-openssl \ + --with%{!?with_tcpd:out}-libwrap \ --with-comment="PLD Linux Distribution MySQL RPM" \ --with%{!?debug:out}-debug \ --with-embedded-server \ --with-extra-charsets=all \ - --with-libwrap \ --with-low-memory \ --with-mysqld-user=mysql \ --with-named-curses-libs="-lncurses" \ - --with-openssl \ --with-pthread \ - --with-raid \ --with-unix-socket-path=/var/lib/mysql/mysql.sock \ --with-vio \ --without-readline \ @@ -400,6 +406,8 @@ CFLAGS="%{rpmcflags} %{!?debug:-fomit-frame-pointer}" echo -e "all:\ninstall:\nclean:\nlink_sources:\n" > libmysqld/examples/Makefile %{__make} benchdir=$RPM_BUILD_ROOT%{_datadir}/sql-bench +# workaround for missing files +(cd Docs; touch Images/cluster-components-1.txt Images/multi-comp-1.txt errmsg-table.texi cl-errmsg-table.texi) %{__make} -C Docs mysql.info %install @@ -426,10 +434,25 @@ install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mysql install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/mysql # This is template for configuration file which is created after 'service mysql init' install %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf +install %{SOURCE4} mysqld.conf install %{SOURCE5} $RPM_BUILD_ROOT/etc/mysql/clusters.conf install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit touch $RPM_BUILD_ROOT/var/log/mysql/{err,log,update,isamlog.log} +# remove innodb directives from mysqld.conf if mysqld is configured without +%if !%{with innodb} + cp mysqld.conf mysqld.tmp + awk 'BEGIN { RS="\n\n" } !/innodb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf +%endif + +# remove berkeley-db directives from mysqld.conf if mysqld is configured without +%if !%{with bdb} + cp mysqld.conf mysqld.tmp + awk 'BEGIN { RS="\n\n" } !/bdb/ { printf("%s\n\n", $0) }' < mysqld.tmp > mysqld.conf +%endif + +install mysqld.conf $RPM_BUILD_ROOT%{_datadir}/mysql/mysqld.conf + # remove mysqld's *.po files find . $RPM_BUILD_ROOT%{_datadir}/%{name} -name \*.txt | xargs -n 100 rm -f mv -f $RPM_BUILD_ROOT%{_libdir}/mysql/lib* $RPM_BUILD_ROOT%{_libdir} @@ -441,21 +464,21 @@ rm -rf $RPM_BUILD_ROOT%{_prefix}/mysql-test rm -rf $RPM_BUILD_ROOT %pre -if [ -n "`getgid mysql`" ]; then - if [ "`getgid mysql`" != "89" ]; then +if [ -n "`/usr/bin/getgid mysql`" ]; then + if [ "`/usr/bin/getgid mysql`" != "89" ]; then echo "Error: group mysql doesn't have gid=89. Correct this before installing mysql." 1>&2 exit 1 fi else - /usr/sbin/groupadd -g 89 -r -f mysql + /usr/sbin/groupadd -g 89 mysql fi -if [ -n "`id -u mysql 2>/dev/null`" ]; then - if [ "`id -u mysql`" != "89" ]; then +if [ -n "`/bin/id -u mysql 2>/dev/null`" ]; then + if [ "`/bin/id -u mysql`" != "89" ]; then echo "Error: user mysql doesn't have uid=89. Correct this before installing mysql." 1>&2 exit 1 fi else - /usr/sbin/useradd -M -o -r -u 89 \ + /usr/sbin/useradd -u 89 \ -d %{_mysqlhome} -s /bin/sh -g mysql \ -c "MySQL Server" mysql 1>&2 fi @@ -480,8 +503,8 @@ fi %postun [ ! -x /usr/sbin/fix-info-dir ] || /usr/sbin/fix-info-dir -c %{_infodir} >/dev/null 2>&1 if [ "$1" = "0" ]; then - /usr/sbin/userdel mysql - /usr/sbin/groupdel mysql + %userremove mysql + %groupremove mysql fi %post libs -p /sbin/ldconfig @@ -598,6 +621,7 @@ fi %files libs %defattr(644,root,root,755) +%doc EXCEPTIONS-CLIENT %attr(755,root,root) %{_libdir}/lib*.so.*.* %files devel -- 2.44.0