views:

122

answers:

2

I'm dealing with a python-written server that locks up, and stops working, including logging. I wonder if there's a python equivalent to java's "kill -3" signal that at least prints the current stacktrace.

A: 

You can find a (Unix-only) solution in this question.

AndiDog
+1  A: 
import signal, traceback
def quit_handler(signum,frame):
    traceback.print_stack()
signal.signal(signal.SIGQUIT,quit_handler)
gnibbler
If the server "locks up", it doesn't necessarily get a SIGQUIT signal, I guess.
AndiDog