[MDEV-5957] mysqld_safe errors are lost when executed from the init script and additional arguments are not passed in case of a "restart" on Debian Created: 2014-03-26 Updated: 2016-11-25 Resolved: 2016-11-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Platform Debian |
| Affects Version/s: | 5.5.36 |
| Fix Version/s: | 10.2.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jean Weisbuch | Assignee: | Otto Kekäläinen |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | debian, init, mysqld_safe | ||
| Environment: |
Debian Wheezy |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
When mysqld_safe is exeuted by the init script and fails with an error message sent on stderr, the message will neither be displayed nor logged :
There is no mention of the error throwed by mysqld_safe on the mysql error log or on the syslog, it fails and the only way to know why it failed is to manually launch mysqld_safe on foreground. Another issue, is that calling the init script with "restart" wont pass the additional arguments as it does when calling it with "start" (this issue exists on the Debian/Ubuntu packages init script but not on support-files/mysql.server) :
(while it should fail) Here is a simple patch for both issues for the Debian/Ubuntu init script that will send the mysqld_safe stderr to syslog (but it will keep a logger process running, solving that on mysqld_safe itself if possible should be better) and keep the additional arguments when using the "restart" command (which is already working on the non-packaged init that pass the $other_args variable) :
After having applied the patch :
And we can find this line on the syslog :
|
| Comments |
| Comment by Otto Kekäläinen [ 2014-03-28 ] | |||||||||||
|
Patch added to 5.5 branch of my packaging in https://github.com/ottok/mariadb-5.5/commit/2f78ab8bc31cbc10de22bea21fdf162076ddd14c Once builds are done (http://labs.seravo.fi/~otto/mariadb-repo/build.log) you can test the resulting binaries by installing from these repos:
| |||||||||||
| Comment by Mikhael Anisimov [ 2015-05-19 ] | |||||||||||
|
There is a problem running mysqld_safe together with logger. I am trying to run /etc/init.d/mysql from script, that also collects the output of init-script invocation. My script never finishes, probably, due to the non-closed pipe, left by logger. Steps to reproduce:
Originally, without logger, collection of the output worked normally. | |||||||||||
| Comment by Andrii Nikitin (Inactive) [ 2016-11-03 ] | |||||||||||
|
Fix confirmed in recent build of 10.2.3 http://buildbot.askmonty.org/buildbot/builders/kvm-deb-trusty-amd64/builds/3854 (both 'start' and 'restart' now fail with corresponding message in syslog): $ tail /var/log/syslog | grep malloc | |||||||||||
| Comment by Otto Kekäläinen [ 2016-11-25 ] | |||||||||||
|
This was fixed for 10.2 in https://github.com/MariaDB/server/commit/73f1c655 |