[REM] openerp-server.py: removed the dumpstack code from 5.0 as it is not compatible...
authorOlivier Dony <odo@openerp.com>
Fri, 24 Sep 2010 13:34:44 +0000 (15:34 +0200)
committerOlivier Dony <odo@openerp.com>
Fri, 24 Sep 2010 13:34:44 +0000 (15:34 +0200)
bzr revid: odo@openerp.com-20100924133444-rk8mte4uusdpixy2

bin/openerp-server.py

index f7b3c79..5f5f960 100755 (executable)
@@ -165,6 +165,9 @@ if tools.config['netrpc']:
                          "starting NET-RPC service, port %d" % (netport,))
 
 LST_SIGNALS = ['SIGINT', 'SIGTERM']
+if os.name == 'posix':
+    LST_SIGNALS.extend(['SIGUSR1','SIGQUIT'])
+
 
 SIGNALS = dict(
     [(getattr(signal, sign), sign) for sign in LST_SIGNALS]
@@ -190,26 +193,6 @@ def handler(signum, _):
 for signum in SIGNALS:
     signal.signal(signum, handler)
 
-
-import threading
-import traceback
-def dumpstacks(signum, _):
-    # code from http://stackoverflow.com/questions/132058/getting-stack-trace-from-a-running-python-application#answer-2569696
-
-    id2name = dict([(th.ident, th.name) for th in threading.enumerate()])
-    code = []
-    for threadId, stack in sys._current_frames().items():
-        code.append("\n# Thread: %s(%d)" % (id2name[threadId], threadId))
-        for filename, lineno, name, line in traceback.extract_stack(stack):
-            code.append('File: "%s", line %d, in %s' % (filename, lineno, name))
-            if line:
-                code.append("  %s" % (line.strip()))
-
-    logger.notifyChannel("dumpstacks", netsvc.LOG_INFO, "\n".join(code))
-
-if os.name == 'posix':
-    signal.signal(signal.SIGQUIT, dumpstacks)
-
 if tools.config['pidfile']:
     fd = open(tools.config['pidfile'], 'w')
     pidtext = "%d" % (os.getpid())