summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_install_db.sh17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 065aa7bd3fe..3b14437b5d1 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -24,7 +24,6 @@ builddir=""
ldata="@localstatedir@"
langdir=""
srcdir=""
-log_error=""
args=""
defaults=""
@@ -551,12 +550,20 @@ else
filter_cmd_line="cat"
fi
-# Disable log error if the user don't have write access to the directory.
-# This is common when a user tries to install a personal mariadbd server
-if test -n $log_error
+# Disable log error if the user don't have right to write/create the file
+# This is common when a user tries to install a personal mariadbd server and
+# the global config in /etc is using --log-error.
+# The server will internally change log-error to stderr to stderr if it cannot
+# write the the log file. This code only disables the error message from a not
+# writable log-error, which can be confusing.
+if test -n "$log_error"
then
- if test ! -w $log_error
+ if test \( -e "$log_error" -a \! -w "$log_error" \) -o \( ! -e "$log_error" -a ! -w "`dirname "$log_error"`" \)
then
+ if test -n "$verbose"
+ then
+ echo "resetting log-error '$log_error' because no write access"
+ fi
log_error=""
args="$args --skip-log-error"
fi