Browse Source

Merge pull request #17608 from miska/mariadb-owner-fix

Mariadb owner fix & sudo dependency
lilik-openwrt-22.03
Josef Schlehofer 2 years ago
committed by GitHub
parent
commit
c280d64f85
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions
  1. +2
    -1
      utils/mariadb/Makefile
  2. +6
    -0
      utils/mariadb/files/mysqld.init

+ 2
- 1
utils/mariadb/Makefile View File

@ -265,7 +265,8 @@ define Package/mariadb-server-base
+KERNEL_IO_URING:liburing \
+liblzma \
+libpcre2 \
+resolveip
+resolveip \
+sudo
TITLE:=MariaDB database server base
USERID:=mariadb=376:mariadb=376
endef


+ 6
- 0
utils/mariadb/files/mysqld.init View File

@ -152,6 +152,12 @@ start_service() {
# Migration from old versions
# shellcheck disable=SC2154
if [ "$(cat "$datadir"/.version 2> /dev/null)" \!= "$version" ] && [ "$autoupgrade" -gt 0 ]; then
# Check for correct owner
local owner="$(stat --format %U:%G "$datadir" 2> /dev/null)"
if [ -n "$owner" ] && [ "$owner" != "$my_user:$my_group" ]; then
chown -Rh "$my_user:$my_group" "$datadir"
fi
# Start upgrade instance without credentials
sudo -u "$my_user" mysqld --skip-networking --skip-grant-tables --socket=/tmp/mysql_upgrade.sock &
PID="$!"


Loading…
Cancel
Save