twisted signal handler override or cleanup code

Diez B. Roggisch deetsNOSPAM at
Wed Sep 1 16:04:30 CEST 2004


google doesn't give me anything on this, so I have to ask:

I've got a xmlrpc-server running using twisted. Using the cookbook-recipe
for daemonizing, it stores a file with its pid when in daemon mode.

Now I want to remove that file when the server is shutdown - this boils down
to the twisted reactors run()-method beeing terminated.

Unfortunately, twisted sets its on signal handlers, so killing my app
doesn't allow me to perform cleanup-code. I'm sure there are good reasons
for that, and I'm actually not interested in signals especially - but there
must be some way to install a sort of callback when the reactor gets down,
for whatever reason.

But as I said, no docs on that. 


Diez B. Roggisch

More information about the Python-list mailing list