diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-06 21:55:01 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-08-06 21:55:01 +0000 |
commit | 6c657e45fd278bba5973fb85563c8cf1abd26088 (patch) | |
tree | cf4f7b0c22010135809895e0ee5d9eeee3fbfd43 | |
parent | 552be206b2fbf6f590be4e536bb7cd757f6f29dd (diff) |
Add -notraceback startup option, disables automatic backtrace facility so that you can do it yourself with a coredump and gdb (auto backtrace doesnt dump cores)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4751 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/inspircd.h | 2 | ||||
-rw-r--r-- | src/inspircd.cpp | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index e698efe21..0ebad50a8 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -89,7 +89,7 @@ class InspIRCd : public classbase void BuildISupport(); void MoveTo(std::string modulename,int slot); void Start(); - void SetSignals(); + void SetSignals(bool SEGVHandler); bool DaemonSeed(); void MakeLowerMap(); void MoveToLast(std::string modulename); diff --git a/src/inspircd.cpp b/src/inspircd.cpp index a2b4e0d92..b5aa33b5e 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -155,13 +155,14 @@ void Rehash(int status) FOREACH_MOD(I_OnRehash,OnRehash("")); } -void InspIRCd::SetSignals() +void InspIRCd::SetSignals(bool SEGVHandler) { signal (SIGALRM, SIG_IGN); signal (SIGHUP, Rehash); signal (SIGPIPE, SIG_IGN); signal (SIGTERM, Exit); - signal (SIGSEGV, Error); + if (SEGVHandler) + signal (SIGSEGV, Error); } bool InspIRCd::DaemonSeed() @@ -232,6 +233,8 @@ void InspIRCd::MakeLowerMap() InspIRCd::InspIRCd(int argc, char** argv) { + bool SEGVHandler = false; + this->Start(); module_sockets.clear(); this->startup_time = time(NULL); @@ -268,6 +271,10 @@ InspIRCd::InspIRCd(int argc, char** argv) { printf("WARNING: The `-nolimit' option is deprecated, and now on by default. This behaviour may change in the future.\n"); } + else if (!strcmp(argv[i],"-notraceback")) + { + SEGVHandler = false; + } else if (!strcmp(argv[i],"-logfile")) { if (argc > i+1) @@ -292,7 +299,7 @@ InspIRCd::InspIRCd(int argc, char** argv) this->stats = new serverstats(); this->Parser = new CommandParser(); Config->ClearStack(); - Config->Read(true,NULL); + Config->Read(true, NULL); CheckRoot(); this->ModeGrok = new ModeParser(); AddServerName(Config->ServerName); @@ -306,7 +313,7 @@ InspIRCd::InspIRCd(int argc, char** argv) memset(&Config->implement_lists,0,sizeof(Config->implement_lists)); printf("\n"); - this->SetSignals(); + this->SetSignals(SEGVHandler); if (!Config->nofork) { if (!this->DaemonSeed()) |