mariadb: minor whitespace and typo fixes
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
This commit is contained in:
parent
a66fd0f835
commit
357fa2930c
3 changed files with 24 additions and 25 deletions
|
@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=mariadb
|
PKG_NAME:=mariadb
|
||||||
PKG_VERSION:=10.9.8
|
PKG_VERSION:=10.9.8
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL := https://archive.mariadb.org/$(PKG_NAME)-$(PKG_VERSION)/source
|
PKG_SOURCE_URL := https://archive.mariadb.org/$(PKG_NAME)-$(PKG_VERSION)/source
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
|
|
||||||
config mysqld 'general'
|
config mysqld 'general'
|
||||||
# Unless enable, MariaDB will not start without this
|
# Unless enable, MariaDB will not start without this
|
||||||
option enabled '0'
|
option enabled '0'
|
||||||
# User to run MariaDB as
|
# User to run MariaDB as
|
||||||
option user 'mariadb'
|
option user 'mariadb'
|
||||||
# Group to run MariaDB
|
# Group to run MariaDB
|
||||||
option group 'mariadb'
|
option group 'mariadb'
|
||||||
# If there is now database, create an empty one automatically
|
# If there is no database, create an empty one automatically
|
||||||
option init '1'
|
option init '1'
|
||||||
# If upgrading old database, run mysql_upgrade during restart
|
# If upgrading old database, run mysql_upgrade during restart
|
||||||
option upgrade '1'
|
option upgrade '1'
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ start_service() {
|
||||||
|
|
||||||
# Migration from old versions
|
# Migration from old versions
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
if [ "$(cat "$datadir"/.version 2> /dev/null)" \!= "$version" ] && [ "$autoupgrade" -gt 0 ]; then
|
if [ "$(cat "$datadir"/.version 2> /dev/null)" \!= "$version" ] && [ "$autoupgrade" -gt 0 ]; then
|
||||||
# Check for correct owner
|
# Check for correct owner
|
||||||
local owner="$(stat --format %U:%G "$datadir" 2> /dev/null)"
|
local owner="$(stat --format %U:%G "$datadir" 2> /dev/null)"
|
||||||
if [ -n "$owner" ] && [ "$owner" != "$my_user:$my_group" ]; then
|
if [ -n "$owner" ] && [ "$owner" != "$my_user:$my_group" ]; then
|
||||||
|
@ -155,34 +155,34 @@ start_service() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start upgrade instance without credentials
|
# Start upgrade instance without credentials
|
||||||
sudo -u "$my_user" mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_upgrade.sock &
|
sudo -u "$my_user" mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_upgrade.sock &
|
||||||
PID="$!"
|
PID="$!"
|
||||||
i=0
|
i=0
|
||||||
# Wait for upgrade instance of db to start
|
# Wait for upgrade instance of db to start
|
||||||
while [ "$i" -lt 15 ] && test \! -S /tmp/mysql_upgrade.sock; do
|
while [ "$i" -lt 15 ] && test \! -S /tmp/mysql_upgrade.sock; do
|
||||||
sleep 1
|
sleep 1
|
||||||
i="$((i + 1))"
|
i="$((i + 1))"
|
||||||
done
|
done
|
||||||
[ -S /tmp/mysql_upgrade.sock ] || {
|
[ -S /tmp/mysql_upgrade.sock ] || {
|
||||||
$LOGGER "Failed to start upgrading instance of MariaDB."
|
$LOGGER "Failed to start upgrading instance of MariaDB."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
# Upgrade the database
|
# Upgrade the database
|
||||||
mysql_upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock
|
mysql_upgrade --upgrade-system-tables --socket=/tmp/mysql_upgrade.sock
|
||||||
echo "$version" > "$datadir"/.version
|
echo "$version" > "$datadir"/.version
|
||||||
# Stop the upgrade instance
|
# Stop the upgrade instance
|
||||||
kill "$PID"
|
kill "$PID"
|
||||||
i=0
|
i=0
|
||||||
while [ "$i" -lt 60 ] && grep -q mysql "/proc/$PID/cmdline"; do
|
while [ "$i" -lt 60 ] && grep -q mysql "/proc/$PID/cmdline"; do
|
||||||
sleep 1
|
sleep 1
|
||||||
[ "$i" -lt 30 ] || kill "$PID"
|
[ "$i" -lt 30 ] || kill "$PID"
|
||||||
i="$((i + 1))"
|
i="$((i + 1))"
|
||||||
done
|
done
|
||||||
# Use force
|
# Use force
|
||||||
if grep -q mysql "/proc/$PID/cmdline"; then
|
if grep -q mysql "/proc/$PID/cmdline"; then
|
||||||
kill -9 "$PID"
|
kill -9 "$PID"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start daemon
|
# Start daemon
|
||||||
procd_open_instance
|
procd_open_instance
|
||||||
|
|
Loading…
Reference in a new issue