twisted signal handler override or cleanup code

Discussion in 'Python' started by Diez B. Roggisch, Sep 1, 2004.

  1. 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
    Diez B. Roggisch, Sep 1, 2004
    #1
    1. Advertising

  2. Diez B. Roggisch

    Jp Calderone Guest

    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/current/man/twistd-man.html

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

    Jp
    Jp Calderone, Sep 1, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    329
  2. Jean-Paul Calderone
    Replies:
    0
    Views:
    430
    Jean-Paul Calderone
    Jun 17, 2008
  3. Glyph
    Replies:
    0
    Views:
    164
    Glyph
    Dec 27, 2012
  4. Glyph
    Replies:
    0
    Views:
    139
    Glyph
    Apr 3, 2013
  5. Glyph
    Replies:
    0
    Views:
    40
    Glyph
    May 12, 2014
Loading...

Share This Page