mariadb/support-files/mysql.server-sys5.sh
unknown bee9933ab8 Small bug fixes
support-files/mysql.server-sys5.sh:
  Change mode to -rw-rw-r--
Docs/manual.texi:
  Added information about BeOS, Access 2000, AIX and user links
client/mysql.cc:
  Fixed SOURCE to work on windows
client/mysqldump.c:
  Strip of white space
configure.in:
  Fix for AIX
include/dbug.h:
  Assert handling
include/my_pthread.h:
  Ia64 needs more thread stack than other processors
include/my_sys.h:
  More comments
myisam/mi_key.c:
  Fixed wrong key length checks
mysql.proj:
  update
mysys/charset.c:
  Cleanup
mysys/mf_keycache.c:
  Moved SEC_LINK to file that used it
mysys/my_static.h:
  Moved SEC_LINK to file that used it
scripts/Makefile.am:
  Fix for debian
scripts/mysql_install_db.sh:
  Cleanup
sql/gen_lex_hash.cc:
  Better values
sql/ha_berkeley.cc:
  Fix of reading of unique key
sql/handler.cc:
  Fix memory allocation bug
sql/mysqld.cc:
  Fix for Ia64
sql/share/charsets/latin1.conf:
  Fixed sortorder back to scandinavian.
sql/sql_yacc.yy:
  FULL shouldn't be a keyword
support-files/Makefile.am:
  Fix for debian
support-files/mysql.server.sh:
  Cleanups
2000-09-07 04:55:17 +03:00

86 lines
1.8 KiB
Bash

#!/bin/sh
#
# This is an example SysV-init-script by Winfried Truemper that you can use
# and modify to your liking
#
PATH="$PATH:@prefix@"
export PATH
MY_CFG="@prefix@/mysql.cfg"
read_mysql_config() {
# this routine requires a sed, which reads even the last line of input
MY_CONFIG_FILE="$1" # file to read setting from
MY_CONFIG_SECTION="$2" # section inside the file
MY_CONFIG_TAG="$3" # name of the setting inside the section
TAB=`printf "\t" ""` # makes the code cut&paste safe
sed -n -f - "$MY_CONFIG_FILE" <<EOF
1,/^\[$MY_CONFIG_SECTION\]/ d
/^\[[a-z]/ q
/^$MY_CONFIG_TAG/ {
s/^$MY_CONFIG_TAG[ $TAB]*=[ $TAB]*\([^ $TAB]*\)/\1/
p
q
}
EOF
}
do_start() {
nohup ./bin/mysqld --defaults-file="$MY_CFG" &
}
do_stop() {
./bin/mysqladmin --defaults-file="$MY_CFG" shutdown
}
do_kill_all() {
PIDS=`ps -efo pid,args | grep mysql | sed -e "s, *.*,," | sort | uniq`
kill $PIDS
sleep 5
kill -9 $PIDS
}
do_kill() {
MY_PIDFILE=`read_mysql_config "$MY_CFG" "mysqld" "pidfile" `
read MY_PID < "$MY_PIDFILE"
kill "$MY_PID"
sleep 2
kill -KILL "$MY_PID"
}
# z.B. mysql.sh admin "ping"
do_admin() {
shift
./bin/mysqladmin --defaults-file="$MY_CFG" $@
exit
}
do_repair() {
MY_DATADIR=`read_mysql_config "$MY_CFG" "mysqld" "datadir" `
./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$1"
shift
}
do_repair_all() {
MY_DATADIR=`read_mysql_config "$MY_CFG" "mysqld" "datadir" `
for i in `find "$MY_DATADIR" -name "*.ISM"`
do
./bin/isamchk --defaults-file="$MY_CFG" --repair "$MY_DATADIR/$i"
done
}
MY_BASEDIR=`read_mysql_config "$MY_CFG" "mysqld" "basedir"`
cd "$MY_BASEDIR" || exit 1
while test $# -gt 0
do
MY_ARG="$1"
do_$MY_ARG $@
shift
done