Bug #17652 log_error in 'show variables' is empty but set correctly
Submitted: 22 Feb 2006 17:02 Modified: 24 Feb 2006 12:48
Reporter: Dino Tsoumakis Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:MySQL-server-4.1.18-0 OS:Linux (SuSE 8.1 (2.4.21-273-default))
Assigned to: CPU Architecture:Any

[22 Feb 2006 17:02] Dino Tsoumakis
Description:
In 'show variables' log_error is not shown (but set correctly) if started by mysqld_safe script:
----><----
...
| log_bin                         | OFF                                      |
| log_error                       |                                          |
| log_slave_updates               | OFF                                      |
...
----><----
If server is started manually by '/usr/sbin/mysqld --user mysql --log_error=/tmp/test.log' the value of log_error is shown correctly:
----><----
...
| log_bin                         | OFF                                      |
| log_error                       | /tmp/test.log                    |
| log_slave_updates               | OFF                                      |
...
----><----

Content of /etc/my.cnf is:
----><----
...
[mysqld_safe]
log-error=/var/log/mysql/mysqld.log
...
----><----

How to repeat:
Setup

[mysqld_safe]
log-error=/tmp/test.log

in /etc/my.cnf.

Do:
rcmysql restart
mysqladmin variables

The log_error entry is empty, but /tmp/test.log is created and used.

Suggested fix:
Show content of log_error if started by mysqld_safe script.
[22 Feb 2006 17:52] Paul DuBois
mysqld_safe opens the log file and simply redirects
mysqld's output to that file. mysqld has no idea whether
it's writing to a file or what the filename is.

You can use the log-error option in the [mysqld] option group
to let mysqld know the name of the error log. This will cause
the value of log_error to be non-empty.
[23 Feb 2006 8:08] Dino Tsoumakis
Ok, I see.
But why not passing the log_error setting from mysqld_safe to mysqld on startup? I think this should be possible, right?

Something like this:
---><----
lx180:/usr/bin # diff mysqld_safe.orig mysqld_safe
338c338
<     $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking >> $err_log 2>&1
---
>     $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking --log-error=$err_log >> $err_log 2>&1
340c340
<     eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking $args >> $err_log 2>&1"
---
>     eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking --log-error=$err_log $args >> $err_log 2>&1"
lx180:/usr/bin #
---><----
[24 Feb 2006 11:23] Valeriy Kravchuk
Looks like a duplicate of a verified feature request, bug #8307. Please, check.
[24 Feb 2006 12:03] Dino Tsoumakis
You're right. Seems to be the same.
[24 Feb 2006 12:48] Valeriy Kravchuk
Duplicate of bug #8307 (feature request, really).