[python-win32] Python Service Won't Start, But Does Debug

Mark Hammond skippy.hammond at gmail.com
Thu Apr 30 02:06:11 CEST 2009


Robert Robinson wrote:
> I'm new to using the win32 module and I've written a little service in
> python for myself.  It runs fine and without errors when I use debug:
>> python myService.py debug
> Debugging service myService - press Ctrl+C to stop.
> 
> This works and prints to a log file I set up just fine, so I know it's
> working properly
> 
> However when I try using the start command on the same service It says
> it's started, but hasn't:
>> python myService.py start
> Starting service myService
> 
> Then after any amount of time:
>> python myService.py stop
> Stopping service myService
> Error stopping service: The service has not been started. (1062)

Your code is probably hitting some error when run as a service - check 
the Windows event log for tracebacks etc...

Mark



More information about the python-win32 mailing list