mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
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:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user