[Bug 1521771] [NEW] init.d.mysql shutdown timeout value does not match init/mysql.conf value
Mark Stosberg
mark at stosberg.com
Tue Dec 1 22:01:51 UTC 2015
Public bug reported:
In `/etc/init/mysql.conf`, the configuration is set to wait 5 minutes
after a SIGTERM is issued before a SIGKILL is issued. The value was
intentionally set that high because sometimes the default of 5 seconds
wasn't long enough [1].
1. https://bugs.launchpad.net/ubuntu/+source/mysql-dfsg-5.1/+bug/620441
The code used for this in the upstart script is:
kill timeout 300
However the parallel change was not made to /etc/init.d/mysql
It has the same logic, but waits only 10 seconds, like this:
```
killall -15 mysqld
server_down=
for i in 1 2 3 4 5 6 7 8 9 10; do
sleep 1
if mysqld_status check_dead nowarn; then server_down=1; break; fi
done
if test -z "$server_down"; then killall -9 mysqld; fi
```
I would consider submitting a patch to change the timeout from 10
seconds to 300 in this script, but I can't believe spelling out the
numbers from 1 to 300 is the best way to do that, as the current code
counts to 10 like this.
I know that using upstart and the "service" command are the preferred
way to manage MySQL, but as long as the init.d script continues to be
shipped it should parallel the upstart script when possible.
This change matters to projects like ec2-consistent-shutdown, which
tries to shutdown MySQL cleanly across a number of linux variations. It
currently does that with a hardcoded reference to /etc/init.d/mysql,
which apparenty works, while I don't think the upstart syntax would be
as portable. [2]
2. https://github.com/alestic/ec2-consistent-snapshot/pull/68
** Affects: mysql-5.5 (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to mysql-5.5 in Ubuntu.
https://bugs.launchpad.net/bugs/1521771
Title:
init.d.mysql shutdown timeout value does not match init/mysql.conf
value
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/1521771/+subscriptions
More information about the Ubuntu-server-bugs
mailing list