making the server stop on a signal

Robert Olson olson at mcs.anl.gov
Tue Jan 28 07:10:14 CST 2003


I notice that on linux the VenueServer won't stop when sent a normal 
signal. The fix I found for this is to let the main thread  act as a sink 
for signals, and run the real server in a thread. From my test code, to 
give you the idea:

sthread = threading.Thread(target = server.serve_forever)
sthread.start()

try:
     while 1:
         time.sleep(1)

except:
     print "gotkeybaord int"
     os._exit(0)
     print "Exit done"




More information about the ag-dev mailing list