Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > twisted signal handler override or cleanup code

Reply
Thread Tools

twisted signal handler override or cleanup code

 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      09-01-2004
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.

--
Regards,

Diez B. Roggisch
 
Reply With Quote
 
 
 
 
Jp Calderone
Guest
Posts: n/a
 
      09-01-2004
Diez B. Roggisch wrote:
> 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/c...wistd-man.html

http://twistedmatrix.com/documents/c...to/application

Jp
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: [Twisted-Python] Twisted 13.0.0 released Glyph Python 0 04-03-2013 09:36 PM
Re: [Twisted-Python] Twisted 12.3.0 released Glyph Python 0 12-27-2012 06:40 AM
Re: [Twisted-Python] Re-working a synchronous iterator to use Twisted Jean-Paul Calderone Python 0 06-17-2008 10:14 PM
no cleanup on TERM signal Yves Dorfsman Python 4 05-02-2008 03:17 PM
Override default signal handler in interactive shell pkassianidis@gmail.com Python 0 03-27-2006 09:02 AM



Advertisments