Rework MariaDB

This commit is contained in:
Disassembler 2019-10-03 21:28:43 +02:00
parent a8bca6727b
commit 990a9dcb71
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
5 changed files with 0 additions and 67 deletions

View File

@ -1,19 +0,0 @@
#!/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
cp srv/mariadb/conf/my.cnf /srv/mariadb/conf/my.cnf
lxc-execute mariadb -- mysql_install_db --user=mysql --datadir=/var/lib/mysql --auth-root-authentication-method=socket --skip-test-db
# 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

View File

@ -1,15 +0,0 @@
#!/sbin/openrc-run
description="MariaDB container"
start() {
lxc-start mariadb
}
start_post() {
ewaitfile 60 /var/lib/lxc/mariadb/delta0/run/mysqld/mysqld.sock
}
stop() {
lxc-stop mariadb
}

View File

@ -1,24 +0,0 @@
[mysqld]
skip-external-locking
skip-name-resolve
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
[mysqldump]
quick
max_allowed_packet = 1M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M

View File

@ -15,9 +15,6 @@ RUN EOF
chown mysql:mysql /run/mysqld chown mysql:mysql /run/mysqld
EOF EOF
MOUNT FILE /srv/mariadb/conf/my.cnf etc/my.cnf
MOUNT DIR /srv/mariadb/data var/lib/mysql
USER 3306 3306 USER 3306 3306
CMD mysqld CMD mysqld
READY test -e /run/mysqld/mysqld.sock READY test -e /run/mysqld/mysqld.sock

View File

@ -1,6 +0,0 @@
#!/bin/sh
set -ev
# Remove service
rm -f /etc/init.d/mariadb
rc-update -u