Skip to content

Commit f3699ab

Browse files
BUG#21627629 - --DAEMONIZE: DON'T ENFORCE REDIRECTION IS LOG-ERROR
OPTION IS IN USE. The patch does not log error if log-error option is specified along with daemonize and the stderr and stdout file descriptor are connected to a terminal type device.
1 parent baff917 commit f3699ab

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

sql/mysqld.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4403,10 +4403,12 @@ int mysqld_main(int argc, char **argv)
44034403
exit(MYSQLD_ABORT_EXIT);
44044404
}
44054405

4406-
if (opt_daemonize && (isatty(STDOUT_FILENO) || isatty(STDERR_FILENO)))
4406+
if (opt_daemonize && log_error_dest == disabled_my_option &&
4407+
(isatty(STDOUT_FILENO) || isatty(STDERR_FILENO)))
44074408
{
4408-
fprintf(stderr, "Please set appopriate redirections for "
4409-
"standard output and/or standard error in daemon mode.\n");
4409+
fprintf(stderr, "Please enable --log-error option or set appropriate "
4410+
"redirections for standard output and/or standard error "
4411+
"in daemon mode.\n");
44104412
exit(MYSQLD_ABORT_EXIT);
44114413
}
44124414

sql/sys_vars.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,9 @@ static Sys_var_charptr Sys_log_error(
19551955
"log_error", "Error log file",
19561956
READ_ONLY GLOBAL_VAR(log_error_dest),
19571957
CMD_LINE(OPT_ARG, OPT_LOG_ERROR),
1958-
IN_FS_CHARSET, DEFAULT(disabled_my_option));
1958+
IN_FS_CHARSET, DEFAULT(disabled_my_option), NO_MUTEX_GUARD,
1959+
NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL),
1960+
NULL, sys_var::PARSE_EARLY);
19591961

19601962
static Sys_var_mybool Sys_log_queries_not_using_indexes(
19611963
"log_queries_not_using_indexes",

0 commit comments

Comments
 (0)