Skip to content

Commit 1bbbb66

Browse files
committed
Disable error messages in mysql-install-db for not writable log directory
1 parent 90bbeaf commit 1bbbb66

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

scripts/mysql_install_db.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,25 @@ else
537537
filter_cmd_line="cat"
538538
fi
539539

540+
# Disable log error if the user don't have right to write/create the file
541+
# This is common when a user tries to install a personal mariadbd server and
542+
# the global config in /etc is using --log-error.
543+
# The server will internally change log-error to stderr to stderr if it cannot
544+
# write the the log file. This code only disables the error message from a not
545+
# writable log-error, which can be confusing.
546+
if test -n "$log_error"
547+
then
548+
if test \( -e "$log_error" -a \! -w "$log_error" \) -o \( ! -e "$log_error" -a ! -w "`dirname "$log_error"`" \)
549+
then
550+
if test -n "$verbose"
551+
then
552+
echo "resetting log-error '$log_error' because no write access"
553+
fi
554+
log_error=""
555+
args="$args --skip-log-error"
556+
fi
557+
fi
558+
540559
# Configure mysqld command line
541560
mysqld_bootstrap="${MYSQLD_BOOTSTRAP-$mysqld}"
542561
mysqld_install_cmd_line()

0 commit comments

Comments
 (0)