diff options
| author | SamYaple <sam@yaple.net> | 2016-01-25 16:04:26 +0000 |
|---|---|---|
| committer | SamYaple <sam@yaple.net> | 2016-01-28 20:26:41 +0000 |
| commit | 7e2ce014316677af9b83c42745afe9e42f0c8709 (patch) | |
| tree | 82966cce82b64f55775cd72c23ef127b6cf9ec18 /docker | |
| parent | 42fc119658fd8a5f966e8658d6647ddee8837b99 (diff) | |
| download | kolla-7e2ce014316677af9b83c42745afe9e42f0c8709.tar.gz kolla-7e2ce014316677af9b83c42745afe9e42f0c8709.zip | |
Cleanup mariadb and make compatiable with mesos
There is no reason to have a hostname-unique pidfile in the container
as we currently have. This posed problems with kolla-mesos reusing
the same script. Since there is no reason for this pidfile to be
configurable in path _at_ _all_, we hardcode the path.
Additionally, we adjust the file perm change to only update the perms
on the folder if it is not already properly set.
This also incorperates a kolla-ansible file in the bootstrap process
which follows our other container techniques of using the idempotent
creation of a volume in the bootstrap process (see nova)
TrivialFix
Related-Bug: #1538136
Change-Id: I2380529fc7146a9603145cdc31e649cb8841f7dd
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/mariadb/extend_start.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/docker/mariadb/extend_start.sh b/docker/mariadb/extend_start.sh index dcbdac2ed..55e9ae4c9 100644 --- a/docker/mariadb/extend_start.sh +++ b/docker/mariadb/extend_start.sh @@ -4,7 +4,7 @@ function bootstrap_db { mysqld_safe --wsrep-new-cluster & # Wait for the mariadb server to be "Ready" before starting the security reset with a max timeout TIMEOUT=${DB_MAX_TIMEOUT:-60} - while [ ! -f ${DB_PID_FILE} ]; do + while [[ ! -f /var/lib/mysql/mariadb.pid ]]; do if [[ ${TIMEOUT} -gt 0 ]]; then let TIMEOUT-=1 sleep 1 @@ -18,7 +18,10 @@ function bootstrap_db { mysqladmin -uroot -p"${DB_ROOT_PASSWORD}" shutdown } -sudo chown mysql: /var/lib/mysql +# Only update permissions if permissions need to be updated +if [[ $(stat -c %U:%G /var/lib/mysql) != "mysql:mysql" ]]; then + sudo chown mysql: /var/lib/mysql +fi # This catches all cases of the BOOTSTRAP variable being set, including empty if [[ "${!KOLLA_BOOTSTRAP[@]}" ]] && [[ ! -e /var/lib/mysql/cluster.exists ]]; then |
