[Win32utils-devel] Win32 Service Timeout command

Berger, Daniel Daniel.Berger at qwest.com
Tue Nov 22 17:06:24 EST 2005

> -----Original Message-----
> From: Jamey Cribbs [mailto:cribbsj at oakwood.org] 
> Sent: Tuesday, November 22, 2005 2:44 PM
> To: Berger, Daniel
> Subject: Win32 Service Timeout command
> Hi, Dan.  I have  a quick question.  Is there a way to set a timeout 
> variable when starting/creating a win32 service using your package?  
> When I attempt to start a KirbyBase process as a service, I have 
> KirbyBase building in-memory indexes before it returns.  This 
> can take a 
> few seconds for large indexes.  When I attempt to do this by 
> starting it 
> as a win32 service, it bombs out telling me the application didn't 
> respond in a timely manner.
> If I remove the indexes so that KirbyBase initialization 
> returns a lot 
> sooner, everything works fine.  Is there any way to tell 
> win32 service 
> to increase the timeout variable?
> I looked through the docs and the example programs but didn't see 
> anything.  I googled and did find something about a "timeout 
> hint", but 
> I don't know how to apply it to your package.
> Thanks for any help you can give!
> Jamey Cribbs

Hi Jamey,

I've cc'd the win32utils-devel mailing list for some additional

Heesob, is this because of the default 2 second WaitHint value that
StartService() uses?

If so, I think the solution is to allow a "timeout=" option in the
Service.create_service method, and wrap the StartService() function in a
"while dwCurrentState == SERVICE_START_PENDING; sleep(x)" type of loop.
I'm basing my opinion on this link:


Does that seem a reasonable approach?

Of course, this would still mean Jamey would have to guess at a timeout
value.  Is there a better approach in general?



More information about the win32utils-devel mailing list