[Twisted-Python] Re: SIGBREAK on windows
ralf at brainbot.com
Wed Sep 27 04:32:39 EDT 2006
Jacob Gabrielson wrote:
> Has anyone run into a problem where their Twisted application gets a
> SIGBREAK and shuts down, on Windows? I have a simple application using
> the ReconnectingClientFactory, running as a service (via srvany.exe),
> that occasionally dies with a few messages:
> 2006/09/24 16:46 Pacific Daylight Time [-] Received SIGBREAK, shutting
> 2006/09/24 16:46 Pacific Daylight Time [AgentProtocol,client]
> <twisted.internet.tcp.Connector instance at 0x00A1B468> will retry in 2
> 2006/09/24 16:46 Pacific Daylight Time [AgentProtocol,client] Stopping
> factory <twisted.internet.protocol.ReconnectingClientFactory instance at
> 2006/09/24 16:46 Pacific Daylight Time [-] Main loop terminated.
> There's not a lot to go on, but I'm wondering if this is something
> anyone else has run into on Windows. I'm not really sure how a SIGBREAK
> could get generated there in the first place.
You may receive that signal when users log off. I'm using the following
code to ignore signals when running as service (but I'm also using the
win32serviceutil module to start as a service).
print "received signal %s" % (sig,)
However, I guess that if you're using that code unchanged you might not
be able to stop your service anymore.
More Information can be found at msdn:
You might also want to look into using the win32service module. IMHO,
it's a lot easier to handle than srvany. I'm attaching our nbsvc program
as example, which we use to start our programs as NT services.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Twisted-Python