Skip to content

Commit

Permalink
debian install/upgrade fixes
Browse files Browse the repository at this point in the history
1. don't run full mysql_upgrade on every server restart,
   use --version-check to do it only once

2. fix syslog tag name in the postinst script, don't pretend
   mysqld_safe generated all these messages. Auto-detect the version
   to simplify maintenance
  • Loading branch information
vuvova committed Dec 12, 2018
1 parent f77f8f6 commit 5415002
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion debian/additions/debian-start
Expand Up @@ -9,7 +9,7 @@ source /usr/share/mysql/debian-start.inc.sh

MYSQL="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf"
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf"
MYUPGRADE="/usr/bin/mysql_upgrade --defaults-extra-file=/etc/mysql/debian.cnf --version-check"
MYCHECK="/usr/bin/mysqlcheck --defaults-file=/etc/mysql/debian.cnf"
MYCHECK_SUBJECT="WARNING: mysqlcheck has found corrupt tables"
MYCHECK_PARAMS="--all-databases --fast --silent"
Expand Down
7 changes: 5 additions & 2 deletions debian/mariadb-server-10.1.postinst
Expand Up @@ -2,13 +2,16 @@

. /usr/share/debconf/confmodule

# assume the filename is /path/to/mariadb-server-##.#.postinst
VER=${0: -13:4}

if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi
${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 }

export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin

# This command can be used as pipe to syslog. With "-s" it also logs to stderr.
ERR_LOGGER="logger -p daemon.err -t mysqld_safe -i"
ERR_LOGGER="logger -p daemon.err -t mariadb-server-$VER.postinst -i"
# This will make an error in a logged command immediately apparent by aborting
# the install, rather than failing silently and leaving a broken install.
set -o pipefail
Expand Down Expand Up @@ -131,7 +134,7 @@ EOF
db_set mysql-server/postrm_remove_database false || true

# To avoid downgrades.
touch $mysql_statedir/debian-10.1.flag
touch $mysql_statedir/debian-$VER.flag

## On every reconfiguration the maintenance user is recreated.
#
Expand Down

0 comments on commit 5415002

Please sign in to comment.