pkgsrc/databases/mysql5-server/patches/patch-aj
xtraeme 32384a6653 Initial import of mysql5-server-5.0.15.
MySQL is a SQL (Structured Query Language) database server.  SQL is the
most popular database language in the world.  MySQL is a client-server
implementation that consists of a server daemon `mysqld' and many
different client programs/libraries.

The main goals of MySQL are speed and robustness.

The base upon which MySQL is built is a set of routines that have been
used in a highly demanding production environment for many years.  While
MySQL is still in development it already offers a rich and highly useful
function set.

The official way to pronounce 'MySQL' is 'My Ess Que Ell' (Not MY-SEQUEL).

This package contains the MySQL server programs and libraries.
2005-10-31 09:22:26 +00:00

103 lines
3.1 KiB
Text

$NetBSD: patch-aj,v 1.1.1.1 2005/10/31 09:22:26 xtraeme Exp $
--- scripts/mysqld_safe.sh.orig 2005-01-17 15:16:35.000000000 +0100
+++ scripts/mysqld_safe.sh 2005-01-17 15:20:03.000000000 +0100
@@ -253,6 +253,14 @@
fi
fi
+datemsg()
+{
+ echo -n $(date +'%y%M%d %H:%M:%S')" "
+ echo "$*"
+}
+
+exec >>$err_log 2>&1
+
#
# If there exists an old pid file, check if the daemon is already running
# Note: The switches to 'ps' may depend on your operating system
@@ -263,18 +271,16 @@
then
if @FIND_PROC@
then # The pid contains a mysqld process
- echo "A mysqld process already exists"
- echo "A mysqld process already exists at " `date` >> $err_log
+ datemsg "A mysqld process already exists"
exit 1
fi
fi
rm -f $pid_file
if test -f $pid_file
then
- echo "Fatal error: Can't remove the pid file: $pid_file"
- echo "Fatal error: Can't remove the pid file: $pid_file at " `date` >> $err_log
- echo "Please remove it manually and start $0 again"
- echo "mysqld daemon not started"
+ datemsg "Fatal error: Can't remove the pid file: $pid_file"
+ datemsg "Please remove it manually and start $0 again"
+ datemsg "mysqld daemon not started"
exit 1
fi
fi
@@ -287,11 +293,11 @@
# Alternatively, you can start mysqld with the "myisam-recover" option. See
# the manual for details.
#
-# echo "Checking tables in $DATADIR"
+# datemsg "Checking tables in $DATADIR"
# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI
# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM
-echo "Starting $MYSQLD daemon with databases from $DATADIR"
+datemsg "Starting $MYSQLD daemon with databases from $DATADIR"
# Does this work on all systems?
#if type ulimit | grep "shell builtin" > /dev/null
@@ -299,7 +305,7 @@
# ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems
#fi
-echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log
+datemsg "mysqld started"
while true
do
rm -f $safe_mysql_unix_port $pid_file # Some extra safety
@@ -311,7 +317,7 @@
fi
if test ! -f $pid_file # This is removed if normal shutdown
then
- echo "STOPPING server from pid file $pid_file"
+ datemsg "STOPPING server from pid file $pid_file"
break
fi
@@ -324,7 +330,7 @@
# kill -9 is used or the process won't react on the kill.
numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"`
- echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log
+ datemsg -e "\nNumber of processes running now: $numofproces"
I=1
while test "$I" -le "$numofproces"
do
@@ -337,16 +343,14 @@
# echo "TEST $I - $T **"
if kill -9 $T
then
- echo "$MYSQLD process hanging, pid $T - killed" | tee -a $err_log
+ datemsg "$MYSQLD process hanging, pid $T - killed"
else
break
fi
I=`expr $I + 1`
done
fi
- echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log
+ datemsg "mysqld restarted"
done
-echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log
-echo "" | tee -a $err_log
-
+datemsg "mysqld ended"