Commit a34fd50c authored by Sergei Golubchik's avatar Sergei Golubchik

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
parent f007f828
......@@ -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"
......
......@@ -146,6 +146,9 @@ parse_server_arguments() {
--datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'`
datadir_set=1
;;
--log-basename=*|--hostname=*|--loose-log-basename=*)
mysqld_pid_file_path=`echo "$arg.pid" | sed -e 's/^[^=]*=//'`
;;
--pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
esac
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment