def cmd_process(args, sender): if args.stopserver: if sender.code == config['interface'][sender.interface_name]['admin_id']: sender.send_message('Server is shutting down') logger.info('server is shutting down') for service in service_instances: logger.debug('stopping service: ' + service) service_instances[service].stop() logger.debug(service + ' is stopped') logger.debug('stopping command server') command_server.stop() return if args.listservices: msg = io.BytesIO() for service in service_instances: print(service_instances[service], file=msg) sender.send_message(msg.getvalue()) return
def stop(wait=True): """Stop command receiving thread""" command_server.stop() pass