Stay_alive : Service will stop on logout if FalseĬls._svc_display_name_ = display_name or name Self.ReportServiceStatus(win32service.SERVICE_STOPPED)ĭef instart(cls, name, description, display_name=None, stay_alive=True):Ĭls : the class (derived from Service) that implement the Serviceĭisplay_name : the name displayed in the service manager Self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) Win32event.WaitForSingleObject(self.stop_event, win32event.INFINITE) Self.ReportServiceStatus(win32service.SERVICE_RUNNING) Self.ReportServiceStatus(win32service.SERVICE_START_PENDING) Self.stop_event = win32event.CreateEvent(None, 0, 0, None) Win32serviceutil.ServiceFramework._init_(self, *args) _svc_description_ = '_Description template' Winservice.py from os.path import splitext, abspathĬlass Service(win32serviceutil.ServiceFramework): I have seen that many people have had this issue but I can't seem to find a definitive answer as to how to fix this. exe the service installs but does not start and I get the following error error 1053 the service did not respond to the start or control request in a timely fashion I have been trying to create an executable using pyinstaller because i've seen the same issue with py2exe. When I do this the service installs and starts correctly. If I run my script from the command prompt python runService.py I have written a Windows service in python.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |