tacker/devstack/local.sh.mysql_fix
rajat29 ab6a2557d4 Fix to use . to source script files
Adhering to coding conventions. Refer to ``Code conventions`` at
https://docs.openstack.org/contributor-guide/ for details.
When you have to source a script file, for example, a credentials file
to gain access to user-only or admin-only CLI commands, use . instead of source.
https://docs.openstack.org/contributor-guide/writing-style/code-conventions.html

Change-Id: I267e2282345b5cb97eba8d0c844417354ec24f4c
2017-09-11 15:21:20 +05:30

47 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
#IMPORTANT: THIS FIX IS APPLICABLE ONLY FOR DEVSTACK KILO RELEASE
#For devstack master branch, the fix is already provided upstream
# `local.sh.mysql_fixup`` for user-configurable tasks to run automatically
# at the successful conclusion of ``stack.sh``.
# NOTE: Copy this file to the root DevStack directory for it to work properly.
# Keep track of the DevStack directory
TOP_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
. $TOP_DIR/functions
# Use openrc + stackrc + localrc for settings
. $TOP_DIR/stackrc
# Destination path for installation ``DEST``
DEST=${DEST:-/opt/stack}
echo_summary "Configuring additional parameters for mysql database"
if is_service_enabled mysql; then
if is_ubuntu; then
my_conf=/etc/mysql/my.cnf
mysql=mysql
elif is_suse || is_oraclelinux; then
my_conf=/etc/my.cnf
mysql=mysql
elif is_fedora; then
mysql=mariadb
my_conf=/etc/my.cnf
else
exit_distro_not_supported "mysql configuration"
fi
sudo bash -c ". $TOP_DIR/functions && \
iniset $my_conf mysqld max_connections 1024 && \
iniset $my_conf mysqld query_cache_type OFF && \
iniset $my_conf mysqld query_cache_size 0"
restart_service $mysql
fi