From 4a6be51f78e79b1ee5bc0442b7af8b3108a64512 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 30 Jan 2014 12:45:38 -0500 Subject: * Merged revisions: 3431, 3435..3457, 3459, 3460 from maria-5.5-galera. * Fixed Debian/Ubuntu dist files. * Fixed some compiler warnings. --- debian/dist/Debian/control | 28 ++- .../mariadb-galera-server-10.0.README.Debian | 109 +++++++++ debian/dist/Debian/mariadb-galera-server-10.0.dirs | 11 + .../Debian/mariadb-galera-server-10.0.files.in | 115 +++++++++ .../Debian/mariadb-galera-server-10.0.postinst | 268 +++++++++++++++++++++ .../dist/Debian/mariadb-galera-server-10.0.postrm | 83 +++++++ .../dist/Debian/mariadb-server-10.0.README.Debian | 109 --------- debian/dist/Debian/mariadb-server-10.0.dirs | 11 - debian/dist/Debian/mariadb-server-10.0.files.in | 81 ------- debian/dist/Debian/mariadb-server-10.0.postinst | 268 --------------------- debian/dist/Debian/mariadb-server-10.0.postrm | 83 ------- debian/dist/Debian/rules | 12 +- 12 files changed, 608 insertions(+), 570 deletions(-) create mode 100644 debian/dist/Debian/mariadb-galera-server-10.0.README.Debian create mode 100644 debian/dist/Debian/mariadb-galera-server-10.0.dirs create mode 100644 debian/dist/Debian/mariadb-galera-server-10.0.files.in create mode 100644 debian/dist/Debian/mariadb-galera-server-10.0.postinst create mode 100644 debian/dist/Debian/mariadb-galera-server-10.0.postrm delete mode 100644 debian/dist/Debian/mariadb-server-10.0.README.Debian delete mode 100644 debian/dist/Debian/mariadb-server-10.0.dirs delete mode 100644 debian/dist/Debian/mariadb-server-10.0.files.in delete mode 100644 debian/dist/Debian/mariadb-server-10.0.postinst delete mode 100644 debian/dist/Debian/mariadb-server-10.0.postrm (limited to 'debian/dist/Debian') diff --git a/debian/dist/Debian/control b/debian/dist/Debian/control index 236e5540c0d..7ac06093410 100644 --- a/debian/dist/Debian/control +++ b/debian/dist/Debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: MariaDB Developers XSBC-Original-Maintainer: Maria Developers Uploaders: MariaDB Developers -Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev +Build-Depends: libtool (>= 1.4.2-7), procps | hurd, debhelper, file (>= 3.28), libncurses5-dev (>= 5.0-6), perl (>= 5.6.0), libwrap0-dev (>= 7.6-8.3), zlib1g-dev (>= 1:1.1.3-5), ${LIBREADLINE_DEV}, libevent-dev, libssl-dev, libpam0g-dev, psmisc, po-debconf, chrpath, automake1.9, doxygen, texlive-latex-base, ghostscript | gs-gpl, dpatch, gawk, bison, lsb-release, hardening-wrapper, ${CMAKE_DEP}libaio-dev Standards-Version: 3.8.3 Homepage: http://mariadb.org/ Vcs-Browser: http://bazaar.launchpad.net/~maria-captains/maria/10.0/files @@ -182,23 +182,27 @@ Description: MariaDB database regression test suite . This package includes the regression test suite. -Package: mariadb-server-10.0 +Package: mariadb-galera-server-10.0 Architecture: any Suggests: tinyca, mailx, mariadb-test Recommends: libhtml-template-perl Pre-Depends: mariadb-common, adduser (>= 3.40), debconf -Depends: mariadb-client-10.0 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-10.0 (>= ${binary:Version}) -Provides: mariadb-server, mysql-server, virtual-mysql-server -Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), +Depends: mariadb-client-10.0 (>= ${source:Version}), libdbi-perl, perl (>= 5.6), ${shlibs:Depends}, ${misc:Depends}, psmisc, passwd, lsb-base (>= 3.0-10), mariadb-server-core-10.0 (>= ${binary:Version}), galera (>=25.2) +Provides: mariadb-server-core, mysql-server-core-5.5, mariadb-galera-server, mysql-server, virtual-mysql-server +Conflicts: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mariadb-galera-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, + mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, + mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5, mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 -Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), +Replaces: mariadb-server (<< ${source:Version}), mysql-server (<< ${source:Version}), mariadb-galera-server (<< ${source:Version}), mysql-server-4.1, mysql-server-5.0, mysql-server-5.1, mysql-server-5.5, mariadb-server-5.1, mariadb-server-5.2, mariadb-server-5.3, libmariadbclient16 (<< 5.3.4), libmariadbclient-dev (<< 5.5.0), + mysql-server-core-5.0, mysql-server-core-5.1, mysql-server-core-5.5, + mariadb-server-core-5.1, mariadb-server-core-5.2, mariadb-server-core-5.5, mariadb-tokudb-engine-5.5, mariadb-tokudb-engine-10.0 -Description: MariaDB database server binaries +Description: MariaDB database server with Galera cluster binaries MariaDB is a fast, stable and true multi-user, multi-threaded SQL database server. SQL (Structured Query Language) is the most popular database query language in the world. The main goals of MariaDB are speed, robustness and @@ -206,14 +210,14 @@ Description: MariaDB database server binaries . This package includes the server binaries. -Package: mariadb-server +Package: mariadb-galera-server Section: database Architecture: all -Depends: mariadb-server-10.0 (= ${source:Version}), ${misc:Depends} -Description: MariaDB database server (metapackage depending on the latest version) +Depends: mariadb-galera-server-10.0 (= ${source:Version}), ${misc:Depends} +Description: MariaDB database server with Galera cluster (metapackage depending on the latest version) This is an empty package that depends on the current "best" version of - mariadb-server (currently mariadb-server-10.0), as determined by the MariaDB - maintainers. Install this package if in doubt about which MariaDB + mariadb-galera-server (currently mariadb-galera-server-10.0), as determined by the MariaDB + maintainers. Install this package if in doubt about which MariaDB-Galera version you need. That will install the version recommended by the package maintainers. . diff --git a/debian/dist/Debian/mariadb-galera-server-10.0.README.Debian b/debian/dist/Debian/mariadb-galera-server-10.0.README.Debian new file mode 100644 index 00000000000..f398f2fa236 --- /dev/null +++ b/debian/dist/Debian/mariadb-galera-server-10.0.README.Debian @@ -0,0 +1,109 @@ +* MYSQL WON'T START OR STOP?: +============================= +You may never ever delete the special mysql user "debian-sys-maint". This +user together with the credentials in /etc/mysql/debian.cnf are used by the +init scripts to stop the server as they would require knowledge of the mysql +root users password else. +So in most of the times you can fix the situation by making sure that the +debian.cnf file contains the right password, e.g. by setting a new one +(remember to do a "flush privileges" then). + +* WHAT TO DO AFTER UPGRADES: +============================ +The privilege tables are automatically updated so all there is left is read +the changelogs on dev.mysql.com to see if any changes affect custom apps. + +* WHAT TO DO AFTER INSTALLATION: +================================ +The MySQL manual describes certain steps to do at this stage in a separate +chapter. They are not necessary as the Debian packages does them +automatically. + +The only thing that is left over for the admin is + - setting the passwords + - creating new users and databases + - read the rest of this text + +* DOWNGRADING TO 4.0 or 4.1: +============================ +Unsupported. Period. +But if you do and get problems or make interesting experiences, mail me, it +might help others. +Ok, if you really want, I would recommend to "mysqldump --opt" all tables, +then purge 4.1, delete /var/lib/mysql, install 4.0 and insert the dumps. Be +carefully, though, with the "mysql" table, you might not simply overwrite that +one as the password for the mysql "debian-sys-maint" user is stored in +/etc/mysql/debian.cnf and needed by /etc/init.d/ to start mysql and check if +it's alive. + +* SOME APPLICATION CAN NO LONGER CONNECT: +========================================= +This application is probably linked against libmysqlclient12 or below and +somebody has created a mysql user with new-style passwords. +The old_passwords=1 option in /etc/mysql/my.cnf might help. If not the +application that inserted the user has to be changed or the application that +tries to connect updated to libmysqlclient14 or -15. + +* NETWORKING: +============= +For security reasons, the Debian package has enabled networking only on the +loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with +"netstat -tlnp" where it is listening. If your connection is aborted +immediately see if "mysqld: all" or similar is in /etc/hosts.allow and read +hosts_access(5). + +* WHERE IS THE DOCUMENTATION?: +============================== +Unfortunately due to licensing restrictions, debian currently not able +to provide the mysql-doc package in any format. For the most up to date +documentation, please go to http://dev.mysql.com/doc. + +* PASSWORDS: +============ +It is strongly recommended to set a password for the mysql root user (which + /usr/bin/mysql -u root -D mysql -e "update user set password=password('new-password') where user='root'" + /usr/bin/mysql -u root -e "flush privileges" +If you already had a password set add "-p" before "-u" to the lines above. + + +If you are tired to type the password in every time or want to automate your +scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600 +(-rw------- username username .my.cnf) to ensure that nobody else can read +it. Every other configuration parameter can be stored there, too. You will +find an example below and more information in the MySQL manual in +/usr/share/doc/mariadb-doc or www.mysql.com. + +ATTENTION: It is necessary, that a .my.cnf from root always contains a "user" +line wherever there is a "password" line, else, the Debian maintenance +scripts, that use /etc/mysql/debian.cnf, will use the username +"debian-sys-maint" but the password that is in root's .my.cnf. Also note, +that every change you make in the /root/.my.cnf will affect the mysql cron +script, too. + + # an example of $HOME/.my.cnf + [client] + user = your-mysql-username + password = enter-your-good-new-password-here + +* BIG_ROWS FOR EVEN MORE ROWS IN A TABLE: +========================================= +If you ever run out of rows in a table there is the possibility of building +the package with "-DBIG_ROWS" which, according to a MySQL employee on +packagers@lists.mysql.com should lead to a 64bit row index (I guess > 2^32 +rows) but also to an approx. 5% performance loss. + +* BerkeleyDB Storage Engine +=========================== +Support for BerkeleyDB has been removed in 5.1, and consequently both the +have-bdb and skip-bdb configuration options will cause the server to fail. +Removing the options from /etc/mysql/my.cnf will fix this problem. + +* FURTHER NOTES ON REPLICATION +=============================== +If the MySQL server is acting as a replication slave, you should not +set --tmpdir to point to a directory on a memory-based filesystem or to +a directory that is cleared when the server host restarts. A replication +slave needs some of its temporary files to survive a machine restart so +that it can replicate temporary tables or LOAD DATA INFILE operations. If +files in the temporary file directory are lost when the server restarts, +replication fails. diff --git a/debian/dist/Debian/mariadb-galera-server-10.0.dirs b/debian/dist/Debian/mariadb-galera-server-10.0.dirs new file mode 100644 index 00000000000..5379d2b713f --- /dev/null +++ b/debian/dist/Debian/mariadb-galera-server-10.0.dirs @@ -0,0 +1,11 @@ +etc/init.d +etc/logrotate.d +etc/mysql/conf.d +usr/bin +usr/sbin +usr/share/man/man8 +usr/share/mysql +usr/share/doc/mariadb-galera-server-10.0 +usr/support-files +var/run/mysqld +var/lib/mysql-upgrade diff --git a/debian/dist/Debian/mariadb-galera-server-10.0.files.in b/debian/dist/Debian/mariadb-galera-server-10.0.files.in new file mode 100644 index 00000000000..28a64355c48 --- /dev/null +++ b/debian/dist/Debian/mariadb-galera-server-10.0.files.in @@ -0,0 +1,115 @@ +usr/lib/mysql/plugin/auth_pam.so +usr/lib/mysql/plugin/auth_socket.so +usr/sbin/mysqld +usr/lib/mysql/plugin/ha_innodb.so +usr/lib/mysql/plugin/ha_oqgraph.so +usr/lib/mysql/plugin/ha_sequence.so +usr/lib/mysql/plugin/ha_xtradb.so +usr/lib/mysql/plugin/handlersocket.so +usr/lib/mysql/plugin/locales.so +usr/lib/mysql/plugin/metadata_lock_info.so +usr/lib/mysql/plugin/query_cache_info.so +usr/lib/mysql/plugin/query_response_time.so +usr/lib/mysql/plugin/semisync_master.so +usr/lib/mysql/plugin/semisync_slave.so +usr/lib/mysql/plugin/sphinx.so +usr/lib/mysql/plugin/sql_errlog.so +usr/lib/libhsclient.so.* +etc/mysql/debian-start +etc/mysql/conf.d/mysqld_safe_syslog.cnf +usr/bin/msql2mysql +usr/bin/my_print_defaults +usr/bin/myisamchk +usr/bin/myisam_ftdump +usr/bin/myisamlog +usr/bin/myisampack +usr/bin/aria_pack +usr/bin/aria_read_log +usr/bin/aria_ftdump +usr/bin/aria_chk +usr/bin/aria_dump_log +usr/bin/mysql_convert_table_format +usr/bin/mysql_install_db +usr/bin/mysql_plugin +usr/bin/mysql_secure_installation +usr/bin/mysql_setpermission +usr/bin/mysql_tzinfo_to_sql +usr/bin/mysql_upgrade +usr/bin/mysql_zap +usr/bin/mysqlbinlog +usr/bin/mysqld_multi +usr/bin/mysqld_safe +usr/bin/mysqlhotcopy +usr/bin/perror +usr/bin/replace +usr/bin/resolve_stack_dump +usr/bin/resolveip +usr/bin/wsrep_sst_common +usr/bin/wsrep_sst_mysqldump +usr/bin/wsrep_sst_rsync +usr/bin/wsrep_sst_xtrabackup +usr/share/doc/mariadb-server-10.0/mysqld.sym.gz +usr/share/doc/mariadb-server-10.0/INFO_SRC +usr/share/doc/mariadb-server-10.0/INFO_BIN +usr/share/doc/mariadb-galera-server-10.0/README-wsrep +usr/share/lintian/overrides/mariadb-server-10.0 +usr/share/man/man1/msql2mysql.1 +usr/share/man/man1/myisamchk.1 +usr/share/man/man1/myisam_ftdump.1 +usr/share/man/man1/myisamlog.1 +usr/share/man/man1/myisampack.1 +usr/share/man/man1/my_print_defaults.1 +usr/share/man/man1/mysqlbinlog.1 +usr/share/man/man1/mysql_convert_table_format.1 +usr/share/man/man1/mysqld_multi.1 +usr/share/man/man1/mysqld_safe.1 +usr/share/man/man1/mysqlhotcopy.1 +usr/share/man/man1/mysql_install_db.1 +usr/share/man/man1/mysql_secure_installation.1 +usr/share/man/man1/mysql_setpermission.1 +usr/share/man/man1/mysql_upgrade.1 +usr/share/man/man1/mysql_zap.1 +usr/share/man/man1/perror.1 +usr/share/man/man1/replace.1 +usr/share/man/man1/resolveip.1 +usr/share/man/man1/resolve_stack_dump.1 +usr/share/man/man1/innochecksum.1 +usr/share/man/man1/mysql_tzinfo_to_sql.1 +usr/share/man/man8/mysqld.8 +usr/share/mysql/charsets +usr/share/mysql/czech +usr/share/mysql/danish +usr/share/mysql/dutch +usr/share/mysql/english +usr/share/mysql/estonian +usr/share/mysql/french +usr/share/mysql/german +usr/share/mysql/greek +usr/share/mysql/hungarian +usr/share/mysql/italian +usr/share/mysql/japanese +usr/share/mysql/korean +usr/share/mysql/norwegian +usr/share/mysql/norwegian-ny +usr/share/mysql/polish +usr/share/mysql/portuguese +usr/share/mysql/romanian +usr/share/mysql/russian +usr/share/mysql/serbian +usr/share/mysql/slovak +usr/share/mysql/spanish +usr/share/mysql/swedish +usr/share/mysql/ukrainian +usr/share/mysql/debian-start.inc.sh +usr/share/mysql/echo_stderr +usr/share/mysql/errmsg-utf8.txt +usr/share/mysql/fill_help_tables.sql +usr/share/mysql/mysql_system_tables_data.sql +usr/share/mysql/mysql_system_tables.sql +usr/share/mysql/mysql_performance_tables.sql +usr/share/mysql/mysql_test_data_timezone.sql +@CASSANDRA_DEB_FILES@ +@SPIDER_DEB_FILES@ +@TOKUDB_DEB_FILES@ +usr/share/mysql/wsrep.cnf +usr/share/mysql/wsrep_notify diff --git a/debian/dist/Debian/mariadb-galera-server-10.0.postinst b/debian/dist/Debian/mariadb-galera-server-10.0.postinst new file mode 100644 index 00000000000..fb1f710eb89 --- /dev/null +++ b/debian/dist/Debian/mariadb-galera-server-10.0.postinst @@ -0,0 +1,268 @@ +#!/bin/bash -e + +. /usr/share/debconf/confmodule + +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" +# 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 + +invoke() { + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d mysql $1 + else + /etc/init.d/mysql $1 + fi +} + +MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --loose-innodb=OFF --default-storage-engine=myisam" + +test_mysql_access() { + mysql --no-defaults -u root -h localhost /dev/null 2>&1 +} + +# call with $1 = "online" to connect to the server, otherwise it bootstraps +set_mysql_rootpw() { + # forget we ever saw the password. don't use reset to keep the seen status + db_set mysql-server/root_password "" + + tfile=`mktemp` + if [ ! -f "$tfile" ]; then + return 1 + fi + + # this avoids us having to call "test" or "[" on $rootpw + cat << EOF > $tfile +USE mysql; +UPDATE user SET password=PASSWORD("$rootpw") WHERE user='root'; +FLUSH PRIVILEGES; +EOF + if grep -q 'PASSWORD("")' $tfile; then + retval=0 + elif [ "$1" = "online" ]; then + mysql --no-defaults -u root -h localhost <$tfile >/dev/null + retval=$? + else + $MYSQL_BOOTSTRAP <$tfile + retval=$? + fi + rm -f $tfile + return $retval +} + +# This is necessary because mysql_install_db removes the pid file in /var/run +# and because changed configuration options should take effect immediately. +# In case the server wasn't running at all it should be ok if the stop +# script fails. I can't tell at this point because of the cleaned /var/run. +set +e; invoke stop; set -e + +case "$1" in + configure) + mysql_datadir=/usr/share/mysql + mysql_statedir=/var/lib/mysql + mysql_rundir=/var/run/mysqld + mysql_logdir=/var/log + mysql_cfgdir=/etc/mysql + mysql_newlogdir=/var/log/mysql + mysql_upgradedir=/var/lib/mysql-upgrade + + # first things first, if the following symlink exists, it is a preserved + # copy the old data dir from a mysql upgrade that would have otherwise + # been replaced by an empty mysql dir. this should restore it. + for dir in DATADIR LOGDIR; do + if [ "$dir" = "DATADIR" ]; then targetdir=$mysql_statedir; else targetdir=$mysql_newlogdir; fi + savelink="$mysql_upgradedir/$dir.link" + if [ -L "$savelink" ]; then + # If the targetdir was a symlink before we upgraded it is supposed + # to be either still be present or not existing anymore now. + if [ -L "$targetdir" ]; then + rm "$savelink" + elif [ ! -d "$targetdir" ]; then + mv "$savelink" "$targetdir" + else + # this should never even happen, but just in case... + mysql_tmp=`mktemp -d -t mysql-symlink-restore-XXXXXX` + echo "this is very strange! see $mysql_tmp/README..." >&2 + mv "$targetdir" "$mysql_tmp" + cat << EOF > "$mysql_tmp/README" + +if you're reading this, it's most likely because you had replaced /var/lib/mysql +with a symlink, then upgraded to a new version of mysql, and then dpkg +removed your symlink (see #182747 and others). the mysql packages noticed +that this happened, and as a workaround have restored it. however, because +/var/lib/mysql seems to have been re-created in the meantime, and because +we don't want to rm -rf something we don't know as much about, we're going +to leave this unexpected directory here. if your database looks normal, +and this is not a symlink to your database, you should be able to blow +this all away. + +EOF + fi + fi + rmdir $mysql_upgradedir 2>/dev/null || true + done + + # Ensure the existence and right permissions for the database and + # log files. + if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi + if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then mkdir "$mysql_statedir/mysql"; fi + if [ ! -d "$mysql_newlogdir" -a ! -L "$mysql_newlogdir" ]; then mkdir "$mysql_newlogdir"; fi + # When creating an ext3 jounal on an already mounted filesystem like e.g. + # /var/lib/mysql, you get a .journal file that is not modifyable by chown. + # The mysql_datadir must not be writable by the mysql user under any + # circumstances as it contains scripts that are executed by root. + set +e + chown -R 0:0 $mysql_datadir + chown -R mysql $mysql_statedir + chown -R mysql $mysql_rundir + chown -R mysql:adm $mysql_newlogdir; chmod 2750 $mysql_newlogdir; + for i in log err; do + touch $mysql_logdir/mysql.$i + chown mysql:adm $mysql_logdir/mysql.$i + chmod 0640 $mysql_logdir/mysql.$i + done + set -e + + # This is important to avoid dataloss when there is a removed + # mysql-server version from Woody lying around which used the same + # data directory and then somewhen gets purged by the admin. + db_set mysql-server/postrm_remove_database false || true + + # To avoid downgrades. + touch $mysql_statedir/debian-10.0.flag + + # initiate databases. Output is not allowed by debconf :-( + # This will fail if we are upgrading an existing database; in this case + # mysql_upgrade, called from the /etc/init.d/mysql start script, will + # handle things. + # Debian: beware of the bashisms... + # Debian: can safely run on upgrades with existing databases + set +e + /bin/bash /usr/bin/mysql_install_db --rpm --user=mysql 2>&1 | $ERR_LOGGER + set -e + + ## On every reconfiguration the maintenance user is recreated. + # + # - It is easier to regenerate the password every time but as people + # use fancy rsync scripts and file alteration monitors, the existing + # password is used and existing files not touched. + # - The mysqld statement is like that in mysql_install_db because the + # server is not already running. This has some implications: + # - The amount of newlines and semicolons in the query is important! + # - GRANT is not possible with --skip-grant-tables and "INSERT + # (user,host..) VALUES" is not --ansi compliant + # - The echo is just for readability. ash's buildin has no "-e" so use /bin/echo. + # - The Super_priv, Show_db_priv, Create_tmp_table_priv and Lock_tables_priv + # may not be present as old Woody 3.23 databases did not have it and the + # admin might not already have run mysql_upgrade which adds them. + # As the binlog cron scripts to need at least the Super_priv, I do first + # the old query which always succeeds and then the new which may or may not. + + # recreate the credentials file if not present or without mysql_upgrade stanza + dc=$mysql_cfgdir/debian.cnf; + if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then + pass="`sed -n 's/^[ ]*password *= *// p' $dc | head -n 1`" + else + pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`; + if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi + cat /dev/null > $dc + echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc + echo "[client]" >>$dc + echo "host = localhost" >>$dc + echo "user = debian-sys-maint" >>$dc + echo "password = $pass" >>$dc + echo "socket = $mysql_rundir/mysqld.sock" >>$dc + echo "[mysql_upgrade]" >>$dc + echo "host = localhost" >>$dc + echo "user = debian-sys-maint" >>$dc + echo "password = $pass" >>$dc + echo "socket = $mysql_rundir/mysqld.sock" >>$dc + echo "basedir = /usr" >>$dc + fi + # If this dir chmod go+w then the admin did it. But this file should not. + chown 0:0 $dc + chmod 0600 $dc + + # update privilege tables + password_column_fix_query=`/bin/echo -e \ + "USE mysql;\n" \ + "ALTER TABLE user CHANGE Password Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL;"` + replace_query=`/bin/echo -e \ + "USE mysql;\n" \ + "SET sql_mode='';\n" \ + "REPLACE INTO user SET " \ + " host='localhost', user='debian-sys-maint', password=password('$pass'), " \ + " Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', " \ + " Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', " \ + " Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', " \ + " Index_priv='Y', Alter_priv='Y', Super_priv='Y', Show_db_priv='Y', "\ + " Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y', "\ + " Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y', "\ + " Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', "\ + " Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y',"\ + " ssl_cipher='', x509_issuer='', x509_subject='';"`; + # Engines supported by etch should be installed per default. The query sequence is supposed + # to be aborted if the CREATE TABLE fails due to an already existent table in which case the + # admin might already have chosen to remove one or more plugins. Newlines are necessary. + install_plugins=`/bin/echo -e \ + "USE mysql;\n" \ + "CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \ + " dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '', " \ + " PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';" ` + + # Upgrade password column format before the root password gets set. + echo "$password_column_fix_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER + + db_get mysql-server/root_password && rootpw="$RET" + if ! set_mysql_rootpw; then + password_error="yes" + fi + + set +e + echo "$replace_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER + echo "$install_plugins" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER + set -e + ;; + + abort-upgrade|abort-remove|abort-configure) + ;; + + *) + echo "postinst called with unknown argument '$1'" 1>&2 + exit 1 + ;; +esac + +# here we check to see if we can connect as root without a password +# this should catch upgrades from previous versions where the root +# password wasn't set. if there is a password, or if the connection +# fails for any other reason, nothing happens. +if [ "$1" = "configure" ]; then + if test_mysql_access; then + db_input medium mysql-server/root_password || true + db_go + db_get mysql-server/root_password && rootpw="$RET" + + if ! set_mysql_rootpw "online"; then + password_error="yes" + fi + fi + + if [ "$password_error" = "yes" ]; then + db_input high mysql-server/error_setting_password || true + db_go + fi + +fi + +db_stop # in case invoke failes + +#DEBHELPER# + +exit 0 diff --git a/debian/dist/Debian/mariadb-galera-server-10.0.postrm b/debian/dist/Debian/mariadb-galera-server-10.0.postrm new file mode 100644 index 00000000000..469b1627aff --- /dev/null +++ b/debian/dist/Debian/mariadb-galera-server-10.0.postrm @@ -0,0 +1,83 @@ +#!/bin/bash -e + +# It is possible that Debconf has already been removed, too. +if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule +fi + +if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi +${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } + +MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" + +# Try to stop the server in a sane way. If it does not success let the admin +# do it himself. No database directories should be removed while the server +# is running! +stop_server() { + set +e + if [ -x /usr/sbin/invoke-rc.d ]; then + invoke-rc.d mysql stop + else + /etc/init.d/mysql stop + fi + errno=$? + set -e + + if [ "$?" != 0 ]; then + echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2 + echo "Stop it yourself and try again!" 1>&2 + exit 1 + fi +} + +case "$1" in + purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) + if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then + stop_server + sleep 2 + fi + ;; + *) + echo "postrm called with unknown argument '$1'" 1>&2 + exit 1 + ;; +esac + +# +# - Do NOT purge logs or data if another mysql-sever* package is installed (#307473) +# - Remove the mysql user only after all his owned files are purged. +# +if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then + # we remove the mysql user only after all his owned files are purged + rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz} + rm -rf /var/log/mysql + + db_input high mysql-server-5.1/postrm_remove_databases || true + db_go || true + db_get mysql-server-5.1/postrm_remove_databases || true + if [ "$RET" = "true" ]; then + # never remove the debian.cnf when the databases are still existing + # else we ran into big trouble on the next install! + rm -f /etc/mysql/debian.cnf + rm -rf /var/lib/mysql + rm -rf /var/run/mysqld + userdel mysql || true + fi + + # (normally) Automatically added by dh_installinit + if [ "$1" = "purge" ] ; then + update-rc.d mysql remove >/dev/null || exit 0 + fi + # (normally) End automatically added section +fi + +# (normally) Automatically added by dh_installdebconf +if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi +# (normally) End automatically added section + +# no DEBHELPER here, "update-rc.d remove" fails if mysql-server-5.1 is installed + +exit 0 diff --git a/debian/dist/Debian/mariadb-server-10.0.README.Debian b/debian/dist/Debian/mariadb-server-10.0.README.Debian deleted file mode 100644 index f398f2fa236..00000000000 --- a/debian/dist/Debian/mariadb-server-10.0.README.Debian +++ /dev/null @@ -1,109 +0,0 @@ -* MYSQL WON'T START OR STOP?: -============================= -You may never ever delete the special mysql user "debian-sys-maint". This -user together with the credentials in /etc/mysql/debian.cnf are used by the -init scripts to stop the server as they would require knowledge of the mysql -root users password else. -So in most of the times you can fix the situation by making sure that the -debian.cnf file contains the right password, e.g. by setting a new one -(remember to do a "flush privileges" then). - -* WHAT TO DO AFTER UPGRADES: -============================ -The privilege tables are automatically updated so all there is left is read -the changelogs on dev.mysql.com to see if any changes affect custom apps. - -* WHAT TO DO AFTER INSTALLATION: -================================ -The MySQL manual describes certain steps to do at this stage in a separate -chapter. They are not necessary as the Debian packages does them -automatically. - -The only thing that is left over for the admin is - - setting the passwords - - creating new users and databases - - read the rest of this text - -* DOWNGRADING TO 4.0 or 4.1: -============================ -Unsupported. Period. -But if you do and get problems or make interesting experiences, mail me, it -might help others. -Ok, if you really want, I would recommend to "mysqldump --opt" all tables, -then purge 4.1, delete /var/lib/mysql, install 4.0 and insert the dumps. Be -carefully, though, with the "mysql" table, you might not simply overwrite that -one as the password for the mysql "debian-sys-maint" user is stored in -/etc/mysql/debian.cnf and needed by /etc/init.d/ to start mysql and check if -it's alive. - -* SOME APPLICATION CAN NO LONGER CONNECT: -========================================= -This application is probably linked against libmysqlclient12 or below and -somebody has created a mysql user with new-style passwords. -The old_passwords=1 option in /etc/mysql/my.cnf might help. If not the -application that inserted the user has to be changed or the application that -tries to connect updated to libmysqlclient14 or -15. - -* NETWORKING: -============= -For security reasons, the Debian package has enabled networking only on the -loop-back device using "bind-address" in /etc/mysql/my.cnf. Check with -"netstat -tlnp" where it is listening. If your connection is aborted -immediately see if "mysqld: all" or similar is in /etc/hosts.allow and read -hosts_access(5). - -* WHERE IS THE DOCUMENTATION?: -============================== -Unfortunately due to licensing restrictions, debian currently not able -to provide the mysql-doc package in any format. For the most up to date -documentation, please go to http://dev.mysql.com/doc. - -* PASSWORDS: -============ -It is strongly recommended to set a password for the mysql root user (which - /usr/bin/mysql -u root -D mysql -e "update user set password=password('new-password') where user='root'" - /usr/bin/mysql -u root -e "flush privileges" -If you already had a password set add "-p" before "-u" to the lines above. - - -If you are tired to type the password in every time or want to automate your -scripts you can store it in the file $HOME/.my.cnf. It should be chmod 0600 -(-rw------- username username .my.cnf) to ensure that nobody else can read -it. Every other configuration parameter can be stored there, too. You will -find an example below and more information in the MySQL manual in -/usr/share/doc/mariadb-doc or www.mysql.com. - -ATTENTION: It is necessary, that a .my.cnf from root always contains a "user" -line wherever there is a "password" line, else, the Debian maintenance -scripts, that use /etc/mysql/debian.cnf, will use the username -"debian-sys-maint" but the password that is in root's .my.cnf. Also note, -that every change you make in the /root/.my.cnf will affect the mysql cron -script, too. - - # an example of $HOME/.my.cnf - [client] - user = your-mysql-username - password = enter-your-good-new-password-here - -* BIG_ROWS FOR EVEN MORE ROWS IN A TABLE: -========================================= -If you ever run out of rows in a table there is the possibility of building -the package with "-DBIG_ROWS" which, according to a MySQL employee on -packagers@lists.mysql.com should lead to a 64bit row index (I guess > 2^32 -rows) but also to an approx. 5% performance loss. - -* BerkeleyDB Storage Engine -=========================== -Support for BerkeleyDB has been removed in 5.1, and consequently both the -have-bdb and skip-bdb configuration options will cause the server to fail. -Removing the options from /etc/mysql/my.cnf will fix this problem. - -* FURTHER NOTES ON REPLICATION -=============================== -If the MySQL server is acting as a replication slave, you should not -set --tmpdir to point to a directory on a memory-based filesystem or to -a directory that is cleared when the server host restarts. A replication -slave needs some of its temporary files to survive a machine restart so -that it can replicate temporary tables or LOAD DATA INFILE operations. If -files in the temporary file directory are lost when the server restarts, -replication fails. diff --git a/debian/dist/Debian/mariadb-server-10.0.dirs b/debian/dist/Debian/mariadb-server-10.0.dirs deleted file mode 100644 index 4eef28f62e1..00000000000 --- a/debian/dist/Debian/mariadb-server-10.0.dirs +++ /dev/null @@ -1,11 +0,0 @@ -etc/init.d -etc/logrotate.d -etc/mysql/conf.d -usr/bin -usr/sbin -usr/share/man/man8 -usr/share/mysql -usr/share/doc/mariadb-server-10.0 -usr/support-files -var/run/mysqld -var/lib/mysql-upgrade diff --git a/debian/dist/Debian/mariadb-server-10.0.files.in b/debian/dist/Debian/mariadb-server-10.0.files.in deleted file mode 100644 index 5002204e75d..00000000000 --- a/debian/dist/Debian/mariadb-server-10.0.files.in +++ /dev/null @@ -1,81 +0,0 @@ -usr/lib/mysql/plugin/auth_pam.so -usr/lib/mysql/plugin/auth_socket.so -usr/lib/mysql/plugin/ha_sequence.so -usr/lib/mysql/plugin/ha_sphinx.so -usr/lib/mysql/plugin/ha_xtradb.so -usr/lib/mysql/plugin/handlersocket.so -usr/lib/mysql/plugin/locales.so -usr/lib/mysql/plugin/metadata_lock_info.so -usr/lib/mysql/plugin/query_cache_info.so -usr/lib/mysql/plugin/query_response_time.so -usr/lib/mysql/plugin/semisync_master.so -usr/lib/mysql/plugin/semisync_slave.so -usr/lib/mysql/plugin/sphinx.so -usr/lib/mysql/plugin/sql_errlog.so -usr/lib/libhsclient.so.* -etc/mysql/debian-start -etc/mysql/conf.d/mysqld_safe_syslog.cnf -usr/bin/msql2mysql -usr/bin/my_print_defaults -usr/bin/myisamchk -usr/bin/myisam_ftdump -usr/bin/myisamlog -usr/bin/myisampack -usr/bin/aria_pack -usr/bin/aria_read_log -usr/bin/aria_ftdump -usr/bin/aria_chk -usr/bin/aria_dump_log -usr/bin/mysql_convert_table_format -usr/bin/mysql_install_db -usr/bin/mysql_plugin -usr/bin/mysql_secure_installation -usr/bin/mysql_setpermission -usr/bin/mysql_tzinfo_to_sql -usr/bin/mysql_upgrade -usr/bin/mysql_zap -usr/bin/mysqlbinlog -usr/bin/mysqld_multi -usr/bin/mysqld_safe -usr/bin/mysqlhotcopy -usr/bin/perror -usr/bin/replace -usr/bin/resolve_stack_dump -usr/bin/resolveip -usr/share/doc/mariadb-server-10.0/mysqld.sym.gz -usr/share/doc/mariadb-server-10.0/INFO_SRC -usr/share/doc/mariadb-server-10.0/INFO_BIN -usr/share/lintian/overrides/mariadb-server-10.0 -usr/share/man/man1/msql2mysql.1 -usr/share/man/man1/myisamchk.1 -usr/share/man/man1/myisam_ftdump.1 -usr/share/man/man1/myisamlog.1 -usr/share/man/man1/myisampack.1 -usr/share/man/man1/my_print_defaults.1 -usr/share/man/man1/mysqlbinlog.1 -usr/share/man/man1/mysql_convert_table_format.1 -usr/share/man/man1/mysqld_multi.1 -usr/share/man/man1/mysqld_safe.1 -usr/share/man/man1/mysqlhotcopy.1 -usr/share/man/man1/mysql_install_db.1 -usr/share/man/man1/mysql_secure_installation.1 -usr/share/man/man1/mysql_setpermission.1 -usr/share/man/man1/mysql_upgrade.1 -usr/share/man/man1/mysql_zap.1 -usr/share/man/man1/perror.1 -usr/share/man/man1/replace.1 -usr/share/man/man1/resolveip.1 -usr/share/man/man1/resolve_stack_dump.1 -usr/share/man/man1/innochecksum.1 -usr/share/man/man1/mysql_tzinfo_to_sql.1 -usr/share/mysql/debian-start.inc.sh -usr/share/mysql/echo_stderr -usr/share/mysql/errmsg-utf8.txt -usr/share/mysql/fill_help_tables.sql -usr/share/mysql/mysql_system_tables_data.sql -usr/share/mysql/mysql_system_tables.sql -usr/share/mysql/mysql_performance_tables.sql -usr/share/mysql/mysql_test_data_timezone.sql -@CASSANDRA_DEB_FILES@ -@SPIDER_DEB_FILES@ -@TOKUDB_DEB_FILES@ diff --git a/debian/dist/Debian/mariadb-server-10.0.postinst b/debian/dist/Debian/mariadb-server-10.0.postinst deleted file mode 100644 index 9f79b61fd05..00000000000 --- a/debian/dist/Debian/mariadb-server-10.0.postinst +++ /dev/null @@ -1,268 +0,0 @@ -#!/bin/bash -e - -. /usr/share/debconf/confmodule - -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" -# 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 - -invoke() { - if [ -x /usr/sbin/invoke-rc.d ]; then - invoke-rc.d mysql $1 - else - /etc/init.d/mysql $1 - fi -} - -MYSQL_BOOTSTRAP="/usr/sbin/mysqld --bootstrap --user=mysql --skip-grant-tables --default-storage-engine=myisam" - -test_mysql_access() { - mysql --no-defaults -u root -h localhost /dev/null 2>&1 -} - -# call with $1 = "online" to connect to the server, otherwise it bootstraps -set_mysql_rootpw() { - # forget we ever saw the password. don't use reset to keep the seen status - db_set mysql-server/root_password "" - - tfile=`mktemp` - if [ ! -f "$tfile" ]; then - return 1 - fi - - # this avoids us having to call "test" or "[" on $rootpw - cat << EOF > $tfile -USE mysql; -UPDATE user SET password=PASSWORD("$rootpw") WHERE user='root'; -FLUSH PRIVILEGES; -EOF - if grep -q 'PASSWORD("")' $tfile; then - retval=0 - elif [ "$1" = "online" ]; then - mysql --no-defaults -u root -h localhost <$tfile >/dev/null - retval=$? - else - $MYSQL_BOOTSTRAP <$tfile - retval=$? - fi - rm -f $tfile - return $retval -} - -# This is necessary because mysql_install_db removes the pid file in /var/run -# and because changed configuration options should take effect immediately. -# In case the server wasn't running at all it should be ok if the stop -# script fails. I can't tell at this point because of the cleaned /var/run. -set +e; invoke stop; set -e - -case "$1" in - configure) - mysql_datadir=/usr/share/mysql - mysql_statedir=/var/lib/mysql - mysql_rundir=/var/run/mysqld - mysql_logdir=/var/log - mysql_cfgdir=/etc/mysql - mysql_newlogdir=/var/log/mysql - mysql_upgradedir=/var/lib/mysql-upgrade - - # first things first, if the following symlink exists, it is a preserved - # copy the old data dir from a mysql upgrade that would have otherwise - # been replaced by an empty mysql dir. this should restore it. - for dir in DATADIR LOGDIR; do - if [ "$dir" = "DATADIR" ]; then targetdir=$mysql_statedir; else targetdir=$mysql_newlogdir; fi - savelink="$mysql_upgradedir/$dir.link" - if [ -L "$savelink" ]; then - # If the targetdir was a symlink before we upgraded it is supposed - # to be either still be present or not existing anymore now. - if [ -L "$targetdir" ]; then - rm "$savelink" - elif [ ! -d "$targetdir" ]; then - mv "$savelink" "$targetdir" - else - # this should never even happen, but just in case... - mysql_tmp=`mktemp -d -t mysql-symlink-restore-XXXXXX` - echo "this is very strange! see $mysql_tmp/README..." >&2 - mv "$targetdir" "$mysql_tmp" - cat << EOF > "$mysql_tmp/README" - -if you're reading this, it's most likely because you had replaced /var/lib/mysql -with a symlink, then upgraded to a new version of mysql, and then dpkg -removed your symlink (see #182747 and others). the mysql packages noticed -that this happened, and as a workaround have restored it. however, because -/var/lib/mysql seems to have been re-created in the meantime, and because -we don't want to rm -rf something we don't know as much about, we're going -to leave this unexpected directory here. if your database looks normal, -and this is not a symlink to your database, you should be able to blow -this all away. - -EOF - fi - fi - rmdir $mysql_upgradedir 2>/dev/null || true - done - - # Ensure the existence and right permissions for the database and - # log files. - if [ ! -d "$mysql_statedir" -a ! -L "$mysql_statedir" ]; then mkdir "$mysql_statedir"; fi - if [ ! -d "$mysql_statedir/mysql" -a ! -L "$mysql_statedir/mysql" ]; then mkdir "$mysql_statedir/mysql"; fi - if [ ! -d "$mysql_newlogdir" -a ! -L "$mysql_newlogdir" ]; then mkdir "$mysql_newlogdir"; fi - # When creating an ext3 jounal on an already mounted filesystem like e.g. - # /var/lib/mysql, you get a .journal file that is not modifyable by chown. - # The mysql_datadir must not be writable by the mysql user under any - # circumstances as it contains scripts that are executed by root. - set +e - chown -R 0:0 $mysql_datadir - chown -R mysql $mysql_statedir - chown -R mysql $mysql_rundir - chown -R mysql:adm $mysql_newlogdir; chmod 2750 $mysql_newlogdir; - for i in log err; do - touch $mysql_logdir/mysql.$i - chown mysql:adm $mysql_logdir/mysql.$i - chmod 0640 $mysql_logdir/mysql.$i - done - set -e - - # This is important to avoid dataloss when there is a removed - # mysql-server version from Woody lying around which used the same - # data directory and then somewhen gets purged by the admin. - db_set mysql-server/postrm_remove_database false || true - - # To avoid downgrades. - touch $mysql_statedir/debian-10.0.flag - - # initiate databases. Output is not allowed by debconf :-( - # This will fail if we are upgrading an existing database; in this case - # mysql_upgrade, called from the /etc/init.d/mysql start script, will - # handle things. - # Debian: beware of the bashisms... - # Debian: can safely run on upgrades with existing databases - set +e - /bin/bash /usr/bin/mysql_install_db --rpm --user=mysql 2>&1 | $ERR_LOGGER - set -e - - ## On every reconfiguration the maintenance user is recreated. - # - # - It is easier to regenerate the password every time but as people - # use fancy rsync scripts and file alteration monitors, the existing - # password is used and existing files not touched. - # - The mysqld statement is like that in mysql_install_db because the - # server is not already running. This has some implications: - # - The amount of newlines and semicolons in the query is important! - # - GRANT is not possible with --skip-grant-tables and "INSERT - # (user,host..) VALUES" is not --ansi compliant - # - The echo is just for readability. ash's buildin has no "-e" so use /bin/echo. - # - The Super_priv, Show_db_priv, Create_tmp_table_priv and Lock_tables_priv - # may not be present as old Woody 3.23 databases did not have it and the - # admin might not already have run mysql_upgrade which adds them. - # As the binlog cron scripts to need at least the Super_priv, I do first - # the old query which always succeeds and then the new which may or may not. - - # recreate the credentials file if not present or without mysql_upgrade stanza - dc=$mysql_cfgdir/debian.cnf; - if [ -e "$dc" -a -n "`fgrep mysql_upgrade $dc 2>/dev/null`" ]; then - pass="`sed -n 's/^[ ]*password *= *// p' $dc | head -n 1`" - else - pass=`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'`; - if [ ! -d "$mysql_cfgdir" ]; then install -o 0 -g 0 -m 0755 -d $mysql_cfgdir; fi - cat /dev/null > $dc - echo "# Automatically generated for Debian scripts. DO NOT TOUCH!" >>$dc - echo "[client]" >>$dc - echo "host = localhost" >>$dc - echo "user = debian-sys-maint" >>$dc - echo "password = $pass" >>$dc - echo "socket = $mysql_rundir/mysqld.sock" >>$dc - echo "[mysql_upgrade]" >>$dc - echo "host = localhost" >>$dc - echo "user = debian-sys-maint" >>$dc - echo "password = $pass" >>$dc - echo "socket = $mysql_rundir/mysqld.sock" >>$dc - echo "basedir = /usr" >>$dc - fi - # If this dir chmod go+w then the admin did it. But this file should not. - chown 0:0 $dc - chmod 0600 $dc - - # update privilege tables - password_column_fix_query=`/bin/echo -e \ - "USE mysql;\n" \ - "ALTER TABLE user CHANGE Password Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL;"` - replace_query=`/bin/echo -e \ - "USE mysql;\n" \ - "SET sql_mode='';\n" \ - "REPLACE INTO user SET " \ - " host='localhost', user='debian-sys-maint', password=password('$pass'), " \ - " Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', " \ - " Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', " \ - " Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', " \ - " Index_priv='Y', Alter_priv='Y', Super_priv='Y', Show_db_priv='Y', "\ - " Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y', "\ - " Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y', "\ - " Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', "\ - " Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y',"\ - " ssl_cipher='', x509_issuer='', x509_subject='';"`; - # Engines supported by etch should be installed per default. The query sequence is supposed - # to be aborted if the CREATE TABLE fails due to an already existent table in which case the - # admin might already have chosen to remove one or more plugins. Newlines are necessary. - install_plugins=`/bin/echo -e \ - "USE mysql;\n" \ - "CREATE TABLE IF NOT EXISTS plugin (name char(64) COLLATE utf8_bin NOT NULL DEFAULT '', " \ - " dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '', " \ - " PRIMARY KEY (name)) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='MySQL plugins';" ` - - # Upgrade password column format before the root password gets set. - echo "$password_column_fix_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER - - db_get mysql-server/root_password && rootpw="$RET" - if ! set_mysql_rootpw; then - password_error="yes" - fi - - set +e - echo "$replace_query" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER - echo "$install_plugins" | $MYSQL_BOOTSTRAP 2>&1 | $ERR_LOGGER - set -e - ;; - - abort-upgrade|abort-remove|abort-configure) - ;; - - *) - echo "postinst called with unknown argument '$1'" 1>&2 - exit 1 - ;; -esac - -# here we check to see if we can connect as root without a password -# this should catch upgrades from previous versions where the root -# password wasn't set. if there is a password, or if the connection -# fails for any other reason, nothing happens. -if [ "$1" = "configure" ]; then - if test_mysql_access; then - db_input medium mysql-server/root_password || true - db_go - db_get mysql-server/root_password && rootpw="$RET" - - if ! set_mysql_rootpw "online"; then - password_error="yes" - fi - fi - - if [ "$password_error" = "yes" ]; then - db_input high mysql-server/error_setting_password || true - db_go - fi - -fi - -db_stop # in case invoke failes - -#DEBHELPER# - -exit 0 diff --git a/debian/dist/Debian/mariadb-server-10.0.postrm b/debian/dist/Debian/mariadb-server-10.0.postrm deleted file mode 100644 index 469b1627aff..00000000000 --- a/debian/dist/Debian/mariadb-server-10.0.postrm +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash -e - -# It is possible that Debconf has already been removed, too. -if [ -f /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule -fi - -if [ -n "$DEBIAN_SCRIPT_DEBUG" ]; then set -v -x; DEBIAN_SCRIPT_TRACE=1; fi -${DEBIAN_SCRIPT_TRACE:+ echo "#42#DEBUG# RUNNING $0 $*" 1>&2 } - -MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf" - -# Try to stop the server in a sane way. If it does not success let the admin -# do it himself. No database directories should be removed while the server -# is running! -stop_server() { - set +e - if [ -x /usr/sbin/invoke-rc.d ]; then - invoke-rc.d mysql stop - else - /etc/init.d/mysql stop - fi - errno=$? - set -e - - if [ "$?" != 0 ]; then - echo "Trying to stop the MySQL server resulted in exitcode $?." 1>&2 - echo "Stop it yourself and try again!" 1>&2 - exit 1 - fi -} - -case "$1" in - purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - if [ -n "`$MYADMIN ping 2>/dev/null`" ]; then - stop_server - sleep 2 - fi - ;; - *) - echo "postrm called with unknown argument '$1'" 1>&2 - exit 1 - ;; -esac - -# -# - Do NOT purge logs or data if another mysql-sever* package is installed (#307473) -# - Remove the mysql user only after all his owned files are purged. -# -if [ "$1" = "purge" -a ! \( -x /usr/sbin/mysqld -o -L /usr/sbin/mysqld \) ]; then - # we remove the mysql user only after all his owned files are purged - rm -f /var/log/mysql.{log,err}{,.0,.[1234567].gz} - rm -rf /var/log/mysql - - db_input high mysql-server-5.1/postrm_remove_databases || true - db_go || true - db_get mysql-server-5.1/postrm_remove_databases || true - if [ "$RET" = "true" ]; then - # never remove the debian.cnf when the databases are still existing - # else we ran into big trouble on the next install! - rm -f /etc/mysql/debian.cnf - rm -rf /var/lib/mysql - rm -rf /var/run/mysqld - userdel mysql || true - fi - - # (normally) Automatically added by dh_installinit - if [ "$1" = "purge" ] ; then - update-rc.d mysql remove >/dev/null || exit 0 - fi - # (normally) End automatically added section -fi - -# (normally) Automatically added by dh_installdebconf -if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then - . /usr/share/debconf/confmodule - db_purge -fi -# (normally) End automatically added section - -# no DEBHELPER here, "update-rc.d remove" fails if mysql-server-5.1 is installed - -exit 0 diff --git a/debian/dist/Debian/rules b/debian/dist/Debian/rules index 04f3426e464..28071e6fb45 100755 --- a/debian/dist/Debian/rules +++ b/debian/dist/Debian/rules @@ -166,11 +166,11 @@ install: build install -m 0755 debian/additions/innotop/innotop $(TMP)/usr/bin/ install -m 0644 debian/additions/innotop/innotop.1 $(TMP)/usr/share/man/man1/ - # mariadb-server + # mariadb-galera-server install -m 0755 $(BUILDDIR)/scripts/mysqld_safe $(TMP)/usr/bin/mysqld_safe - mkdir -p $(TMP)/usr/share/doc/mariadb-server-10.0/examples + mkdir -p $(TMP)/usr/share/doc/mariadb-galera-server-10.0/examples # We have a sane my.cnf, cruft not needed (remove my-*.cnf and config-*.cnf) - # $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mariadb-server-10.0/examples/ + # $(TMP)/usr/share/mysql/*cnf $(TMP)/usr/share/doc/mariadb-galera-server-10.0/examples/ rm -vf $(TMP)/usr/share/mysql/my-*.cnf \ $(TMP)/usr/share/mysql/config-*.cnf \ $(TMP)/usr/share/mysql/mi_test_all* \ @@ -182,15 +182,15 @@ install: build install -m 0755 debian/additions/debian-start $(TMP)/etc/mysql/ install -m 0755 debian/additions/debian-start.inc.sh $(TMP)/usr/share/mysql/ - install -m 0644 $(builddir)/Docs/INFO_SRC $(TMP)/usr/share/doc/mariadb-server-10.0/INFO_SRC - install -m 0644 $(builddir)/Docs/INFO_BIN $(TMP)/usr/share/doc/mariadb-server-10.0/INFO_BIN + install -m 0644 $(builddir)/Docs/INFO_SRC $(TMP)/usr/share/doc/mariadb-galera-server-10.0/INFO_SRC + install -m 0644 $(builddir)/Docs/INFO_BIN $(TMP)/usr/share/doc/mariadb-galera-server-10.0/INFO_BIN # mariadb-test mv $(TMP)/usr/mysql-test $(TMP)/usr/share/mysql # lintian overrides mkdir -p $(TMP)/usr/share/lintian/overrides/ - cp debian/mariadb-galera-server-10.0.lintian-overrides $(TMP)/usr/share/lintian/overrides/mariadb-server-10.0 + cp debian/mariadb-galera-server-10.0.lintian-overrides $(TMP)/usr/share/lintian/overrides/mariadb-galera-server-10.0 # For 5.0 -> 10.0 transition d=$(TMP)/usr/share/mysql-common/internal-use-only/; \ -- cgit v1.2.1