1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-10382 Using systemd, mariadb doesn't restart on crashes

when crashing on a signal, don't exit(), but re-signal it, so that
the caller could check WIFSIGNALED()
This commit is contained in:
Sergei Golubchik
2016-12-05 15:51:24 +01:00
parent 5142cd55f4
commit 76546a099c

View File

@ -75,7 +75,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
if (segfaulted)
{
my_safe_printf_stderr("Fatal " SIGNAL_FMT " while backtracing\n", sig);
_exit(1); /* Quit without running destructors */
goto end;
}
segfaulted = 1;
@ -301,9 +301,11 @@ end:
#ifndef __WIN__
/*
Quit, without running destructors (etc.)
Use a signal, because the parent (systemd) can check that with WIFSIGNALED
On Windows, do not terminate, but pass control to exception filter.
*/
_exit(1); // Using _exit(), since exit() is not async signal safe
signal(sig, SIG_DFL);
kill(getpid(), sig);
#else
return;
#endif