Relocate mariadb to stx-integ/database/mariadb

Move content from stx-gplv2 into stx-integ

Packages will be relocated to

stx-integ:
    base/
        bash
        cgcs-users
        cluster-resource-agents
        dpkg
        haproxy
        libfdt
        netpbm
        rpm

    database/
        mariadb

    filesystem/
        iscsi-initiator-utils

    filesystem/drbd/
        drbd-tools

    kernel/kernel-modules/
        drbd
        integrity
        intel-e1000e
        intel-i40e
        intel-i40evf
        intel-ixgbe
        intel-ixgbevf
        qat17
        tpmdd

    ldap/
        ldapscripts

    networking/
        iptables
        net-tools

Change-Id: Ibc2ad09bef7a7f40e337513a1694a22f38d7f4e9
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2018-08-01 14:24:05 -04:00
parent 18f91ec6be
commit 32e03b2cdd
42 changed files with 5614 additions and 0 deletions

View File

@ -137,3 +137,4 @@ filesystem/iscsi-initiator-utils
ldap/ldapscripts
networking/net-tools
filesystem/drbd/drbd-tools
database/mariadb

View File

@ -0,0 +1,6 @@
The upstream mariadb includes TokuDB source code with AGPL license.
As AGPL-3.0 is considered a prohibited license by WR, we've modified
the source tarball to delete the storage/tokudb directory and remove
the AGPL reference from the EXCEPTIONS-CLIENT Foss License file. The
spec file has also been modified to compile without tokudb support.

View File

@ -0,0 +1,4 @@
COPY_LIST="$CGCS_BASE/downloads/mariadb-10.1.28.tar.gz $PKG_BASE/centos/files/*"
TIS_PATCH_VER=15
BUILD_IS_BIG=7
BUILD_IS_SLOW=19

View File

@ -0,0 +1,27 @@
Copyright (c) 2012-2014, Olaf van Zandwijk
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,13 @@
This directory contains prepared configuration files with .cnf extension,
which provide a configuration for some common MariaDB deployment scenarios.
These configuration files do not include the default configuration of datadir,
log-file and pid-file locations, as specified in the default my.cnf file,
provided in this distribution.
Thus, it is recommended to use these configuration files as an addition to the
default my.cnf configuration file.
Since default my.cnf contains `!includedir @INSTALL_SYSCONF2DIR@` directive, it is
recommended to copy required configuration under @INSTALL_SYSCONF2DIR@ directory,
so the default my.cnf specifications will be extended.

View File

@ -0,0 +1,4 @@
The official MySQL documentation is not freely redistributable, so we cannot
include it in RHEL or Fedora. You can find it on-line at
http://dev.mysql.com/doc/

View File

@ -0,0 +1,9 @@
MySQL is distributed under GPL v2, but there are some licensing exceptions
that allow the client libraries to be linked with a non-GPL application,
so long as the application is under a license approved by Oracle.
For details see
http://www.mysql.com/about/legal/licensing/foss-exception/
Some innobase code from Percona and Google is under BSD license.
Some code related to test-suite is under LGPLv2.

View File

@ -0,0 +1,89 @@
#!/bin/bash
#
# Script to make a proxy (ie HAProxy) capable of monitoring Galera cluster nodes properly
#
# Author: Olaf van Zandwijk <olaf.vanzandwijk@nedap.com>
# Author: Raghavendra Prabhu <raghavendra.prabhu@percona.com>
# Author: Ryan O'Hara <rohara@redhat.com>
#
# Documentation and download: https://github.com/olafz/percona-clustercheck
#
# Based on the original script from Unai Rodriguez
#
if [ -f @INSTALL_SYSCONFDIR@/sysconfig/clustercheck ]; then
. @INSTALL_SYSCONFDIR@/sysconfig/clustercheck
fi
MYSQL_USERNAME="${MYSQL_USERNAME-clustercheckuser}"
MYSQL_PASSWORD="${MYSQL_PASSWORD-clustercheckpassword!}"
MYSQL_HOST="${MYSQL_HOST:-127.0.0.1}"
MYSQL_PORT="${MYSQL_PORT:-3306}"
ERR_FILE="${ERR_FILE:-/dev/null}"
AVAILABLE_WHEN_DONOR=${AVAILABLE_WHEN_DONOR:-0}
AVAILABLE_WHEN_READONLY=${AVAILABLE_WHEN_READONLY:-1}
DEFAULTS_EXTRA_FILE=${DEFAULTS_EXTRA_FILE:-@INSTALL_SYSCONFDIR@/my.cnf}
#Timeout exists for instances where mysqld may be hung
TIMEOUT=10
if [[ -r $DEFAULTS_EXTRA_FILE ]];then
MYSQL_CMDLINE="mysql --defaults-extra-file=$DEFAULTS_EXTRA_FILE -nNE \
--connect-timeout=$TIMEOUT \
--user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} \
--host=${MYSQL_HOST} --port=${MYSQL_PORT}"
else
MYSQL_CMDLINE="mysql -nNE --connect-timeout=$TIMEOUT \
--user=${MYSQL_USERNAME} --password=${MYSQL_PASSWORD} \
--host=${MYSQL_HOST} --port=${MYSQL_PORT}"
fi
#
# Perform the query to check the wsrep_local_state
#
WSREP_STATUS=$($MYSQL_CMDLINE -e "SHOW STATUS LIKE 'wsrep_local_state';" \
2>${ERR_FILE} | tail -1 2>>${ERR_FILE})
if [[ "${WSREP_STATUS}" == "4" ]] || [[ "${WSREP_STATUS}" == "2" && ${AVAILABLE_WHEN_DONOR} == 1 ]]
then
# Check only when set to 0 to avoid latency in response.
if [[ $AVAILABLE_WHEN_READONLY -eq 0 ]];then
READ_ONLY=$($MYSQL_CMDLINE -e "SHOW GLOBAL VARIABLES LIKE 'read_only';" \
2>${ERR_FILE} | tail -1 2>>${ERR_FILE})
if [[ "${READ_ONLY}" == "ON" ]];then
# Galera cluster node local state is 'Synced', but it is in
# read-only mode. The variable AVAILABLE_WHEN_READONLY is set to 0.
# => return HTTP 503
# Shell return-code is 1
echo -en "HTTP/1.1 503 Service Unavailable\r\n"
echo -en "Content-Type: text/plain\r\n"
echo -en "Connection: close\r\n"
echo -en "Content-Length: 35\r\n"
echo -en "\r\n"
echo -en "Galera cluster node is read-only.\r\n"
sleep 0.1
exit 1
fi
fi
# Galera cluster node local state is 'Synced' => return HTTP 200
# Shell return-code is 0
echo -en "HTTP/1.1 200 OK\r\n"
echo -en "Content-Type: text/plain\r\n"
echo -en "Connection: close\r\n"
echo -en "Content-Length: 32\r\n"
echo -en "\r\n"
echo -en "Galera cluster node is synced.\r\n"
sleep 0.1
exit 0
else
# Galera cluster node local state is not 'Synced' => return HTTP 503
# Shell return-code is 1
echo -en "HTTP/1.1 503 Service Unavailable\r\n"
echo -en "Content-Type: text/plain\r\n"
echo -en "Connection: close\r\n"
echo -en "Content-Length: 36\r\n"
echo -en "\r\n"
echo -en "Galera cluster node is not synced.\r\n"
sleep 0.1
exit 1
fi

View File

@ -0,0 +1,32 @@
mysqladmin crash on execution of below command:
#> mysqladmin -u root -p
...
Segmentation fault (core dumped)
This is probably caused by memory corruption based on working with temp_argv[-1].
RHBZ: #1207041
Upstream report: https://mariadb.atlassian.net/browse/MDEV-7883
---
client/mysqladmin.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index ffdc73f..cb0c558 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -1361,7 +1361,8 @@ static char **mask_password(int argc, char ***argv)
}
argc--;
}
- temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE));
+ if (argc >= 0)
+ temp_argv[argc]= my_strdup((*argv)[argc], MYF(MY_FAE));
return(temp_argv);
}
--
1.9.1

View File

@ -0,0 +1,24 @@
Don't guess basedir in mysql_config; we place it under _libdir because
of multilib conflicts, so use rather configured @prefix@ path directly.
---
scripts/mysql_config.sh | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 52f6d56..df63365 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -76,8 +76,7 @@ get_full_path ()
me=`get_full_path $0`
-# Script might have been renamed but assume mysql_<something>config<something>
-basedir=`echo $me | sed -e 's;/bin/mysql_.*config.*;;'`
+basedir='@prefix@'
ldata='@localstatedir@'
execdir='@libexecdir@'
--
1.9.1

View File

@ -0,0 +1,26 @@
---
include/my_sys.h | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/include/my_sys.h b/include/my_sys.h
index 110a2ee..a90ac5c 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -212,13 +212,7 @@
#define my_safe_afree(ptr, size) my_afree(ptr)
#endif /* HAVE_ALLOCA */
-#ifndef errno /* did we already get it? */
-#ifdef HAVE_ERRNO_AS_DEFINE
-#include <errno.h> /* errno is a define */
-#else
-extern int errno; /* declare errno */
-#endif
-#endif /* #ifndef errno */
+#include <errno.h> /* errno is a define */
extern char *home_dir; /* Home directory for user */
extern MYSQL_PLUGIN_IMPORT char *mysql_data_home;
extern const char *my_progname; /* program-name (printed in errors) */
--
1.9.1

View File

@ -0,0 +1,72 @@
---
support-files/my-huge.cnf.sh | 1 +
support-files/my-innodb-heavy-4G.cnf.sh | 2 +-
support-files/my-large.cnf.sh | 1 +
support-files/my-medium.cnf.sh | 1 +
support-files/my-small.cnf.sh | 1 +
5 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/support-files/my-huge.cnf.sh b/support-files/my-huge.cnf.sh
index 4e08348..d8bf29e 100644
--- a/support-files/my-huge.cnf.sh
+++ b/support-files/my-huge.cnf.sh
@@ -25,6 +25,7 @@ socket = @MYSQL_UNIX_ADDR@
# The MySQL server
[mysqld]
+log-error = @LOG_LOCATION@
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
skip-external-locking
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index 2590ff5..85fd33a 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -42,7 +42,7 @@ socket = @MYSQL_UNIX_ADDR@
# The MariaDB server
#
[mysqld]
-
+log-error = @LOG_LOCATION@
# generic configuration options
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
diff --git a/support-files/my-large.cnf.sh b/support-files/my-large.cnf.sh
index 6f8dab0..e8c5f74 100644
--- a/support-files/my-large.cnf.sh
+++ b/support-files/my-large.cnf.sh
@@ -25,6 +25,7 @@ socket = @MYSQL_UNIX_ADDR@
# The MariaDB server
[mysqld]
+log-error = @LOG_LOCATION@
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
skip-external-locking
diff --git a/support-files/my-medium.cnf.sh b/support-files/my-medium.cnf.sh
index 19ab8df..fc8fc78 100644
--- a/support-files/my-medium.cnf.sh
+++ b/support-files/my-medium.cnf.sh
@@ -26,6 +26,7 @@ socket = @MYSQL_UNIX_ADDR@
# The MariaDB server
[mysqld]
+log-error = @LOG_LOCATION@
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
skip-external-locking
diff --git a/support-files/my-small.cnf.sh b/support-files/my-small.cnf.sh
index 8c78072..6777431 100644
--- a/support-files/my-small.cnf.sh
+++ b/support-files/my-small.cnf.sh
@@ -24,6 +24,7 @@ socket = @MYSQL_UNIX_ADDR@
# The MySQL server
[mysqld]
+log-error = @LOG_LOCATION@
port = @MYSQL_TCP_PORT@
socket = @MYSQL_UNIX_ADDR@
skip-external-locking
--
1.9.1

View File

@ -0,0 +1,49 @@
Upstream chooses to install INFO_SRC and INFO_BIN into the docs dir, which
breaks at least two packaging commandments, so we put them into $libdir
instead. That means we have to hack the file_contents regression test
to know about this.
Recommendation they change is at http://bugs.mysql.com/bug.php?id=61425
---
mysql-test/t/file_contents.test | 13 ++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/mysql-test/t/file_contents.test b/mysql-test/t/file_contents.test
index 4734a02..a892297 100644
--- a/mysql-test/t/file_contents.test
+++ b/mysql-test/t/file_contents.test
@@ -11,7 +11,7 @@
--perl
print "\nChecking 'INFO_SRC' and 'INFO_BIN'\n";
$dir_bin = $ENV{'MYSQL_BINDIR'};
-if ($dir_bin eq '/usr/') {
+if ($dir_bin =~ '.*/usr/$') {
# RPM package
$dir_docs = $dir_bin;
$dir_docs =~ s|/lib|/share/doc|;
@@ -22,7 +22,7 @@ if ($dir_bin eq '/usr/') {
# RedHat: version number in directory name
$dir_docs = glob "$dir_docs/MariaDB-server*";
}
-} elsif ($dir_bin eq '/usr') {
+} elsif ($dir_bin =~ '.*/usr$') {
# RPM build during development
$dir_docs = "$dir_bin/share/doc";
if(-d "$dir_docs/packages") {
@@ -32,6 +32,15 @@ if ($dir_bin eq '/usr/') {
# RedHat/Debian: version number in directory name
$dir_docs = glob "$dir_docs/mariadb-server-*";
$dir_docs = glob "$dir_docs/MariaDB-server*" unless -d $dir_docs;
+
+ # All the above is entirely wacko, because these files are not docs;
+ # they should be kept in libdir instead. mtr does not provide a nice
+ # way to find libdir though, so we have to kluge it like this:
+ if (-d "$dir_bin/lib64/mysql") {
+ $dir_docs = "$dir_bin/lib64/mysql";
+ } else {
+ $dir_docs = "$dir_bin/lib/mysql";
+ }
}
# Slackware
$dir_docs = glob "$dir_bin/doc/mariadb-[0-9]*" unless -d $dir_docs;

View File

@ -0,0 +1,21 @@
---
support-files/wsrep.cnf.sh | 3 +++
1 file changed, 3 insertions(+)
diff --git a/support-files/wsrep.cnf.sh b/support-files/wsrep.cnf.sh
index a539085..51ce3dc 100644
--- a/support-files/wsrep.cnf.sh
+++ b/support-files/wsrep.cnf.sh
@@ -30,6 +30,9 @@ bind-address=0.0.0.0
## WSREP options
##
+# Enable wsrep
+wsrep_on=1
+
# Full path to wsrep provider library or 'none'
wsrep_provider=none
--
1.9.1

View File

@ -0,0 +1,49 @@
Use configured value instead of hardcoded path
---
scripts/mysql_install_db.pl.in | 2 +-
scripts/mysql_install_db.sh | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
index 9d2c1f6..0accdd1 100644
--- a/scripts/mysql_install_db.pl.in
+++ b/scripts/mysql_install_db.pl.in
@@ -320,7 +320,7 @@ elsif ( $opt->{basedir} )
find_in_basedir($opt,"file","mysqld-nt",
"bin"); # ,"sql"
$srcpkgdatadir = find_in_basedir($opt,"dir","fill_help_tables.sql",
- "share","share/mysql"); # ,"scripts"
+ "share","@INSTALL_MYSQLSHAREDIR@"); # ,"scripts"
$buildpkgdir = $srcpkgdatadir;
$scriptdir = "$opt->{basedir}/scripts";
}
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 364cc4f..eaa7a89 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -311,17 +311,17 @@ then
cannot_find_file mysqld $basedir/libexec $basedir/sbin $basedir/bin
exit 1
fi
- langdir=`find_in_basedir --dir errmsg.sys share/english share/mysql/english`
+ langdir=`find_in_basedir --dir errmsg.sys share/english @INSTALL_MYSQLSHAREDIR@/english`
if test -z "$langdir"
then
- cannot_find_file errmsg.sys $basedir/share/english $basedir/share/mysql/english
+ cannot_find_file errmsg.sys $basedir/share/english $basedir/@INSTALL_MYSQLSHAREDIR@/english
exit 1
fi
- srcpkgdatadir=`find_in_basedir --dir fill_help_tables.sql share share/mysql`
+ srcpkgdatadir=`find_in_basedir --dir fill_help_tables.sql share @INSTALL_MYSQLSHAREDIR@`
buildpkgdatadir=$srcpkgdatadir
if test -z "$srcpkgdatadir"
then
- cannot_find_file fill_help_tables.sql $basedir/share $basedir/share/mysql
+ cannot_find_file fill_help_tables.sql $basedir/share $basedir/@INSTALL_MYSQLSHAREDIR@
exit 1
fi
scriptdir="$basedir/scripts"
--
1.9.1

View File

@ -0,0 +1,62 @@
Improve the documentation that will be installed in the mysql-test RPM.
---
mysql-test/README | 36 +++++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 11 deletions(-)
diff --git a/mysql-test/README b/mysql-test/README
index 0fba1cc..2e756e9 100644
--- a/mysql-test/README
+++ b/mysql-test/README
@@ -1,15 +1,28 @@
-This directory contains a test suite for the MySQL daemon. To run
-the currently existing test cases, simply execute ./mysql-test-run in
-this directory. It will fire up the newly built mysqld and test it.
+This directory contains a test suite for the MariaDB daemon. To run
+the currently existing test cases, execute ./mysql-test-run in
+this directory.
-Note that you do not have to have to do "make install", and you could
-actually have a co-existing MySQL installation. The tests will not
-conflict with it. To run the test suite in a source directory, you
-must do make first.
+For use in Red Hat distributions, you should run the script as user mysql,
+who is created with nologin shell however, so the best bet is something like
+ $ su -
+ # cd /usr/share/mysql-test
+ # su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=rh-skipped-tests.list"
-All tests must pass. If one or more of them fail on your system, please
-read the following manual section for instructions on how to report the
-problem:
+This will use the installed mysql executables, but will run a private copy
+of the server process (using data files within /usr/share/mysql-test),
+so you need not start the mysqld service beforehand.
+
+The "--skip-test-list=rh-skipped-tests.list" option excludes tests that are
+known to fail on one or more Red-Hat-supported platforms. You can omit it
+if you want to check whether such failures occur for you. Documentation
+about the reasons for omitting such tests can be found in the file
+rh-skipped-tests.list.
+
+To clean up afterwards, remove the created "var" subdirectory, eg
+ # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var"
+
+If one or more tests fail on your system, please read the following manual
+section for instructions on how to report the problem:
https://mariadb.com/kb/en/reporting-bugs
@@ -26,7 +39,8 @@ other relevant options.
With no test cases named on the command line, mysql-test-run falls back
to the normal "non-extern" behavior. The reason for this is that some
-tests cannot run with an external server.
+tests cannot run with an external server (because they need to control the
+options with which the server is started).
You can create your own test cases. To create a test case, create a new
file in the t subdirectory using a text editor. The file should have a .test
--
1.9.1

View File

@ -0,0 +1,80 @@
Adjust the mysql-log-rotate script in several ways:
* Use the correct log file pathname for Red Hat installations.
* Enable creation of the log file by logrotate (needed since
/var/log/ isn't writable by mysql user); and set the same 640
permissions we normally use.
* Comment out the actual rotation commands, so that user must edit
the file to enable rotation. This is unfortunate, but the fact
that the script will probably fail without manual configuration
(to set a root password) means that we can't really have it turned
on by default. Fortunately, in most configurations the log file
is low-volume and so rotation is not critical functionality.
See discussions at RH bugs 799735, 547007
---
support-files/mysql-log-rotate.sh | 44 ++++++++++++++++++++-------------------
1 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh
index 5d1b30b..425c591 100644
--- a/support-files/mysql-log-rotate.sh
+++ b/support-files/mysql-log-rotate.sh
@@ -1,9 +1,9 @@
# This logname can be set in /etc/my.cnf
-# by setting the variable "err-log"
-# in the [safe_mysqld] section as follows:
+# by setting the variable "log-error"
+# in the [mysqld_safe] section as follows:
#
-# [safe_mysqld]
-# err-log=@localstatedir@/mysqld.log
+# [mysqld_safe]
+# log-error=@LOG_LOCATION@
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
@@ -18,20 +18,22 @@
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !
-@localstatedir@/mysqld.log {
- # create 600 mysql mysql
- notifempty
- daily
- rotate 3
- missingok
- compress
- postrotate
- # just if mysqld is really running
- if test -x @bindir@/mysqladmin && \
- @bindir@/mysqladmin ping &>/dev/null
- then
- @bindir@/mysqladmin --local flush-error-log \
- flush-engine-log flush-general-log flush-slow-log
- fi
- endscript
-}
+# Then, un-comment the following lines to enable rotation of mysql's log file:
+
+#@LOG_LOCATION@ {
+# # create 600 mysql mysql
+# notifempty
+# daily
+# rotate 3
+# missingok
+# compress
+# postrotate
+# # just if mysqld is really running
+# if test -x @bindir@/mysqladmin && \
+# @bindir@/mysqladmin ping &>/dev/null
+# then
+# @bindir@/mysqladmin --local flush-error-log \
+# flush-engine-log flush-general-log flush-slow-log
+# fi
+# endscript
+#}
--
1.9.1

View File

@ -0,0 +1,24 @@
---
scripts/mysql_install_db.pl.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/mysql_install_db.pl.in b/scripts/mysql_install_db.pl.in
index 0accdd1..3ab2786 100644
--- a/scripts/mysql_install_db.pl.in
+++ b/scripts/mysql_install_db.pl.in
@@ -399,10 +399,10 @@ if ( $opt->{'skip-name-resolve'} and $resolved and $resolved =~ /\s/ )
}
# ----------------------------------------------------------------------
-# Create database directories mysql & test
+# Create database directories mysql
# ----------------------------------------------------------------------
-foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql", "$opt->{ldata}/test" )
+foreach my $dir ( $opt->{ldata}, "$opt->{ldata}/mysql" )
{
# FIXME not really the same as original "mkdir -p", but ok?
mkdir($dir, 0700) unless -d $dir;
--
1.9.1

View File

@ -0,0 +1,41 @@
---
support-files/CMakeLists.txt | 1 +
support-files/rpm/server.cnf | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index 71e9b3f..5f3b2a6 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -81,6 +81,7 @@ IF(UNIX)
ENDIF()
CONFIGURE_FILE(mariadb.pc.in ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc @ONLY)
+ CONFIGURE_FILE(rpm/server.cnf ${CMAKE_CURRENT_BINARY_DIR}/rpm/server.cnf @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/mariadb.pc DESTINATION ${INSTALL_SHAREDIR}/pkgconfig COMPONENT Development)
INSTALL(FILES mysql.m4 DESTINATION ${INSTALL_SHAREDIR}/aclocal COMPONENT Development)
diff --git a/support-files/rpm/server.cnf b/support-files/rpm/server.cnf
index 9682d2b..6f398d4 100644
--- a/support-files/rpm/server.cnf
+++ b/support-files/rpm/server.cnf
@@ -9,7 +9,16 @@
[server]
# this is only for the mysqld standalone daemon
+# Settings user and group are ignored when systemd is used.
+# If you need to run mysqld under a different user or group,
+# customize your systemd unit file for mysqld/mariadb according to the
+# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld]
+datadir=@MYSQL_DATADIR@
+socket=@MYSQL_UNIX_ADDR@
+log-error=@LOG_LOCATION@
+pid-file=@PID_FILE_DIR@/@DAEMON_NO_PREFIX@.pid
+
#
# * Galera-related settings
--
1.9.1

View File

@ -0,0 +1,34 @@
---
scripts/mysqld_safe.sh | 2 +-
support-files/mysql.server.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 5564f92..fe77d97 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -756,7 +756,7 @@ if [ ! -d $mysql_unix_port_dir ]
then
if ! `mkdir -p $mysql_unix_port_dir`
then
- log_error "Fatal error Can't create database directory '$mysql_unix_port'"
+ echo "Fatal error Can't create database directory '$mysql_unix_port'"
exit 1
fi
chown $user $mysql_unix_port_dir
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index ed0da3c..312f2b2 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -296,7 +296,7 @@ case "$mode" in
then
# Give extra arguments to mysqld with the my.cnf file. This script
# may be overwritten at next upgrade.
- $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &
+ $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" >dev/null &
wait_for_ready; return_value=$?
# Make lock for RedHat / SuSE
--
1.9.1

View File

@ -0,0 +1,47 @@
---
scripts/CMakeLists.txt | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 2f9c185..a6e4d49 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -362,6 +362,35 @@ ELSE()
)
ENDFOREACH()
+ # files for systemd
+ SET(SYSTEMD_SCRIPTS
+ mysql.tmpfiles.d
+ mysql.service
+ mysql@.service
+ mysql-prepare-db-dir
+ mysql-wait-ready
+ mysql-wait-stop
+ mysql-check-socket
+ mysql-check-upgrade
+ mysql-scripts-common
+ mysql_config_multilib
+ clustercheck
+ mysql.init
+ my.cnf
+ )
+ FOREACH(file ${SYSTEMD_SCRIPTS})
+ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
+ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
+ ELSEIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${file}.in)
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
+ ELSE()
+ MESSAGE(FATAL_ERROR "Can not find ${file}.sh or ${file}.in in "
+ "${CMAKE_CURRENT_SOURCE_DIR}" )
+ ENDIF()
+ ENDFOREACH()
+
FOREACH(file ${WSREP_SOURCE})
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.sh
${CMAKE_CURRENT_BINARY_DIR}/${file} ESCAPE_QUOTES @ONLY)
--
1.9.1

View File

@ -0,0 +1,23 @@
module mariadb-server-galera 1.0;
require {
type mysqld_t;
type rsync_exec_t;
type anon_inodefs_t;
type proc_net_t;
type kerberos_port_t;
class file { read execute execute_no_trans getattr open };
class tcp_socket { name_bind name_connect };
class process { setpgid siginh rlimitinh noatsecure };
}
# allow mysqld to run rsyncd
allow mysqld_t self:process setpgid;
allow mysqld_t rsync_exec_t:file { read execute execute_no_trans getattr open };
allow mysqld_t anon_inodefs_t:file getattr;
allow mysqld_t proc_net_t:file { read open };
# allow rsyncd to listen on port 4444
allow mysqld_t kerberos_port_t:tcp_socket { name_bind name_connect };

View File

@ -0,0 +1,30 @@
---
mysql-test/r/ssl_8k_key.result | 4 ++--
mysql-test/t/ssl_8k_key.test | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mysql-test/r/ssl_8k_key.result b/mysql-test/r/ssl_8k_key.result
index b33a1d2..ff9d0cc 100644
--- a/mysql-test/r/ssl_8k_key.result
+++ b/mysql-test/r/ssl_8k_key.result
@@ -1,2 +1,2 @@
-Variable_name Value
-Ssl_cipher DHE-RSA-AES256-SHA
+have_ssl
+1
diff --git a/mysql-test/t/ssl_8k_key.test b/mysql-test/t/ssl_8k_key.test
index 27cffdc..4b81648 100644
--- a/mysql-test/t/ssl_8k_key.test
+++ b/mysql-test/t/ssl_8k_key.test
@@ -5,7 +5,7 @@
#
# Bug#29784 YaSSL assertion failure when reading 8k key.
#
---exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SHOW STATUS LIKE 'ssl_Cipher'" 2>&1
+--exec $MYSQL --ssl --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem -e "SELECT (VARIABLE_VALUE <> '') AS have_ssl FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME='Ssl_cipher'" 2>&1
## This test file is for testing encrypted communication only, not other
## encryption routines that the SSL library happens to provide!
--
1.9.1

View File

@ -0,0 +1,40 @@
Remove overly optimistic definition of strmov() as stpcpy().
mysql uses this macro with overlapping source and destination strings,
which is verboten per spec, and fails on some Red Hat platforms.
Deleting the definition is sufficient to make it fall back to a
byte-at-a-time copy loop, which should consistently give the
expected behavior.
Note: the particular case that prompted this patch is reported and fixed
at http://bugs.mysql.com/bug.php?id=48864. However, my faith in upstream's
ability to detect this type of error is low, and I also see little evidence
of any real performance gain from optimizing these calls. So I'm keeping
this patch.
---
include/m_string.h | 8 --------
1 file changed, 8 deletions(-)
diff --git a/include/m_string.h b/include/m_string.h
index 7437ea8..bb3ab57 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -73,14 +73,6 @@
extern void *(*my_str_realloc)(void *, size_t);
extern void (*my_str_free)(void *);
-#ifdef DBUG_OFF
-#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
-#define strmov(A,B) __builtin_stpcpy((A),(B))
-#elif defined(HAVE_STPCPY)
-#define strmov(A,B) stpcpy((A),(B))
-#endif
-#endif
-
/* Declared in int2str() */
extern const char _dig_vec_upper[];
extern const char _dig_vec_lower[];
--
1.9.1

View File

@ -0,0 +1,18 @@
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# This group is read by the server
#
[mysqld]
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
#
# include all files from the config directory
#
!includedir @INSTALL_SYSCONF2DIR@

View File

@ -0,0 +1,39 @@
#!/bin/sh
# We check if there is already a process using the socket file,
# since otherwise the systemd service file could report false
# positive result when starting and mysqld_safe could remove
# a socket file, which is actually being used by a different daemon.
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
if test -e "$socketfile" ; then
echo "Socket file $socketfile exists." >&2
# no write permissions
if ! test -w "$socketfile" ; then
echo "Not enough permission to write to the socket file $socketfile, which is suspicious." >&2
echo "Please, remove $socketfile manually to start the service." >&2
exit 1
fi
# not a socket file
if ! test -S "$socketfile" ; then
echo "The file $socketfile is not a socket file, which is suspicious." >&2
echo "Please, remove $socketfile manually to start the service." >&2
exit 1
fi
# some process uses the socket file
if fuser "$socketfile" &>/dev/null ; then
socketpid=$(fuser "$socketfile" 2>/dev/null)
echo "Is another MySQL daemon already running with the same unix socket?" >&2
echo "Please, stop the process $socketpid or remove $socketfile manually to start the service." >&2
exit 1
fi
# socket file is a garbage
echo "No process is using $socketfile, which means it is a garbage, so it will be removed automatically." >&2
fi
exit 0

View File

@ -0,0 +1,39 @@
#!/bin/sh
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
upgrade_info_file="$datadir/mysql_upgrade_info"
version=0
# get version as integer from mysql_upgrade_info file
if [ -f "$upgrade_info_file" ] && [ -r "$upgrade_info_file" ] ; then
version_major=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\1/')
version_minor=$(cat "$upgrade_info_file" | head -n 1 | sed -e 's/\([0-9]*\)\.\([0-9]*\)\..*$/\2/')
if [[ $version_major =~ ^[0-9]+$ ]] && [[ $version_minor =~ ^[0-9]+$ ]] ; then
version=$((version_major*100+version_minor))
fi
fi
# compute current version as integer
thisversion=$((@MAJOR_VERSION@*100+@MINOR_VERSION@))
# provide warning in cases we should run mysql_upgrade
if [ $version -ne $thisversion ] ; then
# give extra warning if some version seems to be skipped
if [ $version -gt 0 ] && [ $version -lt 505 ] ; then
echo "The datadir located at $datadir seems to be older than of a version 5.5. Please, mind that as a general rule, to upgrade from one release series to another, go to the next series rather than skipping a series." >&2
fi
cat <<EOF >&2
The datadir located at $datadir needs to be upgraded using 'mysql_upgrade' tool. This can be done using the following steps:
1. Back-up your data before with 'mysql_upgrade'
2. Start the database daemon using 'service @DAEMON_NAME@ start'
3. Run 'mysql_upgrade' with a database user that has sufficient privileges
Read more about 'mysql_upgrade' usage at:
https://mariadb.com/kb/en/mariadb/documentation/sql-commands/table-commands/mysql_upgrade/
EOF
fi
exit 0

View File

@ -0,0 +1,26 @@
/* simple test program to see if we can link the embedded server library */
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "mysql.h"
MYSQL *mysql;
static char *server_options[] = \
{ "mysql_test", "--defaults-file=my.cnf", NULL };
int num_elements = (sizeof(server_options) / sizeof(char *)) - 1;
static char *server_groups[] = { "libmysqld_server",
"libmysqld_client", NULL };
int main(int argc, char **argv)
{
mysql_library_init(num_elements, server_options, server_groups);
mysql = mysql_init(NULL);
mysql_close(mysql);
mysql_library_end();
return 0;
}

View File

@ -0,0 +1,137 @@
#!/bin/sh
# This script creates the mysql data directory during first service start.
# In subsequent starts, it does nothing much.
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
# Returns content of the specified directory
# If listing files fails, fake-file is returned so which means
# we'll behave like there was some data initialized
# @param <dir> datadir
ls_check_datadir ()
{
ls -A "$1" 2>/dev/null
test $? -eq 0 || echo "fake-file"
}
# Checks whether datadir should be initialized
# @param <dir> datadir
should_initialize ()
{
case `ls_check_datadir "$1"` in
""|lost+found|*.err) true ;;
*) false ;;
esac
}
# If two args given first is user, second is group
# otherwise the arg is the systemd service file
if [ "$#" -eq 2 ]
then
myuser="$1"
mygroup="$2"
else
# Absorb configuration settings from the specified systemd service file,
# or the default service if not specified
SERVICE_NAME="$1"
if [ x"$SERVICE_NAME" = x ]
then
SERVICE_NAME=@DAEMON_NAME@.service
fi
myuser=`systemctl show -p User "${SERVICE_NAME}" |
sed 's/^User=//'`
if [ x"$myuser" = x ]
then
myuser=mysql
fi
mygroup=`systemctl show -p Group "${SERVICE_NAME}" |
sed 's/^Group=//'`
if [ x"$mygroup" = x ]
then
mygroup=mysql
fi
fi
# Set up the errlogfile with appropriate permissions
touch "$errlogfile"
ret=$?
# Provide some advice if the log file cannot be touched
if [ $ret -ne 0 ] ; then
errlogdir=$(dirname $errlogfile)
if ! [ -d "$errlogdir" ] ; then
echo "The directory $errlogdir does not exist."
elif [ -f "$errlogfile" ] ; then
echo "The log file $errlogfile cannot be touched, please, fix its permissions."
else
echo "The log file $errlogfile could not be created."
fi
echo "The daemon will be run under $myuser:$mygroup"
exit 1
fi
chown "$myuser:$mygroup" "$errlogfile"
chmod 0640 "$errlogfile"
[ -x /sbin/restorecon ] && /sbin/restorecon "$errlogfile"
# Make the data directory if doesn't exist or empty
if should_initialize "$datadir" ; then
# First, make sure $datadir is there with correct permissions
# (note: if it's not, and we're not root, this'll fail ...)
if [ ! -e "$datadir" -a ! -h "$datadir" ]
then
mkdir -p "$datadir" || exit 1
fi
chown "$myuser:$mygroup" "$datadir"
chmod 0755 "$datadir"
[ -x /sbin/restorecon ] && /sbin/restorecon "$datadir"
# Now create the database
echo "Initializing @NICE_PROJECT_NAME@ database"
# Avoiding deletion of files not created by mysql_install_db is
# guarded by time check and sleep should help work-arounded
# potential issues on systems with 1 second resolution timestamps
# https://bugzilla.redhat.com/show_bug.cgi?id=1335849#c19
INITDB_TIMESTAMP=`LANG=C date -u`
sleep 1
@bindir@/mysql_install_db --rpm --datadir="$datadir" --user="$myuser"
ret=$?
if [ $ret -ne 0 ] ; then
echo "Initialization of @NICE_PROJECT_NAME@ database failed." >&2
echo "Perhaps @sysconfdir@/my.cnf is misconfigured or there is some problem with permissions of $datadir." >&2
# Clean up any partially-created database files
if [ ! -e "$datadir/mysql/user.frm" ] && [ -d "$datadir" ] ; then
echo "Initialization of @NICE_PROJECT_NAME@ database was not finished successfully." >&2
echo "Files created so far will be removed." >&2
find "$datadir" -mindepth 1 -maxdepth 1 -newermt "$INITDB_TIMESTAMP" \
-not -name "lost+found" -exec rm -rf {} +
if [ $? -ne 0 ] ; then
echo "Removing of created files was not successfull." >&2
echo "Please, clean directory $datadir manually." >&2
fi
else
echo "However, part of data has been initialized and those will not be removed." >&2
echo "Please, clean directory $datadir manually." >&2
fi
exit $ret
fi
# upgrade does not need to be run on a fresh datadir
echo "@VERSION@-MariaDB" >"$datadir/mysql_upgrade_info"
# In case we're running as root, make sure files are owned properly
chown -R "$myuser:$mygroup" "$datadir"
else
if [ -d "$datadir/mysql/" ] ; then
# mysql dir exists, it seems data are initialized properly
echo "Database @NICE_PROJECT_NAME@ is probably initialized in $datadir already, nothing is done."
echo "If this is not the case, make sure the $datadir is empty before running `basename $0`."
else
# if the directory is not empty but mysql/ directory is missing, then
# print error and let user to initialize manually or empty the directory
echo "Database @NICE_PROJECT_NAME@ is not initialized, but the directory $datadir is not empty, so initialization cannot be done."
echo "Make sure the $datadir is empty before running `basename $0`."
exit 1
fi
fi
exit 0

View File

@ -0,0 +1,58 @@
#!/bin/sh
# Some useful functions used in other MySQL helper scripts
# This scripts defines variables datadir, errlogfile, socketfile
export LC_ALL=C
# extract value of a MySQL option from config files
# Usage: get_mysql_option VARNAME DEFAULT SECTION [ SECTION, ... ]
# result is returned in $result
# We use my_print_defaults which prints all options from multiple files,
# with the more specific ones later; hence take the last match.
get_mysql_option(){
if [ $# -ne 3 ] ; then
echo "get_mysql_option requires 3 arguments: section option default_value"
return
fi
sections="$1"
option_name="$2"
default_value="$3"
result=`@bindir@/my_print_defaults $sections | sed -n "s/^--${option_name}=//p" | tail -n 1`
if [ -z "$result" ]; then
# not found, use default
result="${default_value}"
fi
}
# Defaults here had better match what mysqld_safe will default to
# The option values are generally defined on three important places
# on the default installation:
# 1) default values are hardcoded in the code of mysqld daemon or
# mysqld_safe script
# 2) configurable values are defined in @sysconfdir@/my.cnf
# 3) default values for helper scripts are specified bellow
# So, in case values are defined in my.cnf, we need to get that value.
# In case they are not defined in my.cnf, we need to get the same value
# in the daemon, as in the helper scripts. Thus, default values here
# must correspond with values defined in mysqld_safe script and source
# code itself.
server_sections="mysqld_safe mysqld server mysqld-@MAJOR_VERSION@.@MINOR_VERSION@ mariadb mariadb-@MAJOR_VERSION@.@MINOR_VERSION@ client-server"
get_mysql_option "$server_sections" datadir "@MYSQL_DATADIR@"
datadir="$result"
# if there is log_error in the my.cnf, my_print_defaults still
# returns log-error
# log-error might be defined in mysqld_safe and mysqld sections,
# the former has bigger priority
get_mysql_option "$server_sections" log-error "$datadir/`uname -n`.err"
errlogfile="$result"
get_mysql_option "$server_sections" socket "@MYSQL_UNIX_ADDR@"
socketfile="$result"
get_mysql_option "$server_sections" pid-file "$datadir/`uname -n`.pid"
pidfile="$result"

View File

@ -0,0 +1,45 @@
#!/bin/sh
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
# This script waits for mysqld to be ready to accept connections
# (which can be many seconds or even minutes after launch, if there's
# a lot of crash-recovery work to do).
# Running this as ExecStartPost is useful so that services declared as
# "After mysqld" won't be started until the database is really ready.
if [ $# -ne 1 ] ; then
echo "You need to pass daemon pid as an argument for this script."
exit 20
fi
# Service file passes us the daemon's PID (actually, mysqld_safe's PID)
daemon_pid="$1"
# Wait for the server to come up or for the mysqld process to disappear
ret=0
while /bin/true; do
# Check process still exists
if ! [ -d "/proc/${daemon_pid}" ] ; then
ret=1
break
fi
RESPONSE=`@bindir@/mysqladmin --no-defaults --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
mret=$?
if [ $mret -eq 0 ] ; then
break
fi
# exit codes 1, 11 (EXIT_CANNOT_CONNECT_TO_SERVICE) are expected,
# anything else suggests a configuration error
if [ $mret -ne 1 -a $mret -ne 11 ]; then
echo "Cannot check for @NICE_PROJECT_NAME@ Daemon startup because of mysqladmin failure." >&2
ret=$mret
break
fi
# "Access denied" also means the server is alive
echo "$RESPONSE" | grep -q "Access denied for user" && break
sleep 1
done
exit $ret

View File

@ -0,0 +1,36 @@
#!/bin/sh
source "`dirname ${BASH_SOURCE[0]}`/mysql-scripts-common"
# This script waits for mysqld to be properly stopped
# (which can be many seconds in some large load).
# Running this as ExecStopPost is useful so that starting which is done
# as part of restart doesn't see the former process still running.
# Wait for the server to properly end the main server
ret=0
TIMEOUT=60
SECONDS=0
if ! [ -f "$pidfile" ]; then
exit 0
fi
MYSQLPID=`cat "$pidfile" 2>/dev/null`
if [ -z "$MYSQLPID" ] ; then
exit 2
fi
while /bin/true; do
# Check process still exists
if ! [ -d "/proc/${MYSQLPID}" ] ; then
break
fi
if [ $SECONDS -gt $TIMEOUT ] ; then
ret=3
break
fi
sleep 1
done
exit $ret

View File

@ -0,0 +1,186 @@
#!/bin/sh
#
# @DAEMON_NAME@ This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 64 36
# description: MySQL database server.
# processname: mysqld
# config: @sysconfdir@/my.cnf
# pidfile: /var/run/@DAEMON_NAME@/@DAEMON_NAME@.pid
### BEGIN INIT INFO
# Provides: mysqld
# Required-Start: $local_fs $remote_fs $network $named $syslog $time
# Required-Stop: $local_fs $remote_fs $network $named $syslog $time
# Short-Description: start and stop MySQL server
# Description: MySQL database server
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
exec="@bindir@/mysqld_safe"
prog="@DAEMON_NAME@"
# Set timeouts here so they can be overridden from @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@
STARTTIMEOUT=300
STOPTIMEOUT=60
# User and group the daemon will run under
MYUSER=mysql
MYGROUP=mysql
# Edit the following file in order to re-write some of the environment
# variables defined above, like $STARTTIMEOUT, $STOPTIMEOUT, $exec
[ -e @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@ ] && . @sysconfdir@/sysconfig/@DAEMON_NO_PREFIX@
lockfile=/var/lock/subsys/$prog
# get options from my.cnf
source "@libexecdir@/mysql-scripts-common"
start(){
[ -x $exec ] || exit 5
# check permissions
if ! touch $(dirname $socketfile) &>/dev/null ; then
action $"Starting $prog: " /bin/false
return 4
fi
# check to see if it's already running
MYSQLDRUNNING=0
if [ -f "$pidfile" ]; then
MYSQLPID=`cat "$pidfile" 2>/dev/null`
if [ -n "$MYSQLPID" ] && [ -d "/proc/$MYSQLPID" ] ; then
MYSQLDRUNNING=1
fi
fi
RESPONSE=`@bindir@/mysqladmin --socket="$socketfile" --user=UNKNOWN_MYSQL_USER ping 2>&1`
if [ $MYSQLDRUNNING = 1 ] && [ $? = 0 ]; then
# already running, do nothing
action $"Starting $prog: " /bin/true
ret=0
elif [ $MYSQLDRUNNING = 1 ] && echo "$RESPONSE" | grep -q "Access denied for user"
then
# already running, do nothing
action $"Starting $prog: " /bin/true
ret=0
else
@libexecdir@/mysql-prepare-db-dir $MYUSER $MYGROUP || return 4
@libexecdir@/mysql-check-socket || return 1
# Pass all the options determined above, to ensure consistent behavior.
# In many cases mysqld_safe would arrive at the same conclusions anyway
# but we need to be sure. (An exception is that we don't force the
# log-error setting, since this script doesn't really depend on that,
# and some users might prefer to configure logging to syslog.)
# Note: set --basedir to prevent probes that might trigger SELinux
# alarms, per bug #547485
$exec --datadir="$datadir" --socket="$socketfile" \
--pid-file="$pidfile" \
--basedir=@prefix@ --user=$MYUSER >/dev/null 2>&1 &
safe_pid=$!
# Wait until the daemon is up
@libexecdir@/mysql-wait-ready "$safe_pid"
ret=$?
if [ $ret -eq 0 ]; then
action $"Starting $prog: " /bin/true
chmod o+r $pidfile >/dev/null 2>&1
touch $lockfile
else
action $"Starting $prog: " /bin/false
fi
fi
return $ret
}
stop(){
if [ ! -f "$pidfile" ]; then
# not running; per LSB standards this is "ok"
action $"Stopping $prog: " /bin/true
return 0
fi
MYSQLPID=`cat "$pidfile" 2>/dev/null`
if [ -n "$MYSQLPID" ]; then
if ! [ -d "/proc/$MYSQLPID" ] ; then
# process doesn't run anymore
action $"Stopping $prog: " /bin/true
return 0
fi
/bin/kill "$MYSQLPID" >/dev/null 2>&1
ret=$?
if [ $ret -eq 0 ]; then
TIMEOUT="$STOPTIMEOUT"
while [ $TIMEOUT -gt 0 ]; do
/bin/kill -0 "$MYSQLPID" >/dev/null 2>&1 || break
sleep 1
let TIMEOUT=${TIMEOUT}-1
done
if [ $TIMEOUT -eq 0 ]; then
echo "Timeout error occurred trying to stop MySQL Daemon."
ret=1
action $"Stopping $prog: " /bin/false
else
rm -f $lockfile
rm -f "$socketfile"
action $"Stopping $prog: " /bin/true
fi
else
# kill command failed, probably insufficient permissions
action $"Stopping $prog: " /bin/false
ret=4
fi
else
# failed to read pidfile, probably insufficient permissions
action $"Stopping $prog: " /bin/false
ret=4
fi
return $ret
}
restart(){
stop
start
}
condrestart(){
[ -e $lockfile ] && restart || :
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p "$pidfile" $prog
;;
restart)
restart
;;
condrestart|try-restart)
condrestart
;;
reload)
exit 3
;;
force-reload)
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -0,0 +1,70 @@
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service",
# containing
# .include /usr/lib/systemd/system/@DAEMON_NAME@.service
# ...make your changes here...
# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf",
# which doesn't need to include ".include" call and which will be parsed
# after the file @DAEMON_NAME@.service itself is parsed.
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
# For example, if you want to increase mysql's open-files-limit to 10000,
# you need to increase systemd's LimitNOFILE setting, so create a file named
# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing:
# [Service]
# LimitNOFILE=10000
# Note: /usr/lib/... is recommended in the .include line though /lib/...
# still works.
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
# Use [mysqld.INSTANCENAME] as sections in my.cnf to configure this instance.
[Unit]
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
After=syslog.target
After=network.target
[Service]
Type=notify
User=mysql
Group=mysql
ExecStartPre=@libexecdir@/mysql-check-socket
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart=@libexecdir@/mysqld --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
ExecStartPost=@libexecdir@/mysql-check-upgrade
ExecStopPost=@libexecdir@/mysql-wait-stop
# Setting this to true can break replication and the Type=notify settings
# See also bind-address mysqld option.
PrivateNetwork=false
KillMode=process
KillSignal=SIGTERM
# Don't want to see an automated SIGKILL ever
SendSIGKILL=no
# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=on-abort
RestartSec=5s
UMask=007
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,3 @@
# Do not edit this file.
# To override this, put /etc/tmpfiles.d/mariadb.conf instead.
d @PID_FILE_DIR@ 0755 mysql mysql -

View File

@ -0,0 +1,77 @@
# Multi instance version of mariadb. For if you run mutiple verions at once.
# Also used for @DAEMON_NAME@@bootstrap to bootstrap Galera.
#
# To use multi instance variant, use [mysqld.INSTANCENAME] as sections in my.cnf
# and start the service via:
# systemctl start @DAEMON_NAME@@{instancename}.server
#
# It's not recommended to modify this file in-place, because it will be
# overwritten during package upgrades. If you want to customize, the
# best way is to create a file "/etc/systemd/system/@DAEMON_NAME@.service",
# containing
# .include /usr/lib/systemd/system/@DAEMON_NAME@.service
# ...make your changes here...
# or create a file "/etc/systemd/system/@DAEMON_NAME@.service.d/foo.conf",
# which doesn't need to include ".include" call and which will be parsed
# after the file @DAEMON_NAME@.service itself is parsed.
#
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
# For example, if you want to increase mysql's open-files-limit to 10000,
# you need to increase systemd's LimitNOFILE setting, so create a file named
# "/etc/systemd/system/@DAEMON_NAME@.service.d/limits.conf" containing:
# [Service]
# LimitNOFILE=10000
# Note: /usr/lib/... is recommended in the .include line though /lib/...
# still works.
# Don't forget to reload systemd daemon after you change unit configuration:
# root> systemctl --system daemon-reload
# Use [mysqld.INSTANCENAME] as sections in my.cnf to configure this instance.
[Unit]
Description=@NICE_PROJECT_NAME@ @MAJOR_VERSION@.@MINOR_VERSION@ database server
After=syslog.target
After=network.target
[Service]
Type=notify
User=mysql
Group=mysql
ExecStartPre=@libexecdir@/mysql-check-socket
ExecStartPre=@libexecdir@/mysql-prepare-db-dir %n
# MYSQLD_OPTS here is for users to set in /etc/systemd/system/@DAEMON_NAME@@.service.d/MY_SPECIAL.conf
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
# per bug #547485
ExecStart=@libexecdir@/mysqld --defaults-group-suffix=.%I --basedir=@prefix@ $MYSQLD_OPTS $_WSREP_NEW_CLUSTER
ExecStartPost=@libexecdir@/mysql-check-upgrade
ExecStopPost=@libexecdir@/mysql-wait-stop
# Setting this to true can break replication and the Type=notify settings
# See also bind-address mysqld option.
PrivateNetwork=false
KillMode=process
KillSignal=SIGTERM
# Don't want to see an automated SIGKILL ever
SendSIGKILL=no
# Restart crashed server only, on-failure would also restart, for example, when
# my.cnf contains unknown option
Restart=on-abort
RestartSec=5s
UMask=007
# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300
# Place temp files in a secure directory, not /tmp
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,26 @@
#! /bin/sh
#
# Wrapper script for mysql_config to support multilib
#
# This command respects setarch
bits=$(rpm --eval %__isa_bits)
case $bits in
32|64) status=known ;;
*) status=unknown ;;
esac
if [ "$status" = "unknown" ] ; then
echo "$0: error: command 'rpm --eval %__isa_bits' returned unknown value: $bits"
exit 1
fi
if [ -x @bindir@/mysql_config-$bits ] ; then
@bindir@/mysql_config-$bits "$@"
else
echo "$0: error: needed binary: @bindir@/mysql_config-$bits is missing"
exit 1
fi

View File

@ -0,0 +1,8 @@
main.partition_exchange : #1399847
main.analyze_stmt_orderby : #1399847
main.explain_json_innodb : #1399847
main.explain_json_format_partitions : #1399847
main.analyze_format_json : #1399847
main.explain_json : #1399847
main.subselect_cache : #1399847
main.type_year : #1399847

View File

@ -0,0 +1,9 @@
main.userstat : #1399847
main.multi_update : #1399847
main.set_statement_notembedded_binlog : #1399847
main.ssl_7937 : #1399847
main.ssl_crl_clients : #1399847
main.ssl_cert_verify : #1399847
perfschema.nesting : #1399847
perfschema.socket_summary_by_event_name_func : #1399847
perfschema.socket_summary_by_instance_func : #1399847

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff