Handling SIGTERM Gracefully?
Justin Donnelly
justin at cochese.com
Thu Feb 1 18:39:28 PST 2007
I'm trying to find a way to gracefully handle SIGTERM in my wxPython
app under Linux. I'd like to call Close() on my main frame from
somewhere so that its OnClose method can close a file. Although some
sources seem to indicate that sys.exitfunc or atexit will work when
SIGTERM is received, those handlers don't seem to get called and I
just see "Terminated" on the console. I also tried setting up a
signal handler using signal.signal. This sort of works. When I send
the SIGTERM (with the kill command), nothing happens, but as soon as I
invoke any event in my app (click on any button, for example), then my
handler is called and the app shuts down nicely.
Is there some step or method I'm missing?
Thanks in advance.
Justin
More information about the wxpython-users
mailing list