Skip to content

Commit

Permalink
MDEV-8374 - Debian: mysqld_safe Can't log to error log and syslog at …
Browse files Browse the repository at this point in the history
…the same time

Let mysqld_safe_syslog.cnf force disable error log so that logging to syslog is
not affected by previous log_error setting.

Added handling of --skip-log-error to mysqld_safe.
  • Loading branch information
Sergey Vojtovich committed Jul 16, 2015
1 parent 6efdc39 commit 94bc506
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions debian/additions/mysqld_safe_syslog.cnf
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[mysqld_safe]
skip_log_error
syslog
15 changes: 14 additions & 1 deletion scripts/mysqld_safe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ user='@MYSQLD_USER@'
pid_file=
err_log=
err_log_base=
skip_err_log=0

syslog_tag_mysqld=mysqld
syslog_tag_mysqld_safe=mysqld_safe
Expand Down Expand Up @@ -208,7 +209,14 @@ parse_arguments() {

# these might have been set in a [mysqld_safe] section of my.cnf
# they are added to mysqld command line to override settings from my.cnf
--log[-_]error=*) err_log="$val" ;;
--skip[-_]log[-_]error)
err_log=;
skip_err_log=1;
;;
--log[-_]error=*)
err_log="$val";
skip_err_log=0;
;;
--port=*) mysql_tcp_port="$val" ;;
--socket=*) mysql_unix_port="$val" ;;

Expand Down Expand Up @@ -548,6 +556,11 @@ then
fi
fi

if [ $skip_err_log -eq 1 ]
then
append_arg_to_args "--skip-log-error"
fi

if [ -n "$err_log" -o $want_syslog -eq 0 ]
then
if [ -n "$err_log" ]
Expand Down

0 comments on commit 94bc506

Please sign in to comment.