473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

twisted signal handler override or cleanup code

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
Jul 18 '05 #1
1 4040
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
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Gary Robinson | last post by:
In some code we're writing we're making an assumption, and I'd like to confirm that the assumption is valid. Suppose a signal arrives while a file is being written, and the signal handler...
0
by: steffen staehle | last post by:
Hi, I'm writing a server process which spawns child processes via fork This server process should keep track of the number of children stil running, do the necessary cleanup to avoid zombies,...
2
by: lpw | last post by:
I have dilligently reviewed FAQ-lite Section 3.2, "How do I pass a pointer-to-member-function to a signal handler, X event callback, system call that starts a thread/task, etc." The only...
3
by: Martin McCormick | last post by:
A C program contains several signal statements to remove a lock file if the program gets killed: /*Set up interrupt handler to catch ctrl-C so that lock file can be removed.*/...
11
by: Jackie | last post by:
Hi everyone, I'd like to know when and how signals are used (e.g. SIGFPE, SIGABRT, SIGTERM, SIGSEGV, SIGINT)? Thank you so much.
7
by: Amit Sharma | last post by:
Hi, I want to write a program, where until we give the value of j as non zero, it should go on asking us values of i and j, displaying the message "Division by zero: Floating point exception" for...
1
by: stalex | last post by:
Hi all, I wrote the following code since I want to try using a decorator to install signal handler: ## The test.py script ################# import os import time import signal
5
by: david | last post by:
I'm developing a program that runs using an asyncore loop. Right now I can adequately terminate it using Control-C, but as things get refined I need a better way to stop it. I've developed...
5
by: Yves Dorfsman | last post by:
I did a few tests with this script: class byebye: def __del__(self): print 'Bye, bye...' x = byebye()
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.