Service not stopping
Mark Hammond
MarkH at ActiveState.com
Mon Oct 22 06:42:32 EDT 2001
belen at netcom.no wrote:
> This a copy of my service... Can someone tell me wheta I have been
> doing wrong? It would be of great help. Thanks a lot!!!
...
> def SvcDoRun(self):
> self.Start_Scheduler()
>
> import servicemanager
>
> servicemanager.LogMsg(
> servicemanager.EVENTLOG_INFORMATION_TYPE,
> servicemanager.PYS_SERVICE_STARTED,
> (self._svc_name_,''))
>
> while 1:
> win32event.WaitForMultipleObjects
> ((self.hWaitStop,self.hSched),0,win32event.INFINITE)
> self.ReportServiceStatus
> (win32service.SERVICE_STOP_PENDING)
It looks to me like this function never returns. You almost certainly
need to check the result of WaitForMultipleObject, and if the result is
WAIT_OBJECT_0, break out of the loop.
Mark.
More information about the Python-list
mailing list