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 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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,...
|
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...
|
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.*/...
|
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.
|
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...
|
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
|
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...
|
by: Yves Dorfsman |
last post by:
I did a few tests with this script:
class byebye:
def __del__(self):
print 'Bye, bye...'
x = byebye()
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
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...
|
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...
|
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,...
|
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...
|
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...
| |