diff options
author | startxfr <clarue@startx.fr> | 2015-11-28 21:04:24 +0100 |
---|---|---|
committer | startxfr <clarue@startx.fr> | 2015-11-28 21:04:24 +0100 |
commit | 7b3b27e440b076f7a599555eaf963e719caab080 (patch) | |
tree | 1f6caa5506433de8850a66316abf1db80fc5ed01 /Services/mariadb/run.sh | |
parent | 59bbf66b7b1e4490694f2c5f732ddf9380acf053 (diff) | |
download | phpmyadmin-7b3b27e440b076f7a599555eaf963e719caab080.tar.gz phpmyadmin-7b3b27e440b076f7a599555eaf963e719caab080.tar.bz2 phpmyadmin-7b3b27e440b076f7a599555eaf963e719caab080.tar.xz phpmyadmin-7b3b27e440b076f7a599555eaf963e719caab080.zip |
start reshape of mysql container
Diffstat (limited to 'Services/mariadb/run.sh')
-rw-r--r-- | Services/mariadb/run.sh | 78 |
1 files changed, 74 insertions, 4 deletions
diff --git a/Services/mariadb/run.sh b/Services/mariadb/run.sh index a59a9af..cd22b99 100644 --- a/Services/mariadb/run.sh +++ b/Services/mariadb/run.sh @@ -1,14 +1,84 @@ #!/bin/bash source /bin/sx-lib.sh -source /bin/sx-httpd.sh + +function check_mariadb_environment { + check_environment + if [ ! -v SERVER_NAME ]; then + SERVER_NAME="localhost" + export SERVER_NAME + echo "! WARNING : environment var SERVER_NAME is missing..." + echo "! WARNING : auto-assigned value : $SERVER_NAME" + fi + if [ ! -v DOC_ROOT ]; then + DOC_ROOT="/data/apache" + export DOC_ROOT + fi + if [ ! -v APP_PATH ]; then + APP_PATH="/data/apache" + export APP_PATH + fi + if [ ! -v LOG_PATH ]; then + LOG_PATH="/data/logs/apache" + export LOG_PATH + fi +} + +function display_container_mariadb_header { + echo "+=====================================================" + echo "| Container : $HOSTNAME" + echo "| OS : $(</etc/redhat-release)" + echo "| Engine : " mysql -V + if [ -v CONTAINER_TYPE ]; then + echo "| Type : $CONTAINER_TYPE" + fi + if [ -v CONTAINER_INSTANCE ]; then + echo "| Instance : $CONTAINER_INSTANCE" + fi + if [ -v CONTAINER_SERVICE ]; then + echo "| Service : $CONTAINER_SERVICE" + fi + if [ -v CONTAINER_SERVICE ]; then + echo "| ServerName : $SERVER_NAME" + fi + if [ -v APP_PATH ]; then + echo "| Data path : $DATA_PATH" + fi + if [ -v LOG_PATH ]; then + echo "| Log path : $LOG_PATH" + fi + if [ -v LOADSQL_PATH ]; then + echo "| sql path : $LOADSQL_PATH" + fi + echo "+=====================================================" +} + + +# Begin configuration before starting daemonized process +# and start generating host keys +function begin_config { + echo "=> BEGIN MARIADB CONFIGURATION" +} + +# End configuration process just before starting daemon +function end_config { + echo "=> END MARIADB CONFIGURATION" +} + +# Start the mariadb server as a deamon and execute it inside +# the running shell +function start_daemon { + echo "=> Starting mariadb daemon ..." + display_container_started + exec mysqld_safe +} + if [[ "$0" == *"run.sh" && ! $1 = "" ]];then eval "$@"; fi -check_environment | tee -a $STARTUPLOG -check_httpd_environment | tee -a $STARTUPLOG -display_container_httpd_header | tee -a $STARTUPLOG +check_mariadb_environment | tee -a $STARTUPLOG +display_container_mariadb_header | tee -a $STARTUPLOG begin_config | tee -a $STARTUPLOG end_config | tee -a $STARTUPLOG display_container_started | tee -a $STARTUPLOG |