From a34fd50ce1c4385a7e63522d3d248fc3d417449b Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 9 Feb 2015 20:53:36 +0100 Subject: MDEV-7478 log-basename unpredictable behavior in standalone mode * fix /etc/init.d/mysql to use log-basename for pid-filename * fix mysqld_safe not to force logging-to-file when log-basename is specified --- scripts/mysqld_safe.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts/mysqld_safe.sh') diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 3428fff6a59..303e7a29a6d 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -28,6 +28,7 @@ syslog_tag= user='@MYSQLD_USER@' pid_file= err_log= +err_log_base= syslog_tag_mysqld=mysqld syslog_tag_mysqld_safe=mysqld_safe @@ -208,7 +209,7 @@ parse_arguments() { --user=*) user="$val"; SET_USER=1 ;; --log-basename=*|--hostname=*|--loose-log-basename=*) pid_file="$val.pid"; - err_log="$val.err"; + err_log_base="$val"; ;; # these might have been set in a [mysqld_safe] section of my.cnf @@ -577,7 +578,16 @@ then * ) err_log="$DATADIR/$err_log" ;; esac else - err_log=$DATADIR/`@HOSTNAME@`.err + if [ -n "$err_log_base" ] + then + err_log=$err_log_base.err + case "$err_log" in + /* ) ;; + * ) err_log="$DATADIR/$err_log" ;; + esac + else + err_log=$DATADIR/`@HOSTNAME@`.err + fi fi append_arg_to_args "--log-error=$err_log" -- cgit v1.2.1