summaryrefslogtreecommitdiff
path: root/debian/patches/38_scripts__mysqld_safe.sh__signals.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/38_scripts__mysqld_safe.sh__signals.patch')
-rw-r--r--debian/patches/38_scripts__mysqld_safe.sh__signals.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/debian/patches/38_scripts__mysqld_safe.sh__signals.patch b/debian/patches/38_scripts__mysqld_safe.sh__signals.patch
new file mode 100644
index 0000000..be06efb
--- /dev/null
+++ b/debian/patches/38_scripts__mysqld_safe.sh__signals.patch
@@ -0,0 +1,44 @@
+Author: Christian Hammers <ch@debian.org>
+Subject: Executes /etc/init.d/mysql on signals
+ Note if you check the bug report on mysql.com the patch is accepted
+ as interesting but they were waiting on Christian Hammers to sign an SCA.
+ Meanwhile this bug report fell off in the transition from 5.0 to 5.1.
+Bug: http://bugs.mysql.com/bug.php?id=31361
+Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527623
+Last-Update: 2012-03-07
+Reviewed-by: Nicholas Bamber <nicholas@periapt.co.uk>
+
+--- a/scripts/mysqld_safe.sh
++++ b/scripts/mysqld_safe.sh
+@@ -29,8 +29,6 @@
+ syslog_tag_mysqld=mysqld
+ syslog_tag_mysqld_safe=mysqld_safe
+
+-trap '' 1 2 3 15 # we shouldn't let anyone kill us
+-
+ umask 007
+
+ defaults=
+@@ -132,7 +130,7 @@
+ # sed buffers output (only GNU sed supports a -u (unbuffered) option)
+ # which means that messages may not get sent to syslog until the
+ # mysqld process quits.
+- cmd="$cmd 2>&1 | logger -t '$syslog_tag_mysqld' -p daemon.error"
++ cmd="$cmd 2>&1 | logger -t '$syslog_tag_mysqld' -p daemon.error & wait"
+ ;;
+ *)
+ echo "Internal program error (non-fatal):" \
+@@ -711,6 +709,13 @@
+ fi
+
+ #
++# From now on, we catch signals to do a proper shutdown of mysqld
++# when signalled to do so.
++#
++trap '/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf refresh & wait' 1 # HUP
++trap '/usr/bin/mysqladmin --defaults-extra-file=/etc/mysql/debian.cnf shutdown' 2 3 15 # INT QUIT and TERM
++
++#
+ # Uncomment the following lines if you want all tables to be automatically
+ # checked and repaired during startup. You should add sensible key_buffer
+ # and sort_buffer values to my.cnf to improve check performance or require