On Thu, 6 Oct 2005 16:20:01 +0100, Paul Moore <[EMAIL PROTECTED]> wrote

>This is a very odd problem. I have a module that I want to package up
>as a service - it has a "Registry" class, with mainloop and stop
>methods (the former sits in an infinite loop, the latter signals the
>loop to terminate). ... 
>
>However, when I install and debug the service, and hit Ctrl-C to stop
>it, I get the error "Registry instance has no attribute 'stop'"!!!
>...
>  
>
>Debugging service RegistryQueryService - press Ctrl+C to stop.
>Stopping debug service.
>Stopping debug service.
>Error 0xC000000B - The Python service control handler failed.
>
>  File "C:\Apps\Python24\lib\site-packages\win32\lib\win32serviceutil.py", line
>701, in ServiceCtrlHandler
>    self.SvcStop()
>  File "D:\Data\RegQueries\service.py", line 14, in SvcStop
>
>exceptions.AttributeError: Registry instance has no attribute 'stop'
>
>I'm baffled. I've added debug prints displaying my registry object,
>its dir(), the stop method, and they all look fine. Why can't
>SvcStop() find the method???
>  
>

0xC000000B is "invalid client ID".  If I had to guess, I'd guess that it 
actually WAS executing self.reg.stop(), but is getting an error during 
some OS operation, and the interpreter is misdiagnosing the results.

What does self.reg.stop() do?  Is it possible you're doing some 
operation that tries to cross a user boundary?  Services run as 
LOCAL_SYSTEM, and there are some things you can't do to service processes.

-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to