[2.2.1]How To Gracefully Shutdown an XML-RPC Server

The Jetman jetman516 at hotmail.com
Sat Sep 27 19:20:06 EDT 2003


"Andrew Dalke" <adalke at mindspring.com> wrote in message news:<yx6db.4829$RW4.3093 at newsread4.news.pas.earthlink.net>...
> The Jetman:
> > I'm reading source code, but I haven't found any examples of
> > how to simply shutdown my XML-RPC server.
> 
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/114579
> 
> Or you can ungracefully use os._exit, like pulling the emergency
> brake on a train.
> 
>                     Andrew
>                     dalke at dalkescientific.com

Andrew:

Thanx !  I *swear* I always spend at least a couple hours or so looking 
for stuf like this on my own !  That's the single most frustrating part 
about the Web (besides this idiotic W32.Swen virus/worm) !  No matter 
how you compose a query, there's always something that you miss....

BTW, I haven't tried it, but I bet os._exit will fail just like 
sys.exit().  Besides the reason for a graceful shutdown is more 
than cosmetic, since a forced shutdown (like a Ctrl-C) may occasionally 
leave the sockets allocated (which *has* happened.)

Later....Jet




More information about the Python-list mailing list