Bug #31361 | Patch to make mysqld_safe react on signals HUP and TERM | ||
---|---|---|---|
Submitted: | 3 Oct 2007 1:20 | Modified: | 16 Aug 2017 13:43 |
Reporter: | Christian Hammers (Silver Quality Contributor) (OCA) | Email Updates: | |
Status: | Won't fix | Impact on me: | |
Category: | MySQL Server: Packaging | Severity: | S4 (Feature request) |
Version: | 5.1 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Contribution, qc |
[3 Oct 2007 1:20]
Christian Hammers
[3 Oct 2007 12:00]
Valeriy Kravchuk
Thank you for a patch contributed.
[8 Jun 2009 22:34]
liz drachnik
Hello Christian - In order for us to continue the process of reviewing your contribution to MySQL - We need you to review and sign the Sun|MySQL contributor agreement (the "SCA") The process is explained here: http://forge.mysql.com/wiki/Sun_Contributor_Agreement Getting a signed/approved SCA on file will help us facilitate your contribution-- this one, and others in the future. Thank you ! Liz Drachnik - Program Manager - MySQL
[6 Jul 2009 21:30]
Christian Hammers
Meanwhile you should have received the agreement. If not, please contact me again. BTW, the patch was recently claimed to be buggy, too, in http://bugs.debian.org/527623 The solution proposed there was something like the following, I don't have a complete patch: --------------------------------------------------------- that [edit: he's refering to my proposal] patch is still wrong. The first time a HUP is received, we run the code in the trap and call wait which will wait for both the refresh command and the mysqld one. But we won't return from that trap until mysqld dies, and in the trap the HUP signal is blocked, which means any subsequent HUP will not be handled. A better way could be to implement some proper event handling as in: trap : HUP INT QUIT TERM while :; do action= mysqld ... & while :; do signal=NONE wait || signal=$(kill -l "$?") case $signal in (INT|TERM|QUIT) mysqladmin ... shutdown; exit;; (HUP) mysqladmin ... refresh;; (NONE) break;; # mysqld died (*) unexpected ... die;; esac esac done
[16 Aug 2017 13:43]
Terje Røsten
Posted by developer: I don't see the need to send signals to mysqld_safe to all as signals can be sent to mysqld directly (mysqld has it's own pid file). The requirement of empty root password or password in ~/.my.cnf is also blocker for this change. Besides, Debian 9 and most other Linux distros are using systemd where mysqld_safe is not used.