summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-12-07 13:05:34 +0100
committerSergei Golubchik <serg@mariadb.org>2018-12-12 00:31:04 +0100
commit07e9b1389857a8c0fee1dfda443ae257982fd2c9 (patch)
tree879bfa4336527aabf9d1ce259a898df2a42fd1da /mysys
parent97dbb3562b0b230e01605f00e441e8a70d10b6a8 (diff)
downloadmariadb-git-07e9b1389857a8c0fee1dfda443ae257982fd2c9.tar.gz
mysqld: ignore SIGHUP sent by the kernel
SIGHUP causes debug info in the error log and reload of logs/privileges/tables/etc. The server should only do it when a user intentionally sends SUGHUP, not when a parent terminal gets disconnected or something. In particular, not ignoring kernel SIGHUP causes FLUSH PRIVILEGES at some random point during non-systemd Debian upgrades (Debian restarts mysqld, debian-start script runs mysql_upgrade in the background, postinit script ends and kernel sends SIGHUP to all background processes it has started). And during mysql_upgrade privilege tables aren't necessarily ready to be reloaded.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/thr_alarm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c
index 357923cf388..09c4984c069 100644
--- a/mysys/thr_alarm.c
+++ b/mysys/thr_alarm.c
@@ -731,7 +731,8 @@ static void *signal_hand(void *arg __attribute__((unused)))
DBUG_PRINT("info",("Starting signal and alarm handling thread"));
for(;;)
{
- while ((error=my_sigwait(&set,&sig)) == EINTR)
+ int code;
+ while ((error=my_sigwait(&set,&sig,&code)) == EINTR)
printf("sigwait restarted\n");
if (error)
{
@@ -805,8 +806,7 @@ int main(int argc __attribute__((unused)),char **argv __attribute__((unused)))
/* Start signal thread and wait for it to start */
mysql_mutex_lock(&LOCK_thread_count);
- mysql_thread_create(0,
- &tid, &thr_attr, signal_hand, NULL);
+ mysql_thread_create(0, &tid, &thr_attr, signal_hand, NULL);
mysql_cond_wait(&COND_thread_count, &LOCK_thread_count);
mysql_mutex_unlock(&LOCK_thread_count);
DBUG_PRINT("info",("signal thread created"));