SOURCES: mysql.init - pass to mysql_create_system_tables to prese...
glen
glen at pld-linux.org
Sat Mar 17 02:13:02 CET 2007
Author: glen Date: Sat Mar 17 01:13:02 2007 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- pass to mysql_create_system_tables to preserver previous init compatability (do we need it? i don't and only makes additional requirement to setup hostname inside vservers)
---- Files affected:
SOURCES:
mysql.init (1.113 -> 1.114)
---- Diffs:
================================================================
Index: SOURCES/mysql.init
diff -u SOURCES/mysql.init:1.113 SOURCES/mysql.init:1.114
--- SOURCES/mysql.init:1.113 Fri Mar 9 14:50:45 2007
+++ SOURCES/mysql.init Sat Mar 17 02:12:56 2007
@@ -347,6 +347,25 @@
busy
TMP=/tmp TMPDIR=/tmp
+ # Install this in the user table, too
+ hostname="`hostname --fqdn 2> /dev/null | tr -d '[:space:]'`"
+ [ -z "$hostname" ] && hostname="localhost-unknown"
+
+ # Check if hostname is valid
+ if [ -z "$hostname" ]; then
+ deltext
+ fail
+ nls "Sorry, the host name is not configured."
+ nls "Please configure the 'hostname' command to return a hostname."
+ exit 1
+ elif ! hostname -i >/dev/null 2>&1; then
+ deltext
+ fail
+ nls "Sorry, the host '%s' could not be looked up." "$hostname"
+ nls "Please configure the 'hostname' command to return a correct hostname."
+ exit 1
+ fi
+
mkdir -p "$MYSQL_DATA_DIR"
# Using mysql:mysql for MYSQL_CLUSTER_DIR is creating SECURITY hole, root:root is proper
chown root:root "$MYSQL_CLUSTER_DIR"
@@ -371,7 +390,7 @@
cat > $MYSQL_DATA_DIR/mysql-init.sql <<-EOF
CREATE DATABASE mysql;
- $(/usr/sbin/mysql_create_system_tables real $MYSQL_DATA_DIR/mysql)
+ $(/usr/sbin/mysql_create_system_tables real $MYSQL_DATA_DIR/mysql "$hostname")
EOF
ok=0
@@ -387,6 +406,7 @@
This is done (after starting database; press enter when asked for password) with:
/usr/bin/mysqladmin -u mysql -S $MYSQL_SOCKET password 'password'
+/usr/bin/mysqladmin -h $hostname -u mysql -S $MYSQL_SOCKET password 'password'
/usr/bin/mysqladmin -u mysql_logrotate -S $MYSQL_SOCKET password 'password'
NOTE: mysql_logrotate password should be placed to $MYSQL_CONFIG in
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/mysql.init?r1=1.113&r2=1.114&f=u
More information about the pld-cvs-commit
mailing list