94 configfile = win32serviceutil.GetServiceCustomOption(
97 os.chdir(os.path.dirname(configfile))
98 self.
log(
"Using config file %s." % configfile)
99 self.
log(
"Logging at %s." % os.getcwd())
100 self.ReportServiceStatus(win32service.SERVICE_RUNNING)
108 options = DeviceServerOptions(
109 config_fpath=configfile,
110 logging_level=logging.INFO,
114 devices = validate_devices(configfile)
115 serve_devices(devices, options, self.
stop_event)
116 except Exception
as e:
117 servicemanager.LogErrorMsg(str(e))
120 self.
log(
"Service shutdown complete.")
121 self.ReportServiceStatus(win32service.SERVICE_STOPPED)