mariadb: new package

MariaDB is a drop-in replacement for MySQL. This commit adds a current
and stable version of MariaDB to the tree.

Quite a few ideas/patches were copied from Alpine Linux, Busybox Buildroot
and Debian.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper
2018-04-09 20:35:47 +02:00
parent aacb04dc3f
commit 1b73f267ea
11 changed files with 1165 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2010-2011 OpenWrt.org
START=95
STOP=10
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
SERVICE_STOP_TIME=9
PROG='/usr/bin/mysqld'
start() {
local conf='/etc/my.cnf'
local datadir="$( sed -nE "s/^\s*datadir\s*=\s*('([^']*)'|\x22([^\x22]*)\x22|(.*\S))\s*$/\2\3\4/p" "$conf" )"
[ -d "$datadir" ] || {
logger -s "[ERROR] datadir '$datadir' in '$conf' does not exist"
return 1
}
[ -f "$datadir/mysql/tables_priv.MYD" ] || {
logger -s "[ERROR] can not detect privileges table, you might need to"
logger -s "run 'mysql_install_db --force' to initialize the system tables"
return 1
}
service_start "$PROG"
}
stop() {
service_stop "$PROG"
}