mariadb: use default umask for rundir

rundir needs to be accessible for clients, hence o= is not the proper
permission for rundir. This commit breaks out rundir from the awk script
and sets it up with default umask.

This also removes chmod call and instead tells mkdir to create the
directories with the proper permissions directly.

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2020-05-24 10:41:09 +02:00
parent c8d2ed2cbc
commit 39db22ec95
2 changed files with 10 additions and 6 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=mariadb
PKG_VERSION:=10.2.32
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL := \

View File

@ -110,27 +110,31 @@ start_service() {
-v group="$group" \
-v a="$datadir" \
-v b="$logdir" \
-v c="$rundir" \
-v d="$tmpdir" \
-v c="$tmpdir" \
'
BEGIN {
dir[0]=a
dir[1]=b
dir[2]=c
dir[3]=d
for (x in dir) {
if (system("test ! -e \"" dir[x] "\"" )) {
delete dir[x]
}
}
for (x in dir) {
system("mkdir -p \"" dir[x] "\"" )
system("chmod 750 \"" dir[x] "\"" )
system("mkdir -p -m 0750 \"" dir[x] "\"" )
system("chown \"" user "\":\"" group "\" \"" dir[x] "\"" )
}
}
'
if ! [ -e "$rundir" ]; then
# $rundir needs to be accessible for
# clients
mkdir -p "$rundir"
[ -d "$rundir" ] && chown "$user":"$group" "$rundir"
fi
if [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then
local args="--force"
local basedir=$(mysqld_get_param basedir)