[MDEV-20344] startup messages belong in stderr/error-log not stdout Created: 2019-08-14  Updated: 2023-01-06  Resolved: 2023-01-06

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.1, 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.11.2, 11.0.1, 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: Reindl Harald Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: beginner-friendly

Issue Links:
Problem/Incident
is caused by MDEV-9593 Print the real version in the error log Closed
Relates
relates to MDEV-6873 On startup please make MariaDB report... Closed
relates to MDEV-9593 Print the real version in the error log Closed
relates to MDEV-10967 Print the real version in the error l... Closed
relates to MDEV-17093 Print version_source_revision in the ... Closed
relates to MDEV-20287 Have the server process print a "star... Open
relates to MDEV-21711 Log: "Server Version xx.xx.xx startin... Open
relates to MDEV-10648 mysqld --log-error prints on stdout a... Confirmed
relates to MDEV-21046 Print server version to error log ins... Open

 Description   

this annoying message don't belog to stdout and i have pointed this out years ago on the mailing list after the update which introduced it with a heatet discussion because most people spoke up didn't gasp what i am talking about

we have maraidb logfiles and so there is no point to spit out anything ond stdout which on other init systems won't be seen at all

Aug 14 04:02:41 backup-dbmail systemd[1]: Stopping MariaDB Replication...
Aug 14 04:02:43 backup-dbmail systemd[1]: Stopped MariaDB Replication.
Aug 14 04:10:18 backup-dbmail systemd[1]: Starting MariaDB Replication...
Aug 14 04:10:18 backup-dbmail mysqld[496132]: 2019-08-14 4:10:18 140369542626816 [Note] /usr/libexec/mysqld (mysqld 10.2.26-MariaDB) starting as process 496132 ...
Aug 14 04:10:20 backup-dbmail systemd[1]: Started MariaDB Replication.



 Comments   
Comment by Sergei Golubchik [ 2020-08-24 ]

I'd say it's questionable whether it's a bug. The message is printed as soon as the server executable is started, before command line options are parsed. So it cannot possibly go into the error log.

The only way to fix it is to stop printing an early "starting" message altogether. I don't really know how many users rely on it, so I cannot say if it's safe to remove.

Given the risk, I tend to think that it's far safer to redirect stderr to /dev/null if needed, intead of removing this early message for everyone.

Comment by Reindl Harald [ 2020-08-24 ]

> I tend to think that it's far safer to redirect stderr to /dev/null if needed

nobody right in his mind redirects stderr to /dev/null and nobody needs that message at all, systemd tells you the processid anyways and for the rare systems which still use initscripts that message wasn't there all the years

Comment by Reindl Harald [ 2020-08-24 ]

> [Note] /usr/libexec/mysqld (mysqld 10.2.26-MariaDB) starting as process 496132

BTW: next time you design something like that do it with using your brain and don't spit a variable version number in the middle so that you can't write a proper rsyslog filter

"/usr/libexec/mysqld starting as process 496132" would have been enough, i know which versions are installed and if i don't know it's time top get back control

Comment by Reindl Harald [ 2020-08-24 ]

in a sane world one could just log to syslog: MDEV-23555

Comment by Sergei Golubchik [ 2020-08-29 ]

Ok, sorry. I stand corrected. I used to think this message is printed almost immediately on startup. Perhaps it was. But now it's printed after all options are parsed. At that point the configured error log destination is known and it surely should be able to use it.

I'd even say that the intention was to print this line into the error log, not stderr. Last commit that touched it was "MDEV-9593 - Print the real version in the error log", so the intention clearly was to print it into the error log. Thus it's a bug.

Comment by Daniel Black [ 2022-10-26 ]

Corrected in https://github.com/MariaDB/server/pull/1979#issuecomment-1291460656

Comment by Oleksandr Byelkin [ 2023-01-05 ]

OK to push

Comment by Daniel Black [ 2023-01-06 ]

Thanks for the review sanja.

Happy to have this fixed finally.

Generated at Thu Feb 08 08:58:45 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.