/usr/share/tripleo-image-elements/mysql/install.d/10-mysql is in python-tripleo-image-elements 0.7.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #!/bin/bash
# Install controller base requiered packages
set -e
set -o xtrace
if [ "$(dib-init-system)" = "upstart" ] ; then
install $(dirname $0)/mysql-set-server-id.upstart /etc/init/mysql-set-server-id.conf
else
echo WARNING: server-id will not be set on systems that boot this image!
fi
install-packages libaio1 pv rsync
percona_pkgdir=Percona-XtraDB-Cluster
# Adapted from mysql ref manual
# http://dev.mysql.com/doc/refman/5.6/en/binary-installation.html
groupadd mysql
useradd -r -g mysql mysql
cd /usr/local
ln -s /usr/local/$percona_pkgdir mysql
cd mysql
chown -R mysql:mysql .
install -o root -g root -m 0755 support-files/mysql.server /etc/init.d/mysql
install -o root -g root -m 0755 bin/mysql /usr/local/bin
install -o root -g root -m 0755 bin/mysqld /usr/local/bin
sed -i -e 's,^#\!/bin/sh$,#\!/bin/bash,' /etc/init.d/mysql
sed -i -e 's,^basedir=$,basedir=/usr/local/mysql,' /etc/init.d/mysql
sed -i -e 's,^datadir=$,datadir=/mnt/state/var/lib/mysql,' /etc/init.d/mysql
# Templates write the configs into /mnt/state. However, MySQL makes it very
# difficult not to use this as the directory for configs.
rm -rf /etc/mysql
ln -s /mnt/state/etc/mysql /etc/mysql
if [ -e /etc/apparmor.d/usr.sbin.mysqld ] ; then
sed -i -e 's,/var/lib/mysql/,/mnt/state/var/lib/mysql/,g' /etc/apparmor.d/usr.sbin.mysqld
sed -i -e 's,/var/log/mysql/,/mnt/state/var/log/mysql/,g' /etc/apparmor.d/usr.sbin.mysqld
sed -i -e 's,/etc/mysql/,/mnt/state/etc/mysql/,g' /etc/apparmor.d/usr.sbin.mysqld
fi
if [ -e /etc/init/mysql.conf ]; then
sed -i -e 's,/var/lib/mysql/,/mnt/state/var/lib/mysql/,g' /etc/init/mysql.conf
fi
# Fedora/RHEL install /etc/my.cnf but we do not want any unmanaged configs
rm -f /etc/my.cnf
# On openSUSE /var/lib/mysql is not part of the mariadb packages.
[ -d /var/lib/mysql ] || install -d -o mysql -g root -m 0700 /var/lib/mysql
register-state-path /var/lib/mysql
# We need to setup the directory with appropriate permissions and then
# the first time we boot a particular state partition we rsync this in.
[ -d /var/log/mysql ] || install -d -o root -g mysql -m 0775 /var/log/mysql
register-state-path --leave-symlink /var/log/mysql
DISTRO=`lsb_release -si` || true
if [[ "RedHatEnterpriseServer CentOS Fedora" =~ "$DISTRO" ]]; then
# mysql clients on redhat expect the socket at /var/lib/mysql/mysql.sock
mkdir -p /var/lib/mysql
ln -s /var/run/mysqld/mysqld.sock /var/lib/mysql/mysql.sock
fi
|