From a699d0d06feeb1859efea16dd6b3df17901a1bc5 Mon Sep 17 00:00:00 2001 From: startxfr Date: Thu, 20 Nov 2014 03:17:46 +0100 Subject: modif des services et ajout de memcache, apache et nodejs --- Services/mariadb/mariadb_run.sh | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Services/mariadb/mariadb_run.sh (limited to 'Services/mariadb/mariadb_run.sh') diff --git a/Services/mariadb/mariadb_run.sh b/Services/mariadb/mariadb_run.sh new file mode 100644 index 0000000..b5b1421 --- /dev/null +++ b/Services/mariadb/mariadb_run.sh @@ -0,0 +1,56 @@ +#!/bin/bash +ln -s /dev/stderr /var/log/mysql/mysqld.log +if [ ! -f /var/lib/mysql/.created ]; then + function wait_for_mysqld_start { + for i in {1..30}; do + if echo 'select 1' | mysql -u root > /dev/null 2>&1; then + return 0 + fi + sleep 1 + done + + echo "MariaDB did not start in time" + exit 1 + } + + + + password=${DB_PASSWORD:-password} + dbname=${DB_NAME:-master} + + /usr/bin/mysql_install_db -u mysql + + /usr/libexec/mysqld & + pid=$! + + wait_for_mysqld_start + + echo "Creating database $dbname ..." + + sql=$(cat <