Rework MariaDB
This commit is contained in:
parent
a8bca6727b
commit
990a9dcb71
@ -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
|
@ -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
|
||||
}
|
@ -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
|
@ -15,9 +15,6 @@ RUN EOF
|
||||
chown mysql:mysql /run/mysqld
|
||||
EOF
|
||||
|
||||
MOUNT FILE /srv/mariadb/conf/my.cnf etc/my.cnf
|
||||
MOUNT DIR /srv/mariadb/data var/lib/mysql
|
||||
|
||||
USER 3306 3306
|
||||
CMD mysqld
|
||||
READY test -e /run/mysqld/mysqld.sock
|
||||
|
@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -ev
|
||||
|
||||
# Remove service
|
||||
rm -f /etc/init.d/mariadb
|
||||
rc-update -u
|
Loading…
Reference in New Issue
Block a user