1#!/bin/bash
2#
3# This script is executed by "/etc/init.d/mysql" on every (re)start.
4#
5# Changes to this file will be preserved when updating the Debian package.
6#
7
8source /usr/share/mysql/debian-start.inc.sh
9
10MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
11MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
12MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
13MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
14MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
15MYCHECK_PARAMS="--all-databases --fast --silent"
16MYCHECK_RCPT="root"
17
18# The following commands should be run when the server is up but in background
19# where they do not block the server start and in one shell instance so that
20# they run sequentially. They are supposed not to echo anything to stdout.
21# If you want to disable the check for crashed tables comment
22# "check_for_crashed_tables" out.
23# (There may be no output to stdout inside the background process!)
24echo "Checking for corrupt, not cleanly closed and upgrade needing tables."
25(
26  upgrade_system_tables_if_necessary;
27  check_root_accounts;
28  check_for_crashed_tables;
29) >&2 &
30
31exit 0
32