Shutdown timeout values are inconsistent between init.d, upstart and systemd init scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mysql-5.5 (Ubuntu) |
Invalid
|
Low
|
Unassigned | ||
mysql-5.6 (Ubuntu) |
Triaged
|
Low
|
Unassigned | ||
mysql-5.7 (Ubuntu) |
Triaged
|
Low
|
Unassigned |
Bug Description
In `/etc/init/
1. https:/
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
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-
2. https:/
Changed in mysql-5.7 (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
I looked at the mysql-5.6 package in the xenial distribution.
It provides 3 init scripts: one for upstart, one for SysV init, and one
presumably for systemd. Each provides a different value for the server
to shutdown: 10 seconds, 300 seconds or 600 seconds, depending on which
service you use.
I did see a better syntax for waiting 30 seconds using Bash, though.
Before:
> for i in 1 2 3 4 5 6 7 8 9 10; do
> sleep 1
After:
> for i in $(seq 1 300); do
> sleep 1
That's my recommended patch to /etc/init.d/mysql
I also recommend fixing the mysql-server 5.6 package to be consistent
between the 3 init scripts.
Mark