[MDEV-18591] mysql_install_db wrong output message for error logs Created: 2019-02-15 Updated: 2022-12-13 Resolved: 2022-12-13 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.1, 10.2, 10.3, 10.4 |
| Fix Version/s: | 10.11.2, 10.3.38, 10.4.28, 10.5.19, 10.6.12, 10.7.8, 10.8.7, 10.9.5, 10.10.3 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Faustin Lammler | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian |
||
| Description |
|
Hi,
On Debian the error log goes by default to /var/log/mysql/error.log and not into /var/lib/mysql. |
| Comments |
| Comment by Otto Kekäläinen [ 2020-11-22 ] | |||||||||||||
|
faust This was pretty well debugged downstream in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=922018, to fix this I guess you only need to change one string/variable? Could you fix this upstream? | |||||||||||||
| Comment by Faustin Lammler [ 2020-11-23 ] | |||||||||||||
|
otto as this is "debian specific" I have no idea on how to cleanly fix this upstream. Here is the code: We could add something like:
Then what is the bast practice for Debian OS detection. | |||||||||||||
| Comment by Olaf van der Spek [ 2020-11-23 ] | |||||||||||||
|
What about using `show variables like 'log_error';`? Why is it using `/var/lib` for logs on non-Debian platforms, isn't `/var/log` a Linux thing? You could also choose to not mention the location. | |||||||||||||
| Comment by Faustin Lammler [ 2020-11-23 ] | |||||||||||||
|
> What about using `show variables like 'log_error';`? If I am correct, the mariadb server is not running at that moment (script is preparing data dir) so I guess this is not possible. > Why is it using `/var/lib` for logs on non-Debian platforms, isn't `/var/log` a Linux thing? Good Q. There must be a reason but I don't know. > You could also choose to not mention the location. That may be a solution, not very user friendly though. | |||||||||||||
| Comment by Olaf van der Spek [ 2020-11-23 ] | |||||||||||||
|
Is it the script or the server that writes to the log? | |||||||||||||
| Comment by Anel Husakovic [ 2020-11-23 ] | |||||||||||||
|
Hi,
Note that above there is no log_error server option.
Note that if you have a config file (see option files that is configuring log_error) it can be invoked from there also. | |||||||||||||
| Comment by Daniel Black [ 2020-11-24 ] | |||||||||||||
|
it generally sounds better to use log-error is stderr immediately since is already quietened already. dbdeployer seems to cover the init with --no-defaults https://github.com/datacharmer/dbdeployer/blob/6c64381704783784d164adf865ae02ed907c2c09/sandbox/sandbox.go#L812 so I assume this is stderr already, datacharmer do you have an opinion here? containter usage of mysql_install_db will process stderr in the logs of the container execution so that use is ok. The last option that I'd rather avoid is to look at the /proc/ {pid}/fd/3 (not BSD friendly) symlink during bootstrap to see where its being written to. As written, going to get tests written first MDEV-24268 | |||||||||||||
| Comment by Giuseppe Maxia [ 2020-11-24 ] | |||||||||||||
|
dbdeployer uses --no-defaults to prevent the sandboxed server from being On Tue, Nov 24, 2020 at 6:27 AM Daniel Black (Jira) <jira@mariadb.org> | |||||||||||||
| Comment by Daniel Black [ 2022-12-08 ] | |||||||||||||
|
PR for review https://github.com/MariaDB/server/pull/2363 | |||||||||||||
| Comment by Daniel Black [ 2022-12-08 ] | |||||||||||||
|
Note Debian downstream will still need to pass --log-error on their cmd line in the post-install. Maybe its useful if that is kept different to the user default as its packaging related and reading the error log of the previous combined with the current would be less readable. |