summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-05-09 13:24:52 +0200
committerSergei Golubchik <serg@mariadb.org>2017-05-09 13:24:52 +0200
commitc91ecf9e9bebf3cf2dafbd3193de4df94be09870 (patch)
treea9ab429c8e8a6a50c38557cbdd38d9612480f49c /scripts
parent2645bda5f20ab10bc26dc1cb69f91b5505c1faae (diff)
parentc92168fcd26aad35bd4cb5d65175e3545133f201 (diff)
downloadmariadb-git-c91ecf9e9bebf3cf2dafbd3193de4df94be09870.tar.gz
Merge branch '10.1' into 10.2
Revert commit db0917f68f, because the fix for MDEV-12696 is coming from 5.5 and 10.1 in this merge.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/galera_new_cluster.sh16
-rw-r--r--scripts/mysql_secure_installation.sh67
2 files changed, 64 insertions, 19 deletions
diff --git a/scripts/galera_new_cluster.sh b/scripts/galera_new_cluster.sh
index cf81bd0b95a..b873192cf31 100755
--- a/scripts/galera_new_cluster.sh
+++ b/scripts/galera_new_cluster.sh
@@ -5,6 +5,22 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
+if [ "${1}" == "-h" -o "${1}" == "--help" ]; then
+ cat <<EOF
+
+Usage: ${0}
+
+ The script galera_new_cluster is used to bootstrap new Galera Cluster,
+ when all the nodes are down. Run galera_new_cluster on the first node only.
+ On the remaining nodes simply run 'service @DAEMON_NAME@ start'.
+
+ For more information on Galera Cluster configuration and usage see:
+ https://mariadb.com/kb/en/mariadb/getting-started-with-mariadb-galera-cluster/
+
+EOF
+ exit 0
+fi
+
VERSION="@VERSION@@MYSQL_SERVER_SUFFIX@"
COMPILATION_COMMENT="@COMPILATION_COMMENT@"
diff --git a/scripts/mysql_secure_installation.sh b/scripts/mysql_secure_installation.sh
index 2c3b2f8dc8c..57e4d43dfad 100644
--- a/scripts/mysql_secure_installation.sh
+++ b/scripts/mysql_secure_installation.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2002, 2012, Oracle and/or its affiliates.
+# Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -194,6 +194,20 @@ set_echo_compat() {
esac
}
+validate_reply () {
+ ret=0
+ if [ -z "$1" ]; then
+ reply=y
+ return $ret
+ fi
+ case $1 in
+ y|Y|yes|Yes|YES) reply=y ;;
+ n|N|no|No|NO) reply=n ;;
+ *) ret=1 ;;
+ esac
+ return $ret
+}
+
prepare() {
touch $config $command
chmod 600 $config $command
@@ -407,15 +421,18 @@ echo "Setting the root password ensures that nobody can log into the MariaDB"
echo "root user without the proper authorisation."
echo
-if [ $hadpass -eq 0 ]; then
- echo $echo_n "Set root password? [Y/n] $echo_c"
-else
- echo "You already have a root password set, so you can safely answer 'n'."
- echo
- echo $echo_n "Change the root password? [Y/n] $echo_c"
-fi
+while true ; do
+ if [ $hadpass -eq 0 ]; then
+ echo $echo_n "Set root password? [Y/n] $echo_c"
+ else
+ echo "You already have a root password set, so you can safely answer 'n'."
+ echo
+ echo $echo_n "Change the root password? [Y/n] $echo_c"
+ fi
+ read reply
+ validate_reply $reply && break
+done
-read reply
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -439,9 +456,11 @@ echo "go a bit smoother. You should remove them before moving into a"
echo "production environment."
echo
-echo $echo_n "Remove anonymous users? [Y/n] $echo_c"
-
-read reply
+while true ; do
+ echo $echo_n "Remove anonymous users? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -457,9 +476,11 @@ echo
echo "Normally, root should only be allowed to connect from 'localhost'. This"
echo "ensures that someone cannot guess at the root password from the network."
echo
-
-echo $echo_n "Disallow root login remotely? [Y/n] $echo_c"
-read reply
+while true ; do
+ echo $echo_n "Disallow root login remotely? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -477,8 +498,12 @@ echo "access. This is also intended only for testing, and should be removed"
echo "before moving into a production environment."
echo
-echo $echo_n "Remove test database and access to it? [Y/n] $echo_c"
-read reply
+while true ; do
+ echo $echo_n "Remove test database and access to it? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
+
if [ "$reply" = "n" ]; then
echo " ... skipping."
else
@@ -495,8 +520,12 @@ echo "Reloading the privilege tables will ensure that all changes made so far"
echo "will take effect immediately."
echo
-echo $echo_n "Reload privilege tables now? [Y/n] $echo_c"
-read reply
+while true ; do
+ echo $echo_n "Reload privilege tables now? [Y/n] $echo_c"
+ read reply
+ validate_reply $reply && break
+done
+
if [ "$reply" = "n" ]; then
echo " ... skipping."
else