twisted signal handler override or cleanup code

  • Thread starter Diez B. Roggisch
  • Start date
D

Diez B. Roggisch

Hi,

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.
 
J

Jp Calderone

Diez said:
Hi,

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.

http://twistedmatrix.com/documents/current/man/twistd-man.html

http://twistedmatrix.com/documents/current/howto/application

Jp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top