- case SIGHUP:
- traffCnt->Reload();
- modIter = modules.begin();
- for (; modIter != modules.end(); ++modIter)
- {
- if (modIter->Reload())
- {
- WriteServLog("Error reloading module '%s': '%s'", modIter->GetPlugin()->GetVersion().c_str(),
- modIter->GetStrError().c_str());
- printfd(__FILE__, "Error reloading module '%s': '%s'\n", modIter->GetPlugin()->GetVersion().c_str(),
- modIter->GetStrError().c_str());
- }
- }
- break;
- case SIGTERM:
- stop = true;
- break;
- case SIGINT:
- stop = true;
- break;
- case SIGPIPE:
- WriteServLog("Broken pipe!");
- break;
- case SIGCHLD:
- childPid = waitpid(-1, &status, WNOHANG);
-
- it = executersPid.find(childPid);
- if (it != executersPid.end())
- {
- executersPid.erase(it);
- if (executersPid.empty())
- stop = true;
- }
- break;
- default:
- WriteServLog("Ignore signel %d", sig);
- break;
+ case SIGHUP:
+ {
+ SettingsImpl newSettings(settings);
+ if (newSettings.ReadSettings())
+ WriteServLog("ReadSettings error. %s", newSettings.GetStrError().c_str());
+ else
+ settings = newSettings;
+ WriteServLog.setFileName(settings.GetLogFileName());
+ traffCnt.Reload();
+ manager.reload(settings);
+ break;
+ }
+ case SIGTERM:
+ running = false;
+ break;
+ case SIGINT:
+ running = false;
+ break;
+ case SIGPIPE:
+ WriteServLog("Broken pipe!");
+ break;
+ case SIGCHLD:
+ executers.erase(waitpid(-1, &status, WNOHANG));
+ if (executers.empty())
+ running = false;
+ break;
+ default:
+ WriteServLog("Ignore signal %d", sig);
+ break;