Merge branch '2.1' into develop

MXS-1377
This commit is contained in:
Johan Wikman
2017-09-20 11:01:16 +03:00
2 changed files with 10 additions and 4 deletions

View File

@ -1278,6 +1278,7 @@ int main(int argc, char **argv)
void (*exitfunp[4])(void) = { mxs_log_finish, cleanup_process_datadir, write_footer, NULL };
MXS_CONFIG* cnf = NULL;
int numlocks = 0;
bool pid_file_created = false;
Worker* worker;
*syslog_enabled = 1;
@ -1895,6 +1896,8 @@ int main(int argc, char **argv)
rc = MAXSCALE_ALREADYRUNNING;
goto return_main;
}
pid_file_created = true;
}
if (!redirect_output_to.empty())
@ -2124,18 +2127,21 @@ int main(int argc, char **argv)
utils_end();
cleanup_process_datadir();
MXS_NOTICE("MaxScale shutdown completed.");
if (unload_modules_at_exit)
{
unload_all_modules();
}
/* Remove Pidfile */
unlock_pidfile();
unlink_pidfile();
ERR_free_strings();
EVP_cleanup();
return_main:
if (pid_file_created)
{
unlock_pidfile();
unlink_pidfile();
}
mxs_log_flush_sync();