Sat Feb 7 19:49:37 2009 UTC ()
Pullup ticket #2685 - requested by he
mysql5-server: bug fixes

Revisions pulled up:
- databases/mysql5-server/Makefile		1.26
- databases/mysql5-server/files/mysqld.sh	1.3
---
Module Name:	pkgsrc
Committed By:	he
Date:		Wed Feb  4 21:17:45 UTC 2009

Modified Files:
	pkgsrc/databases/mysql5-server: Makefile
	pkgsrc/databases/mysql5-server/files: mysqld.sh

Log Message:
Upgrade from version 5.0.67 to 5.0.67nb1.

Two changes to the rc.d script:
 1) Move the setting of pidfile to a place so that setting mysqld_datadir
    in rc.conf will actually work; otherwise, if you use a non-default
    mysqld_datadir, mysqld will not start.
 2) ad@ pointed me to http://bugs.mysql.com/bug.php?id=18526, and said
    that --skip-thread-priority should not be used on NetBSD, and the
    PR spoke about Darwin / OS/X.  I'm guessing that this might work
    if the host platform is Linux or SunOS (the latter is unconfirmed).
    So add that option to the startup in all other cases.


(tron)
diff -r1.25 -r1.25.4.1 pkgsrc/databases/mysql5-server/Makefile
diff -r1.2 -r1.2.18.1 pkgsrc/databases/mysql5-server/files/mysqld.sh

cvs diff -r1.25 -r1.25.4.1 pkgsrc/databases/mysql5-server/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/databases/mysql5-server/Attic/Makefile 2008/09/18 11:51:37 1.25
+++ pkgsrc/databases/mysql5-server/Attic/Makefile 2009/02/07 19:49:37 1.25.4.1
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.25 2008/09/18 11:51:37 taca Exp $ 1# $NetBSD: Makefile,v 1.25.4.1 2009/02/07 19:49:37 tron Exp $
2 2
3PKGNAME= ${DISTNAME:S/-/-server-/} 3PKGNAME= ${DISTNAME:S/-/-server-/}
4#PKGREVISION= 1 4PKGREVISION= 1
5SVR4_PKGNAME= mysqs 5SVR4_PKGNAME= mysqs
6COMMENT= MySQL 5, a free SQL database (server) 6COMMENT= MySQL 5, a free SQL database (server)
7 7
8CONFLICTS= {mysql-server-[0-9]*,mysql3-server-[0-9]*} 8CONFLICTS= {mysql-server-[0-9]*,mysql3-server-[0-9]*}
9 9
10PKG_DESTDIR_SUPPORT= user-destdir 10PKG_DESTDIR_SUPPORT= user-destdir
11 11
12.include "../../databases/mysql5-client/Makefile.common" 12.include "../../databases/mysql5-client/Makefile.common"
13 13
14MAKE_JOBS_SAFE= no 14MAKE_JOBS_SAFE= no
15 15
16CONFIGURE_ARGS+= --with-libwrap 16CONFIGURE_ARGS+= --with-libwrap
17CONFIGURE_ARGS+= --with-raid 17CONFIGURE_ARGS+= --with-raid

cvs diff -r1.2 -r1.2.18.1 pkgsrc/databases/mysql5-server/files/Attic/mysqld.sh (expand / switch to unified diff)

--- pkgsrc/databases/mysql5-server/files/Attic/mysqld.sh 2007/06/13 13:24:07 1.2
+++ pkgsrc/databases/mysql5-server/files/Attic/mysqld.sh 2009/02/07 19:49:37 1.2.18.1
@@ -1,49 +1,55 @@ @@ -1,49 +1,55 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: mysqld.sh,v 1.2 2007/06/13 13:24:07 xtraeme Exp $ 3# $NetBSD: mysqld.sh,v 1.2.18.1 2009/02/07 19:49:37 tron Exp $
4# 4#
5# PROVIDE: mysqld 5# PROVIDE: mysqld
6# REQUIRE: DAEMON LOGIN mountall 6# REQUIRE: DAEMON LOGIN mountall
7# KEYWORD: shutdown 7# KEYWORD: shutdown
8# 8#
9# You will need to set some variables in /etc/rc.conf to start MySQL: 9# You will need to set some variables in /etc/rc.conf to start MySQL:
10# 10#
11# mysqld=YES 11# mysqld=YES
12# 12#
13# The following variables are optional: 13# The following variables are optional:
14# 14#
15# mysqld_user="mysql" # user to run mysqld as 15# mysqld_user="mysql" # user to run mysqld as
16# mysqld_datadir="/path/to/home" # path to MySQL database directory 16# mysqld_datadir="/path/to/home" # path to MySQL database directory
17# 17#
18 18
19if [ -f /etc/rc.subr ]; then 19if [ -f /etc/rc.subr ]; then
20 . /etc/rc.subr 20 . /etc/rc.subr
21fi 21fi
22 22
23name="mysqld" 23name="mysqld"
24rcvar=${name} 24rcvar=${name}
25command="@PREFIX@/bin/mysqld_safe" 25command="@PREFIX@/bin/mysqld_safe"
26procname="@PREFIX@/libexec/${name}" 26procname="@PREFIX@/libexec/${name}"
27: ${mysqld_user:=@MYSQL_USER@} 27: ${mysqld_user:=@MYSQL_USER@}
28: ${mysqld_group:=@MYSQL_GROUP@} 28: ${mysqld_group:=@MYSQL_GROUP@}
29: ${mysqld_datadir:=@MYSQL_DATADIR@} 29: ${mysqld_datadir:=@MYSQL_DATADIR@}
30pidfile="${mysqld_datadir}/`@HOSTNAME_CMD@`.pid" 
31 30
32extra_commands="initdb" 31extra_commands="initdb"
33initdb_cmd="mysqld_initdb" 32initdb_cmd="mysqld_initdb"
34start_precmd="mysqld_precmd" 33start_precmd="mysqld_precmd"
35start_cmd="mysqld_start" 34start_cmd="mysqld_start"
36 35
 36# Don't drop thread priority unless on Linux or SunOS
 37# ref. http://bugs.mysql.com/bug.php?id=18526
 38case $(uname -s) in
 39 Linux|SunOS) thread_flags="";;
 40 *) thread_flags="--skip-thread-priority"
 41esac
 42
37mysqld_precmd() 43mysqld_precmd()
38{ 44{
39 if [ ! -d ${mysqld_datadir}/mysql ]; then 45 if [ ! -d ${mysqld_datadir}/mysql ]; then
40 mysqld_initdb 46 mysqld_initdb
41 fi 47 fi
42} 48}
43 49
44mysqld_initdb() 50mysqld_initdb()
45{ 51{
46 initdb="@PREFIX@/bin/mysql_install_db" 52 initdb="@PREFIX@/bin/mysql_install_db"
47 if [ ! -x ${initdb} ]; then 53 if [ ! -x ${initdb} ]; then
48 return 1 54 return 1
49 fi 55 fi
@@ -65,36 +71,39 @@ mysqld_start() @@ -65,36 +71,39 @@ mysqld_start()
65{ 71{
66 for f in $required_files; do 72 for f in $required_files; do
67 if [ ! -r "$f" ]; then 73 if [ ! -r "$f" ]; then
68 @ECHO@ 1>&2 "$0: WARNING: $f is not readable" 74 @ECHO@ 1>&2 "$0: WARNING: $f is not readable"
69 if [ -z $rc_force ]; then 75 if [ -z $rc_force ]; then
70 return 1 76 return 1
71 fi 77 fi
72 fi 78 fi
73 done 79 done
74 @ECHO@ "Starting ${name}." 80 @ECHO@ "Starting ${name}."
75 ulimit -n 4096 81 ulimit -n 4096
76 cd @PREFIX@ 82 cd @PREFIX@
77 ${command} --user=${mysqld_user} --datadir=${mysqld_datadir} \ 83 ${command} --user=${mysqld_user} --datadir=${mysqld_datadir} \
78 --pid-file=${pidfile} ${mysqld_flags} & 84 --pid-file=${pidfile} ${mysqld_flags} \
 85 ${thread_flags} &
79} 86}
80 87
81if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then 88if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
82 load_rc_config $name 89 load_rc_config $name
 90 pidfile="${mysqld_datadir}/`@HOSTNAME_CMD@`.pid"
83 run_rc_command "$1" 91 run_rc_command "$1"
84else 92else
85 if [ -f /etc/rc.conf ]; then 93 if [ -f /etc/rc.conf ]; then
86 . /etc/rc.conf 94 . /etc/rc.conf
87 fi 95 fi
 96 pidfile="${mysqld_datadir}/`@HOSTNAME_CMD@`.pid"
88 case "$1" in 97 case "$1" in
89 initdb) 98 initdb)
90 eval ${initdb_cmd} 99 eval ${initdb_cmd}
91 ;; 100 ;;
92 stop) 101 stop)
93 if [ -r "${pidfile}" ]; then 102 if [ -r "${pidfile}" ]; then
94 @ECHO@ "Stopping ${name}." 103 @ECHO@ "Stopping ${name}."
95 kill `@CAT@ ${pidfile}` 104 kill `@CAT@ ${pidfile}`
96 fi 105 fi
97 ;; 106 ;;
98 *) 107 *)
99 eval ${start_precmd} 108 eval ${start_precmd}
100 eval ${start_cmd} 109 eval ${start_cmd}