[medusa] Question: killing/shuting down asyncore servers

Keith Davidson kbd@i...
Tue, 26 Sep 2000 09:52:48 -0400

I need to handle the same thing (i.e. cleanly handle 'kill' type shutdown
scenarios gracefully). It would be great if Medusa or asyncore provided
automatic support for this (preferably as an option since not everyone will
want it). Please post if you come up with a clean solution!


----- Original Message -----
From: "Jim Fulton" <jim@d...>
To: <medusa@egroups.com>
Sent: Tuesday, September 26, 2000 9:21 AM
Subject: [medusa] Question: killing/shuting down asyncore servers

> Are there any recommendations for shutting down
> asyncore-based servers cleanly from outside the
> servers?
> - Can a clean signal handler be written to
> handle kill events? I tried writing a signal
> handler that closed all the entries in the socket
> map, but I have a feeling that this isn't working
> properly. One of the problems I want to solve is
> getting the socket I'm listening on to close
> cleanly so that it isn't in use when I restart
> the server.
> I suspect I could make this work with some sort of
> dedicated select trigger. I think it probably wants
> to be dedicated because, if I used an existing select
> trigger, I'd need to worry about the possability that
> the signal would interrupt I/O on the select trigger.
> - I suppose I could include a shutdown server, such that
> if connections were made to this server, the application
> would shut-down cleanly. I could obviously generalize this
> to a more general control server, which might provide
> other commands. This approach is more portable, but
> requires clients more complicated than kill. :)
> How are other folks solving this problem?
> Jim
> --
> Jim Fulton mailto:jim@d...
> Technical Director (888) 344-4332 Python Powered!
> Digital Creations http://www.digicool.com http://www.python.org
> Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email
> address may not be added to any commercial mail list with out my
> permission. Violation of my privacy with advertising or SPAM will
> result in a suit for a MINIMUM of $500 damages/incident, $1500 for
> repeats.