Stopping Windows Service

Paul Metzger pmetzger at bellsouth.net
Wed Mar 1 09:58:26 EST 2006


On Wed, 2006-03-01 at 12:41 -0800, D wrote:
> I have a simple file server utility that I wish to configure as a
> Windows service - using the examples of the Python Win32 book, I
> configured a class for the service, along with the main class functions
> __init__, SvcStop, and SvcDoRun (which contains my server code).  After
> registering the service, I am able to start it with no problems.
> However, it never stops correctly (net stop returns "service could not
> be stopped") and service is left in a Stopping state. My gut tells me
> there's something additional I need to include in the SvcDoRun function
> in order to have it shutdown gracefully, but I'm not sure what.  Also,
> if that is the case, where should I place the statements within the
> function (i.e. right after the listen() statement?)?  Thanks as
> always..
At the risk of sounding like a geek, first problem I see is WIndows:)
Sorry couldn't help that one:) Seriously though, I would suggest that it
sounds like something is not letting the process go, which would be par
for the windows course. If you will post the snippet of code, I'm sure
we could help you a little more specifically.




More information about the Python-list mailing list