Disassembler
ce325cf3d0
- Bump basic OS to Alpine 3.9 - Restructure repo and add layer versioning - Use JSON for all metadata - Merge abuild branch (but without abuild)
27 lines
655 B
Bash
Executable File
27 lines
655 B
Bash
Executable File
#!/bin/sh
|
|
set -ev
|
|
|
|
cd $(realpath $(dirname "${0}"))/install
|
|
|
|
# Create MariaDB instance
|
|
mkdir -p /srv/mariadb/conf /srv/mariadb/data
|
|
chown 3306:3306 /srv/mariadb/data
|
|
lxc-execute mariadb -- mysql_install_db --user=mysql
|
|
|
|
# Configure MariaDB
|
|
cp srv/mariadb/conf/my.cnf /srv/mariadb/conf/my.cnf
|
|
|
|
# Enable query logging. Only if the DEBUG environment variable is set
|
|
if [ ${DEBUG:-0} -eq 1 ]; then
|
|
sed -i 's/#general_log/general_log/g' /srv/mariadb/conf/my.cnf
|
|
fi
|
|
|
|
# Install service
|
|
cp etc/init.d/mariadb /etc/init.d/mariadb
|
|
rc-update -u
|
|
|
|
# Configure MariaDB admin
|
|
service mariadb start
|
|
cat adminpwd.sql | lxc-attach mariadb -- mysql
|
|
service mariadb stop
|