[MDEV-7478] log-basename unpredictable behavior in standalone mode Created: 2015-01-19 Updated: 2015-02-11 Resolved: 2015-02-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Platform RedHat, Scripts & Clients |
| Affects Version/s: | 5.5.41, 10.0 |
| Fix Version/s: | 5.5.42, 10.0.17 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alex | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | init, mysqld_safe | ||
| Environment: |
CentOS 6.6 |
||
| Description |
|
Hello,
However, we've hit the unpredictable behavior (in 5.5.41) in Standalone mode: Our syslog configuration:
Host: MARIADBTEST The tests we've run on CentOS 6.6: With Standalone Server [mysqld]: 1. No syslog Result: log-basename doesn't affect pid file name. 2. Adding log_error='' in standalone mode (trying to activate syslog): Result: no syslog logging is active, and both err and pid files use hostname. With mysqld_multi [mysqld1]: 1. No syslog Result: everything is good! 2. Adding log_error='' (trying to activate syslog): Result: Everything is good, and error log goes to syslog! As you see only in mysqld_multi mode the behavior is by design. Thanks! |
| Comments |
| Comment by Elena Stepanova [ 2015-01-23 ] |
|
What kind of server startup you mean when you are talking about a standalone server? Do you use mysqld_safe, or start mysqld binary directly? |
| Comment by Alex [ 2015-01-23 ] |
|
I mean the conventional way to start/use MariaDB (with mysqld_safe , [mysqld] section in /etc/my.cnf and init control (/etc/init.d/mysql)). |
| Comment by Alex [ 2015-01-25 ] |
|
Also, just checked MariaDB10, same behavior ;( |
| Comment by Elena Stepanova [ 2015-01-26 ] |
|
Thanks for the clarification. So, there are several issues in here. 1. pidfile name does not use log-basename – it's a problem of the startup script (/etc/init.d/mysql), at least on RPM-based systems. At some point it checks if a path to the pid file is set explicitly, and if not, sets it to <hostname>.pid. It has no notion of log-basename. 2. no syslog if log-basename is given – it's a problem of mysqld_safe. It does have a notion of log-basename, and if it finds it among the options, it sets a value for the error log file name accordingly. But later it uses this variable to check whether the variable is set, assuming it was done by the user, and if it's not empty, the script claims that the user provided wrong configuration – set the error log name and requested syslog at the same time (the output of mysqld_safe says just that: "Can't log to error log and syslog at the same time..." Since both bugs are outside the server, apparently mysqld_multi is not anyhow affected by them, hence it behaves correctly. 3. The behavior with the empty error log – it's arguably acceptable, the expectations are vague here and might depend on the order of the given options. On one hand, when the value is empty, it's supposed to be set to <hostname>.err; on the other hand, log-basename is expected to modify the prefix. I wouldn't want any changes to be made for this special case unless you think it's certainly incorrect and have a good suggestion on how to make it consistent. |
| Comment by Alex [ 2015-01-27 ] |
|
Hi Elena, you are right! I've reviewed it again and rechecked mysql init and mysqld_safe scripts. I am leaving it to MariaDB team to decide what's next p.s. Maybe it's about time to consolidate mysqld_multi and mysqld_safe into something smarter, just to avoid fixing legacy bugs of both scripts Thanks! |