[MDEV-6762] Init script is too silent in case of basic failures Created: 2014-09-21  Updated: 2018-01-15  Resolved: 2018-01-15

Status: Closed
Project: MariaDB Server
Component/s: Packaging, Platform Debian, Scripts & Clients
Affects Version/s: 5.5.39, 10.0.14
Fix Version/s: 10.2.3

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-5957 mysqld_safe errors are lost when exec... Closed

 Description   

Currently a failed upgrade or incomplete installation, which ends up with mysqld_safe not being installed, becomes an investigation nightmare. The service attempts to start and after a timeout says that it failed:

sudo /etc/init.d/mysql start
[FAIL] Starting MariaDB database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!

Syslog only contains unhelpful messages saying that something went wrong:

Sep 21 03:09:10 wheezy-64 /etc/init.d/mysql[13619]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Sep 21 03:09:10 wheezy-64 /etc/init.d/mysql[13619]: #007/usr/bin/mysqladmin: connect to server at 'localhost' failed
Sep 21 03:09:10 wheezy-64 /etc/init.d/mysql[13619]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Sep 21 03:09:10 wheezy-64 /etc/init.d/mysql[13619]: Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
Sep 21 03:09:10 wheezy-64 /etc/init.d/mysql[13619]: 

That's how we end up with users' complaints like "server just does not start, nothing in the error log", at which point we get stuck because there's nothing to work with.

It is a realistic situation, for example that's exactly what happens when one tries to dist-upgrade from 5.5 to 10.0 on Wheezy.

It happens because all output of mysqld_safe call in the init script is redirected to /dev/null.



 Comments   
Comment by Jean Weisbuch [ 2014-09-22 ]

I already proposed a fix for this issue for the Debian init script on MDEV-5957, it should have been fixed for MariaDB 10 packaged version on Debian and Ubuntu but not on the other cases.

--- /etc/init.d/mysql	2014-03-26 16:30:29.786052516 +0100
+++ /etc/init.d/mysql	2014-03-26 16:19:55.316198723 +0100
@@ -106,7 +106,7 @@
 	    test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld
 
 	    # Start MariaDB!
-  	    /usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 &
+  	    /usr/bin/mysqld_safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER &
 
 	    # 6s was reported in #352070 to be too few when using ndbcluster
 	    for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}"); do

Comment by Elena Stepanova [ 2014-09-22 ]

Great, thanks, so we just need to include it into our version as well.

Comment by Daniel Black [ 2018-01-15 ]

Fixed in https://github.com/MariaDB/server/commit/73f1c655ada9

Generated at Thu Feb 08 07:14:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.