[MDEV-14337] mysqld_safe may suppress error messages with --log-output=file Created: 2017-11-09  Updated: 2018-01-08  Resolved: 2017-11-10

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.2.10
Fix Version/s: 5.5.59, 10.0.34, 10.1.30, 10.2.12

Type: Bug Priority: Critical
Reporter: Andrii Nikitin (Inactive) Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-14312 Server fails to start when parameter ... Closed
duplicates MDEV-14488 logging not happening on spider branc... Closed
duplicates MDEV-14714 mysqld writes status information on H... Closed
duplicates MDEV-14797 MariDB 10.2.11 writing errors logs in... Closed
duplicates MDEV-14889 Server fails to start because of aria... Closed
is duplicated by MDEV-14644 MariaDB 10.2.11 breaks binary logging... Closed
Sprint: 10.2.11

 Description   

To verify the problem patch mysqld_safe like following:

@@ -969,8 +961,6 @@
 have_sleep=1
 
 # close stdout and stderr, everything goes to $logging now
+log_error this is error message before closing descriptors
+log_notice this is notice message before closing descriptos
 if expr "${-}" : '.*x' > /dev/null
 then
   :
@@ -979,9 +969,6 @@
   exec 2>&-
 fi
 
+log_error this is error message after closing descriptors
+log_notice this is notice message after closing descriptos
+
 # maximum number of wsrep restarts
 max_wsrep_restarts=0

Now start mysqld_safe with --log-error and observe output like below, which is expected:

# mysqld_safe --log-error=/var/lib/mysql/test.err           
171109 12:50:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
171109 12:50:55 mysqld_safe this is error message before closing descriptors
171109 12:50:55 mysqld_safe this is notice message before closing descriptos

Now examine error log and observe that message 'error message after closing descriptors' is missing:

# cat /var/lib/mysql/test.err
171109 12:50:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
171109 12:50:55 mysqld_safe this is error message before closing descriptors
171109 12:50:55 mysqld_safe this is notice message before closing descriptos
171109 12:50:55 mysqld_safe this is notice message after closing descriptos
2017-11-09 12:50:55 140399771674752 [Note] /usr/sbin/mysqld (mysqld 10.2.10-MariaDB) starting as process 4649 ...



 Comments   
Comment by Andrii Nikitin (Inactive) [ 2017-11-10 ]

Patch approved. Confirmed that MDEV-14312 is fixed as well with the patch

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