* ---------------------------------------------------
*/
+#include <signal.h>
+#include "exitcodes.h"
#include "inspircd.h"
+void InspIRCd::SignalHandler(int signal)
+{
+ switch (signal)
+ {
+ case SIGHUP:
+ Rehash();
+ break;
+ case SIGTERM:
+ Exit(signal);
+ break;
+ }
+}
+
+void InspIRCd::Exit(int status)
+{
+#ifdef WINDOWS
+ delete WindowsIPC;
+#endif
+ if (this)
+ {
+ this->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")");
+ this->Cleanup();
+ }
+ exit (status);
+}
+
+void InspIRCd::Rehash()
+{
+ this->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName));
+ this->CloseLog();
+ this->OpenLog(this->Config->argv, this->Config->argc);
+ this->RehashUsersAndChans();
+ FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect());
+ this->Config->Read(false,NULL);
+ this->ResetMaxBans();
+ this->Res->Rehash();
+ FOREACH_MOD_I(this,I_OnRehash,OnRehash(NULL,""));
+ this->BuildISupport();
+}
+
+void InspIRCd::RehashServer()
+{
+ this->WriteOpers("*** Rehashing config file");
+ this->RehashUsersAndChans();
+ this->Config->Read(false,NULL);
+ this->ResetMaxBans();
+ this->Res->Rehash();
+}
+
std::string InspIRCd::GetVersionString()
{
char versiondata[MAXBUF];
Config->Update005();
}
-
std::string InspIRCd::GetRevision()
{
return REVISION;
return false;
}
-