Not much to it. Just follow the SimpleXMLRPCServer example from Python docs and register your shutdown function. Call it using xmlrpclib remotely. Actually, I prefer the telnet method below. Simple and straight forward.