[DRE-commits] [ruby-em-synchrony] 01/01: script to start mysqld

Praveen Arimbrathodiyil praveen at moszumanska.debian.org
Thu Apr 24 04:17:33 UTC 2014


This is an automated email from the git hooks/post-receive script.

praveen pushed a commit to branch master
in repository ruby-em-synchrony.

commit 0438c25e6f9147a8dee39f25e625e0e6ac14cff9
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date:   Thu Apr 24 09:46:46 2014 +0530

    script to start mysqld
---
 debian/start_mysqld_and_auto_install.sh | 41 +++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/debian/start_mysqld_and_auto_install.sh b/debian/start_mysqld_and_auto_install.sh
new file mode 100755
index 0000000..efcfa98
--- /dev/null
+++ b/debian/start_mysqld_and_auto_install.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# start_mysqld_and_auto_install.sh - starts an instance of mysqld before
+# auto_installing and running do_mysql's test suite. It is inspired by
+# debian/test_mysql.sh from libdbi-drivers source package.
+
+
+
+set -e
+
+MYTEMP_DIR=`mktemp -d`
+ME=`whoami`
+
+export MYSQL_UNIX_PORT=${MYTEMP_DIR}/mysql.sock
+DO_MYSQL_USER=root
+DO_MYSQL_PASS=
+DO_MYSQL_DBNAME=test
+DO_MYSQL_DATABASE=/${DO_MYSQL_DBNAME}
+
+mysql_install_db --no-defaults --datadir=${MYTEMP_DIR} --force --skip-name-resolve --user=${DO_MYSQL_USER}
+/usr/sbin/mysqld --no-defaults --user=${DO_MYSQL_USER} --socket=${MYSQL_UNIX_PORT} --datadir=${MYTEMP_DIR} --skip-networking &
+echo -n pinging mysqld.
+attempts=0
+while ! /usr/bin/mysqladmin --socket=${MYSQL_UNIX_PORT} ping ; do
+  sleep 3
+  attempts=$((attempts+1))
+  if [ ${attempts} -gt 10 ] ; then
+    echo "skipping test, mysql server could not be contacted after 30 seconds"
+    exit 0
+  fi
+done
+#mysql --socket=${MYSQL_UNIX_PORT} --execute "CREATE DATABASE ${DO_MYSQL_DBNAME};"
+mysql --socket=${MYSQL_UNIX_PORT} --execute "GRANT ALL PRIVILEGES ON ${DO_MYSQL_DBNAME}.* TO '${DO_MYSQL_USER}'@'localhost' IDENTIFIED BY '${DO_MYSQL_PASS}';"
+
+
+dh_auto_install
+
+/usr/bin/mysqladmin --socket=${MYSQL_UNIX_PORT} shutdown
+rm -rf ${MYTEMP_DIR}
+
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-em-synchrony.git



More information about the Pkg-ruby-extras-commits mailing list