From d4f236d852479ef1b930f73a85084aa5bbc2d2a5 Mon Sep 17 00:00:00 2001 From: gobo72 Date: Fri, 26 Aug 2011 01:10:44 +0000 Subject: [PATCH] =?utf8?q?D=C3=A9plac=C3=A9=20script=20de=20configuration?= =?utf8?q?=20MySQL=20du=20stage5=20vers=20stage3.=20Le=20script=20de=20con?= =?utf8?q?figuration=20est=20maintenant=20install=C3=A9=20dans=20/usr/loca?= =?utf8?q?l/bin=20au=20lieu=20d'=C3=AAtre=20appel=C3=A9=20automatiquement?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- stage3/INSTALL | 6 +++++ stage3/misc/hv-config-mysql | 44 +++++++++++++++++++++++++++++++++++++ stage3/pkg/mysql | 3 +++ stage5/post-install | 43 ------------------------------------ 4 files changed, 53 insertions(+), 43 deletions(-) create mode 100755 stage3/misc/hv-config-mysql diff --git a/stage3/INSTALL b/stage3/INSTALL index d651941..cc0d8db 100644 --- a/stage3/INSTALL +++ b/stage3/INSTALL @@ -5,3 +5,9 @@ Installation 1. Type: $> sudo make + +2. Reboot. + +After rebooting, and if you have installed MYSQL, configure MySQL +with this script: + /usr/local/bin/hv-config-mysql diff --git a/stage3/misc/hv-config-mysql b/stage3/misc/hv-config-mysql new file mode 100755 index 0000000..ec2e774 --- /dev/null +++ b/stage3/misc/hv-config-mysql @@ -0,0 +1,44 @@ +#!/bin/bash +set -o errexit + +# Script de configuration pour MySQL + +READ_VALID="no" + +while [ "${READ_VALID}" = "no" ]; do + echo "Do you want to set MySQL root password? (y/n): " + read SET_MYSQL_ROOT_PASS + + if [ "${SET_MYSQL_ROOT_PASS}" = "y" -o "${SET_MYSQL_ROOT_PASS}" = "n" ]; then + READ_VALID="yes" + else + echo "Error, answer y or n" + fi +done + +if [ "${SET_MYSQL_ROOT_PASS}" = "y" ]; then + # Make sure MySQL is started + /etc/rc.d/init.d/mysql start + + PASS_MATCH="no" + + while [ "${PASS_MATCH}" = "no" ]; do + echo -n "Enter new MySQL root password: " >&2 + read PASS1 + echo -n "Re-enter password to confirm : " >&2 + read PASS2 + + if [ "${PASS1}" != "${PASS2}" ]; then + echo "Error, passwords don't match" + else + PASS_MATCH="yes" + fi + done + + mysqladmin -u root password ${PASS1} + echo "MySQL root password set." + + echo "Shutting down MySQL server:" +fi + +exit $? diff --git a/stage3/pkg/mysql b/stage3/pkg/mysql index aef7651..47163bb 100644 --- a/stage3/pkg/mysql +++ b/stage3/pkg/mysql @@ -52,4 +52,7 @@ hvbuild_post() # Addition to /etc/ld.so.conf string_add "/usr/lib/mysql" /etc/ld.so.conf + + # Install Hv configuration script + install -m644 ${SCRDIR}/misc/hv-config-mysql /usr/local/bin } diff --git a/stage5/post-install b/stage5/post-install index f9dbdb3..e5adb97 100755 --- a/stage5/post-install +++ b/stage5/post-install @@ -3,49 +3,6 @@ source ../functions/main if [ "x${INST_TYPE}" = "xserver" -o "x${INST_TYPE}" = "xltsp-server" ]; then - - ######################################### - # MySQL - ######################################### - READ_VALID="no" - - while [ "${READ_VALID}" = "no" ]; do - echo "Do you want to set MySQL root password? (y/n): " - read SET_MYSQL_ROOT_PASS - - if [ "${SET_MYSQL_ROOT_PASS}" = "y" -o "${SET_MYSQL_ROOT_PASS}" = "n" ]; then - READ_VALID="yes" - else - echo "Error, answer y or n" - fi - done - - if [ "${SET_MYSQL_ROOT_PASS}" = "y" ]; then - # Further configuration requires that the MySQL server be running: - mysqld_safe --user=mysql 2>&1 >/dev/null & - - PASS_MATCH="no" - - while [ "${PASS_MATCH}" = "no" ]; do - echo -n "Enter new MySQL root password: " >&2 - read PASS1 - echo -n "Re-enter password to confirm : " >&2 - read PASS2 - - if [ "${PASS1}" != "${PASS2}" ]; then - echo "Error, passwords don't match" - else - PASS_MATCH="yes" - fi - done - - mysqladmin -u root password ${PASS1} - echo "MySQL root password set." - - echo "Shutting down MySQL server:" - # Configuration of the server is now finished. Shuting down the server. - mysqladmin -p shutdown - fi ######################################### # Apache -- 2.20.1