Calling xpra stop
(or even xpra exit
) cause the cleanups to run, but when sending a SIGINT
(ie: control-C) they don't...
Edited title: this only occurs when running from a console, not from an xterm!??? (also affects Fedora 20 and probably others too)
I don't really understand the problem, so this is more of an ugly workaround than a proper fix: r7134 fires all the cleanups from the server cleanup method which is called when we receive a signal.
This change was breaking profiling and has been reverted in r7181.
We need a solution that:
Bonus would be if we could also kill the vfb without killing the server process by ensuring that the cleanups close all the X11 server connections.
No idea why, but gtk_main
just exited without returning control to us when our sys.excepthook
override hack was in place, so r9197 unregisters it in the signal handler (and also from do_quit
for good measure) and the process now exits cleanly again when we send control-c to the console.
(will backport)
Re-opening because of ticket:852#comment:4, r9197 caused problems because of a typo. Maybe the implementation error is what made it work from the console?
Related: r9292 should make exit on CTRL_C more reliable on win32.
r9294 also makes it more likely that we won't just hang on a signal: the second signal should force quit - even if that means a less clean exit. (particularly relevant with gtk3)
Well, now that's interesting: it is the error (the typo) raised in the cleanup function which allowed the atcleanups functions to run, without it we end up running the server cleanups but not the regular python atexit cleanups. But we want both!
So r9295 uses sys.exit
from the signal handler, and that seems to do the trick. Do not ask why, I think I have tried everything else.
Will backport.
Found a related ticket: Bug 622084 - Ctrl+C does not exit gtk app.
Backports:
Closing, hopefully for the last time.
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/626