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

The Jetman jetman516 at hotmail.com
Sat Sep 27 03:12:44 CEST 2003


I'm reading source code, but I haven't found any examples of 
how to simply shutdown my XML-RPC server.  I've done some nice things 
w/ it so far.  I can upload and dload arbitrary files, remotely execute 
sys commands, etc.  But I now want to use this code in a production 
project and essentially control a FreeBSD box from a MSOFT Access 
DB application.  But the only Python fn I haven't been able to coerce 
into submission is sys.exit() !

Here's my server method:

    def sys_Shutdown( self ):
        #   don't work as is....
        sys.exit( 0 )
        return 0

And here's what happens:

Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "D:\PYTHON22\lib\xmlrpclib.py", line 821, in __call__
    return self.__send(self.__name, args)
  File "D:\PYTHON22\lib\xmlrpclib.py", line 975, in __request
    verbose=self.__verbose
  File "D:\PYTHON22\lib\xmlrpclib.py", line 853, in request
    return self.parse_response(h.getfile())
  File "D:\PYTHON22\lib\xmlrpclib.py", line 896, in parse_response
    return u.close()
  File "D:\PYTHON22\lib\xmlrpclib.py", line 571, in close
    raise apply(Fault, (), self._stack[0])
Fault: <Fault 1: 'exceptions.SystemExit:0'>

This is really bugging me, since I built everything else on 
my own.  Any ideas ?   Jet




More information about the Python-list mailing list