Skip to content

Commit 188456b

Browse files
committed
Default file name changed to "/etc/default/mysql" ; The MYCHECK_RCPT variable can now be set from the default file ; The check_for_crashed_tables() function on the debian-start script has been fixed and now also checks Aria tables
1 parent db4a914 commit 188456b

File tree

4 files changed

+16
-7
lines changed

4 files changed

+16
-7
lines changed

debian/additions/debian-start

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
1313
MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
1414
MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
1515
MYCHECK_PARAMS="--all-databases --fast --silent"
16-
MYCHECK_RCPT="root"
16+
MYCHECK_RCPT="${MYCHECK_RCPT:-root}"
1717

18-
## Checking for corrupt, not cleanly closed and upgrade needing tables.
18+
## Checking for corrupt, not cleanly closed (only for MyISAM and Aria engines) and upgrade needing tables.
1919

2020
# The following commands should be run when the server is up but in background
2121
# where they do not block the server start and in one shell instance so that

debian/additions/debian-start.inc.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# This file is included by /etc/mysql/debian-start
44
#
55

6-
## Check all unclosed tables.
6+
## Check MyISAM and Aria unclosed tables.
77
# - Requires the server to be up.
88
# - Is supposed to run silently in background.
99
function check_for_crashed_tables() {
1010
set -e
1111
set -u
1212

1313
# But do it in the background to not stall the boot process.
14-
logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables"
14+
logger -p daemon.info -i -t$0 "Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables"
1515

1616
# Checking for $? is unreliable so the size of the output is checked.
1717
# Some table handlers like HEAP do not support CHECK TABLE.
@@ -21,10 +21,10 @@ function check_for_crashed_tables() {
2121
LC_ALL=C $MYSQL --skip-column-names --batch -e '
2222
select concat('\''select count(*) into @discard from `'\'',
2323
TABLE_SCHEMA, '\''`.`'\'', TABLE_NAME, '\''`'\'')
24-
from information_schema.TABLES where ENGINE='\''MyISAM'\' | \
24+
from information_schema.TABLES where TABLE_SCHEMA<>'\''INFORMATION_SCHEMA'\'' and TABLE_SCHEMA<>'\''PERFORMANCE_SCHEMA'\'' and ( ENGINE='\''MyISAM'\'' or ENGINE='\''Aria'\'' )' | \
2525
xargs -i $MYSQL --skip-column-names --silent --batch \
26-
--force -e "{}" >$tempfile
27-
if [ -s $tempfile ]; then
26+
--force -e "{}" &>$tempfile
27+
if [ -s "$tempfile" ]; then
2828
(
2929
/bin/echo -e "\n" \
3030
"Improperly closed tables are also reported if clients are accessing\n" \

debian/changelog

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ mariadb-10.0 (10.0.20-3) unstable; urgency=medium
3131
[ Jean Weisbuch ]
3232
* Added a Debian default file for the mariadb-server-10.0 package which allows
3333
one to set the MYSQLD_STARTUP_TIMEOUT variable used in the init script
34+
* The MYCHECK_RCPT variable can now be set from the default file.
35+
* The check_for_crashed_tables() function on the debian-start script has been
36+
fixed to be able to log (and email) the errors it encountered : Errors are
37+
sent to stderr by the CLI while only stdout was captured by the function.
38+
* The same function now also checks Aria tables along with MyISAM ones.
3439

3540
-- Otto Kekäläinen <[email protected]> Fri, 24 Jul 2015 23:00:00 +0300
3641

debian/mariadb-server-10.0.default debian/mariadb-server-10.0.mysql.default

+4
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
# If the server is still not responding after the delay, the script won't be executed and an error will be thrown on the syslog.
33
# Default: 30
44
#MYSQLD_STARTUP_TIMEOUT=30
5+
6+
# The email recipient(s) of the output of the check for crashed and improperly closed MyISAM and Aria tables done at each server start by the "/etc/mysql/debian-start" script.
7+
# Default: root
8+
#MYCHECK_RCPT="root"

0 commit comments

Comments
 (0)