Skip to content

Commit

Permalink
Honor --initial after a crash , see #4659
Browse files Browse the repository at this point in the history
Closes #4659
  • Loading branch information
renecannao committed Sep 20, 2024
1 parent abae58e commit 29fc212
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,13 @@ bool ProxySQL_daemonize_phase3() {
// automatic reload of TLS certificates after a crash , see #4658
std::string msg;
ProxySQL_create_or_load_TLS(false, msg);
// Honor --initial after a crash , see #4659
if (GloVars.__cmd_proxysql_initial==true) {
std::cerr << "Renaming database file " << GloVars.admindb << endl;
char *newpath=(char *)malloc(strlen(GloVars.admindb)+8);
sprintf(newpath,"%s.bak",GloVars.admindb);
rename(GloVars.admindb,newpath); // FIXME: should we check return value, or ignore whatever it successed or not?
}
parent_close_error_log();
return false;
}
Expand Down

0 comments on commit 29fc212

Please sign in to comment.