]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
make traceback handler optional, closes #497
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 11 Oct 2012 08:30:56 +0000 (08:30 +0000)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Thu, 11 Oct 2012 08:30:56 +0000 (08:30 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2798 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/common_startup.cc
pdns/pdns.conf-dist
pdns/receiver.cc

index 0f0dd0bac16bc8b0f20a2810c6ff833fcd09050a..258e03eb01312f3dd3b44daddca47b8ceebd929c 100644 (file)
@@ -136,6 +136,8 @@ void declareArguments()
   ::arg().set("entropy-source", "If set, read entropy from this file")="/dev/urandom";
 
   ::arg().set("lua-prequery-script", "Lua script with prequery handler")="";
+
+  ::arg().setSwitch("traceback-handler","Enable the traceback handler (Linux only)")="yes";
 }
 
 void declareStats(void)
index 873f6f7f37aeb18f056eaf6509c5511d684830d9..c85c16d9333e1df57041394623e14d255ae25bd1 100644 (file)
 #
 # tcp-control-secret=
 
+#################################
+# traceback-handler    Enable the traceback handler (Linux only)
+#
+# traceback-handler=yes
+
 #################################
 # trusted-notification-proxy   IP address of incoming notification proxy
 #
index 96e714c1aa44a03057528ec8d9ec922bef29cac2..d66a633b9a8b9d7726d2534c9fa833bb51608656 100644 (file)
@@ -466,7 +466,17 @@ int main(int argc, char **argv)
 
     
     // we really need to do work - either standalone or as an instance
-    
+
+#ifdef __linux__
+    if(!::arg().mustDo("traceback-handler")) {
+      L<<Logger::Warning<<"Disabling traceback handler"<<endl;
+      signal(SIGSEGV,SIG_DFL);
+      signal(SIGFPE,SIG_DFL);
+      signal(SIGABRT,SIG_DFL);
+      signal(SIGILL,SIG_DFL);
+    }
+#endif
+
     seedRandom(::arg()["entropy-source"]);
     
     loadModules();