Add DIB MySQL element

Change-Id: If6a3bf8bc2c00f90efca025df6e3c0d6be0635b0
This commit is contained in:
IvanBerezovskiy 2013-08-23 17:24:06 +04:00 committed by Sergey Lukjanov
parent fa750f5a0e
commit 14560d749c
4 changed files with 37 additions and 0 deletions

2
elements/mysql/README.md Normal file
View File

@ -0,0 +1,2 @@
This element setups basic components of MySQL on Ubuntu and Fedora.
It is light version of original MySQL element (https://github.com/openstack/tripleo-image-elements/tree/master/elements/mysql).

View File

@ -0,0 +1,13 @@
#!/bin/sh
set -e
set -o xtrace
if [ $(lsb_release -is) = 'Fedora' ]; then
install-packages community-mysql community-mysql-libs community-mysql-server mysql-connector-java
mkdir -p /etc/mysql/conf.d
elif [ $(lsb_release -is) = 'Ubuntu' ]; then
install-packages mysql-server-5.5 mysql-client-5.5 libmysql-java
else
echo "Unknown distribution"
exit 1
fi
rm -rf /var/lib/mysql/ib_logfile*

View File

@ -0,0 +1,16 @@
#!/bin/bash
# Disable startup MySQL on boot in Ubuntu
# Service mysqld dones't start on boot in Fedora
if [ $(lsb_release -is) = 'Ubuntu' ]; then
if [ -e "/etc/init/mysql.conf" ]; then
sed -i "s/start on runlevel \[.*\]/start on never runlevel [2345]/g" /etc/init/mysql.conf
else
update-rc.d -f mysql remove
fi
fi
# Script for starting mysql
install -D -g root -o root -m 0755 $(dirname $0)/start-mysql.sh /opt/start-mysql.sh

View File

@ -0,0 +1,6 @@
#!/bin/bash
if [ $(lsb_release -is) = 'Ubuntu' ]; then
sudo service mysql start
elif [ $(lsb_release -is) = 'Fedora' ]; then
sudo service mysqld start
fi