diff options
Diffstat (limited to 'databases/mysql50-server/files')
8 files changed, 70 insertions, 172 deletions
diff --git a/databases/mysql50-server/files/mysql-server.sh b/databases/mysql50-server/files/mysql-server.sh index 5180b9c0c1eb..708ad57df4b3 100644 --- a/databases/mysql50-server/files/mysql-server.sh +++ b/databases/mysql50-server/files/mysql-server.sh @@ -1,27 +1,51 @@ #!/bin/sh +# +# $FreeBSD$ +# -DB_DIR=%%DB_DIR%% -PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid - -case "$1" in - start) - if [ -x %%PREFIX%%/bin/mysqld_safe ]; then - /usr/bin/limits -U mysql \ - %%PREFIX%%/bin/mysqld_safe --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null & - echo -n ' mysqld' - fi - ;; - stop) - if [ -f ${PIDFILE} ]; then - /bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -n ' mysqld' - else - echo "mysql-server isn't running" - fi - ;; - *) - echo "" - echo "Usage: `basename $0` { start | stop }" - echo "" - exit 64 - ;; -esac +# PROVIDE: mysql +# REQUIRE: NETWORKING SERVERS +# BEFORE: DAEMON +# KEYWORD: shutdown + +# +# Add the following line to /etc/rc.conf to enable mysql: +# mysql_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable MySQL. +# mysqllimits_enable (bool): Set to "NO" by default. +# Set it to yes to run `limits $limits_args` +# just before mysql starts. +# mysqllimits_args (str): Default to "-e -U mysql" +# Arguments of pre-start limits run. +# + +. %%RC_SUBR%% + +name="mysql" +rcvar=`set_rcvar` +mysql_dbdir="%%DB_DIR%%" +mysql_user="mysql" +pidfile="${mysql_dbdir}/`/bin/hostname`.pid" +command="%%PREFIX%%/bin/mysqld_safe" +command_args="--user=${mysql_user} --datadir=${mysql_dbdir} --pid-file=${pidfile} > /dev/null &" +procname="%%PREFIX%%/libexec/mysqld" +start_precmd="${name}_prestart" + +[ -z "$mysql_enable" ] && mysql_enable="NO" +[ -z "$mysqllimits_enable" ] && mysqllimits_enable="NO" +[ -z "$mysqllimits_args" ] && mysqllimits_args="-e -U ${mysql_user}" + +mysql_prestart() +{ + if checkyesno mysqllimits_enable; then + eval `/usr/bin/limits ${mysqllimits_args}` 2>/dev/null + else + return 0 + fi +} + +required_dirs="${mysql_dbdir}" +required_files="${mysql_dbdir}/mysql/host.frm ${mysql_dbdir}/mysql/user.frm ${mysql_dbdir}/mysql/db.frm" + +load_rc_config $name +run_rc_command "$1" diff --git a/databases/mysql50-server/files/patch-Makefile.in b/databases/mysql50-server/files/patch-Makefile.in index 94f38623fcf4..356baf88b938 100644 --- a/databases/mysql50-server/files/patch-Makefile.in +++ b/databases/mysql50-server/files/patch-Makefile.in @@ -1,6 +1,6 @@ ---- Makefile.in.orig Mon Dec 1 13:55:28 2003 -+++ Makefile.in Wed Dec 10 00:18:16 2003 -@@ -209,12 +209,7 @@ +--- Makefile.in.orig Tue Jul 27 08:14:34 2004 ++++ Makefile.in Sat Oct 23 10:39:45 2004 +@@ -293,12 +293,7 @@ # These are built from source in the Docs directory EXTRA_DIST = INSTALL-SOURCE README COPYING zlib @@ -8,7 +8,7 @@ - @readline_topdir@ sql-common \ - @thread_dirs@ pstack @sql_client_dirs@ \ - @sql_server_dirs@ scripts man tests SSL\ -- BUILD @netware_dir@ os2 @libmysqld_dirs@ \ +- BUILD netware os2 @libmysqld_dirs@ \ - @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ +SUBDIRS = diff --git a/databases/mysql50-server/files/patch-client::mysql.cc b/databases/mysql50-server/files/patch-client::mysql.cc new file mode 100644 index 000000000000..7e4fdfa6f22d --- /dev/null +++ b/databases/mysql50-server/files/patch-client::mysql.cc @@ -0,0 +1,11 @@ +--- client/mysql.cc.orig Sun Oct 24 15:54:36 2004 ++++ client/mysql.cc Sun Oct 24 15:55:52 2004 +@@ -294,7 +294,7 @@ + HIST_ENTRY is defined for libedit, but not for the real readline + Need to redefine it for real readline to find it + */ +-#if !defined(USE_LIBEDIT_INTERFACE) ++#if !defined(HAVE_HIST_ENTRY) + typedef struct _hist_entry { + const char *line; + const char *data; diff --git a/databases/mysql50-server/files/patch-configure b/databases/mysql50-server/files/patch-configure index 9eed46865e83..fbbdc8efd9d1 100644 --- a/databases/mysql50-server/files/patch-configure +++ b/databases/mysql50-server/files/patch-configure @@ -9,50 +9,6 @@ # Prevent multiple expansion -@@ -9261,43 +9262,8 @@ - echo "$as_me:$LINENO: checking \"how to check if pid exists\"" >&5 - echo $ECHO_N "checking \"how to check if pid exists\"... $ECHO_C" >&6 - PS=$ac_cv_path_PS --# Linux style --if $PS p $$ 2> /dev/null | grep $0 > /dev/null --then -- FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null" --# Solaris --elif $PS -p $$ 2> /dev/null | grep $0 > /dev/null --then -- FIND_PROC="$PS -p \$\$PID | grep mysqld > /dev/null" - # BSD style --elif $PS -uaxww 2> /dev/null | grep $0 > /dev/null --then - FIND_PROC="$PS -uaxww | grep mysqld | grep \" \$\$PID \" > /dev/null" --# SysV style --elif $PS -ef 2> /dev/null | grep $0 > /dev/null --then -- FIND_PROC="$PS -ef | grep mysqld | grep \" \$\$PID \" > /dev/null" --# Do anybody use this? --elif $PS $$ 2> /dev/null | grep $0 > /dev/null --then -- FIND_PROC="$PS \$\$PID | grep mysqld > /dev/null" --else -- case $SYSTEM_TYPE in -- *darwin*) -- FIND_PROC="$PS -uaxww | grep mysqld | grep \" \$\$PID \" > /dev/null" -- ;; -- *cygwin*) -- FIND_PROC="$PS -e | grep mysqld | grep \" \$\$PID \" > /dev/null" -- ;; -- *netware*) -- FIND_PROC= -- ;; -- *) -- { { echo "$as_me:$LINENO: error: Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual." >&5 --echo "$as_me: error: Could not find the right ps switches. Which OS is this ?. See the Installation chapter in the Reference Manual." >&2;} -- { (exit 1); exit 1; }; } -- esac --fi - - echo "$as_me:$LINENO: result: \"$FIND_PROC\"" >&5 - echo "${ECHO_T}\"$FIND_PROC\"" >&6 @@ -12678,8 +12644,8 @@ # Some system specific hacks # @@ -64,12 +20,3 @@ case $SYSTEM_TYPE in *solaris2.7*) -@@ -23893,7 +23859,7 @@ - /* ) rel_srcdir="$srcdir" ;; - * ) rel_srcdir="../$srcdir" ;; - esac -- if test "x$enable_dependency_tracking" == xno -+ if test "x$enable_dependency_tracking" = xno - then - innodb_conf_flags=--disable-dependency-tracking - fi diff --git a/databases/mysql50-server/files/patch-scripts::Makefile.in b/databases/mysql50-server/files/patch-scripts::Makefile.in index 9010d283909f..ffef310f740c 100644 --- a/databases/mysql50-server/files/patch-scripts::Makefile.in +++ b/databases/mysql50-server/files/patch-scripts::Makefile.in @@ -1,6 +1,6 @@ ---- scripts/Makefile.in.orig Tue Mar 2 12:25:53 2004 -+++ scripts/Makefile.in Tue Mar 2 12:26:20 2004 -@@ -203,25 +203,7 @@ +--- scripts/Makefile.in.orig Tue Jul 27 08:14:44 2004 ++++ scripts/Makefile.in Sat Oct 23 10:44:33 2004 +@@ -287,26 +287,7 @@ vio_dir = @vio_dir@ vio_libs = @vio_libs@ @@ -22,12 +22,13 @@ - mysql_tableinfo \ - mysqld_multi \ - make_win_src_distribution \ +- make_win_binary_distribution \ - mysql_create_system_tables +bin_SCRIPTS = EXTRA_SCRIPTS = make_binary_distribution.sh \ -@@ -254,7 +236,7 @@ +@@ -340,7 +321,7 @@ mysqlbug @@ -36,7 +37,7 @@ # mysqlbug should be distributed built so that people can report build # failures with it. -@@ -510,8 +492,6 @@ +@@ -616,8 +597,6 @@ all: fill_help_tables.sql make_win_src_distribution make_binary_distribution make_sharedlib_distribution diff --git a/databases/mysql50-server/files/patch-scripts::mysql_install_db.sh b/databases/mysql50-server/files/patch-scripts::mysql_install_db.sh deleted file mode 100644 index 1ccb78b2925a..000000000000 --- a/databases/mysql50-server/files/patch-scripts::mysql_install_db.sh +++ /dev/null @@ -1,22 +0,0 @@ ---- scripts/mysql_install_db.sh.orig Thu Mar 11 10:20:57 2004 -+++ scripts/mysql_install_db.sh Thu Mar 11 10:27:09 2004 -@@ -118,7 +118,7 @@ - if [ $? -ne 0 ] - then - resolved=`$bindir/resolveip localhost 2>&1` -- if [ $? -eq 0 ] -+ if [ $? -ne 0 ] - then - echo "Neither host '$hostname' and 'localhost' could not be looked up with" - echo "$bindir/resolveip" -@@ -128,8 +128,8 @@ - exit 1 - fi - echo "WARNING: The host '$hostname' could not be looked up with resolveip." -- echo "This probably means that your libc libraries are not 100 % compatible" -- echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" -+ echo "This probably means that your host name is not listed in your" -+ echo "/etc/hosts file (as it should). The MySQL daemon, mysqld, should work" - echo "normally with the exception that host name resolving will not work." - echo "This means that you should use IP addresses instead of hostnames" - echo "when specifying MySQL privileges !" diff --git a/databases/mysql50-server/files/patch-scripts::mysqlbug.sh b/databases/mysql50-server/files/patch-scripts::mysqlbug.sh deleted file mode 100644 index fa26d2206310..000000000000 --- a/databases/mysql50-server/files/patch-scripts::mysqlbug.sh +++ /dev/null @@ -1,14 +0,0 @@ ---- scripts/mysqlbug.sh.orig Tue May 18 10:20:19 2004 -+++ scripts/mysqlbug.sh Fri May 14 02:53:22 2004 -@@ -254,9 +254,9 @@ - if cmp -s $TEMP $TEMP.x - then - echo "File not changed, no bug report submitted." -- cp $TEMP /tmp/failed-mysql-bugreport -+ mv -f $TEMP /tmp/failed-mysql-bugreport - echo "The raw bug report exists in /tmp/failed-mysql-bugreport" -- echo "If you use this remember that the first lines of the report now is a lie.." -+ echo "If you use this remember that the first lines of the report are now a lie.." - exit 1 - fi - diff --git a/databases/mysql50-server/files/patch-scripts::mysqlhotcopy.sh b/databases/mysql50-server/files/patch-scripts::mysqlhotcopy.sh deleted file mode 100644 index 19d4395fa09f..000000000000 --- a/databases/mysql50-server/files/patch-scripts::mysqlhotcopy.sh +++ /dev/null @@ -1,49 +0,0 @@ ---- scripts/mysqlhotcopy.sh.orig Sun Dec 21 19:01:29 2003 -+++ scripts/mysqlhotcopy.sh Thu Sep 23 11:02:45 2004 -@@ -7,6 +7,7 @@ - use File::Path; - use DBI; - use Sys::Hostname; -+use File::Temp; - - =head1 NAME - -@@ -607,7 +608,6 @@ - sub copy_index - { - my ($method, $files, $source, $target) = @_; -- my $tmpfile="$opt_tmpdir/mysqlhotcopy$$"; - - print "Copying indices for ".@$files." files...\n" unless $opt{quiet}; - foreach my $file (@$files) -@@ -633,23 +633,23 @@ - } - close OUTPUT || die "Error on close of $to: $!\n"; - } -- elsif ($opt{method} eq 'scp') -+ elsif ($opt{method} =~ /^scp\b/) - { -- my $tmp=$tmpfile; -- open(OUTPUT,">$tmp") || die "Can\'t create file $tmp: $!\n"; -- if (syswrite(OUTPUT,$buff) != length($buff)) -+ my ($fh, $tmp)=tempfile('mysqlhotcopy-XXXXXX', DIR => $opt_tmpdir); -+ die "Can\'t create/open file in $opt_tmpdir\n"; -+ if (syswrite($fh,$buff) != length($buff)) - { - die "Error when writing data to $tmp: $!\n"; - } -- close OUTPUT || die "Error on close of $tmp: $!\n"; -- safe_system("scp $tmp $to"); -+ close $fh || die "Error on close of $tmp: $!\n"; -+ safe_system("$opt{method} $tmp $to"); -+ unlink $tmp; - } - else - { - die "Can't use unsupported method '$opt{method}'\n"; - } - } -- unlink "$tmpfile" if ($opt{method} eq 'scp'); - } - - |