The service coded below appears to hang under win2000 (sp2) when I try to
stop the service.
The PythonService.exe process seems to be exitting properly, but for some
reason the 
win2000 services control panel doesn't realize this and keeps accusing it of
timing out.

It hangs whether or not I have the last line of SvcStop commented.

I've written another service which does its job perfectly, except for giving
the appearance
of a hang.

Any help would be greatly appreciated.

Thanks in advance,
-Jeremy


"""Test service which does nothing

"""
# imports and globals ##################################################
import threading
import win32service
import win32serviceutil

# Classes ##########################################################
class testsvc(win32serviceutil.ServiceFramework):
        _svc_name_ = "testsvc"
        _svc_display_name_ = "Python-Based Test Service"

        def __init__(self, args):
                win32serviceutil.ServiceFramework.__init__(self, args)
                self._killswitch = threading.Event()
                self._killedswitch = threading.Event()

        def SvcDoRun(self):
                self._killswitch.wait()
                self._killedswitch.set()

        def SvcStop(self):
                self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
                self._killswitch.set()
                self._killedswitch.wait()
                # self.ReportServiceStatus(win32service.SERVICE_STOPPED)

if __name__ == "__main__":
        win32serviceutil.HandleCommandLine(testsvc)


_________________________________________________________________________

Alison Associates

The information contained in this e-mail and any attached files is intended only for 
the use of the person(s) to whom it is addressed and may be privileged, confidential 
and exempt from disclosure under applicable law. The views of the author may not 
necessarily reflect the views of the Company. If you are not the intended recipient 
please do not copy or convey this message or any attached files to any other person 
but delete this message and any attached files and notify us of incorrect receipt via 
e-mail to [EMAIL PROTECTED] 

_____________________________________________________________________
This message has been checked for all known viruses by MessageLabs.
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython

Reply via email to