From 990a9dcb717191f1daa5a573aa91e02e899a55e8 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 3 Oct 2019 21:28:43 +0200 Subject: [PATCH] Rework MariaDB --- lxc-services/mariadb/install.sh | 19 --------------- .../mariadb/install/etc/init.d/mariadb | 15 ------------ .../mariadb/install/srv/mariadb/conf/my.cnf | 24 ------------------- lxc-services/mariadb/lxcfile | 3 --- lxc-services/mariadb/uninstall.sh | 6 ----- 5 files changed, 67 deletions(-) delete mode 100755 lxc-services/mariadb/install.sh delete mode 100755 lxc-services/mariadb/install/etc/init.d/mariadb delete mode 100644 lxc-services/mariadb/install/srv/mariadb/conf/my.cnf delete mode 100755 lxc-services/mariadb/uninstall.sh diff --git a/lxc-services/mariadb/install.sh b/lxc-services/mariadb/install.sh deleted file mode 100755 index 76fe2f1..0000000 --- a/lxc-services/mariadb/install.sh +++ /dev/null @@ -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 diff --git a/lxc-services/mariadb/install/etc/init.d/mariadb b/lxc-services/mariadb/install/etc/init.d/mariadb deleted file mode 100755 index 0e3a0e8..0000000 --- a/lxc-services/mariadb/install/etc/init.d/mariadb +++ /dev/null @@ -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 -} diff --git a/lxc-services/mariadb/install/srv/mariadb/conf/my.cnf b/lxc-services/mariadb/install/srv/mariadb/conf/my.cnf deleted file mode 100644 index 5740333..0000000 --- a/lxc-services/mariadb/install/srv/mariadb/conf/my.cnf +++ /dev/null @@ -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 diff --git a/lxc-services/mariadb/lxcfile b/lxc-services/mariadb/lxcfile index a5338d5..40835e1 100644 --- a/lxc-services/mariadb/lxcfile +++ b/lxc-services/mariadb/lxcfile @@ -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 diff --git a/lxc-services/mariadb/uninstall.sh b/lxc-services/mariadb/uninstall.sh deleted file mode 100755 index 2cda801..0000000 --- a/lxc-services/mariadb/uninstall.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -ev - -# Remove service -rm -f /etc/init.d/mariadb -rc-update -u